Skip to content

Conversation

@jcstein
Copy link
Member

@jcstein jcstein commented Feb 9, 2024

Overview

Resolves #1390. An issue was been reported cites the minimum required by badger is 1million+ and their bridge node requires 1330736 files open in badgerDB, but we currently have documented 4096, 65536, 65536 for light/full/bridge and 4096 documented for celestia-app.

This PR updates the values to ones suggested in the issue or in slack.

software previous value proposed value
celestia-app 4096 65535
celestia-node light 4096 1400000
celestia-node full 65536 1400000
celestia-node bridge 65536 1400000

This needs review from someone on these teams, as it impacts suggested parameter changes relevant to all of the teams:

  • @celestiaorg/celestia-node
  • @celestiaorg/celestia-core
  • @celestiaorg/devops

Reference

From badgerdb's documentation:
image

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Updated the systemd configuration guide to reflect increased file limit settings for service units, enhancing system performance and reliability.

@jcstein jcstein requested review from a team, Wondertan, cmwaters, distractedm1nd, evan-forbes and smuu and removed request for a team February 9, 2024 17:34
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-02-13 14:13 UTC

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2024

Walkthrough

The update to the systemd configuration file involves increasing the LimitNOFILE value for various services. This adjustment is crucial for ensuring that services, especially those relying on BadgerDB, have sufficient file descriptors available to operate efficiently in production environments. By significantly raising the limit from values as low as 4096 to as high as 1400000, the update aims to prevent issues related to the exhaustion of available file descriptors.

Changes

Files Change Summary
nodes/systemd.md Increased LimitNOFILE from 4096 to 16384, 65536 to 1400000, and 4096 to 1400000 for different services

Assessment against linked issues

Objective Addressed Explanation
Increase LimitNOFILE for systemd (Issue #1390)

Poem

In the land of code and wire,
A rabbit hopped, with dreams that aspire.
To lift the limits, high and wide,
A leap for services, with Badger by their side. 🐰💾🌟

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a71d105 and bf9501a.
Files selected for processing (1)
  • nodes/systemd.md (4 hunks)
Additional comments: 4
nodes/systemd.md (4)
  • 33-33: The LimitNOFILE value for celestia-appd has been increased to 16384. This change aligns with the PR objectives but consider verifying if this value suffices for all operational scenarios of celestia-appd. It might be lower than required for high-load environments.
  • 91-91: The LimitNOFILE value for the Celestia full storage node has been set to 1400000. This substantial increase directly addresses the requirements of badgerdb for production environments. Ensure this value does not exceed system limits or require additional configuration to be supported on all target deployment systems.
  • 129-129: The LimitNOFILE value for the Celestia bridge node is also set to 1400000. Similar to the full storage node, confirm that this value is within acceptable system limits and that users are guided on any necessary system configurations to support such a high limit.
  • 185-185: For the Celestia light node, the LimitNOFILE value is again set to 1400000. As with previous comments, ensure this setting is appropriate for light nodes, considering their expected workload and resource usage might differ from full nodes or bridge nodes.

@renaynay
Copy link
Member

Celestia light node shouldn't need that high of a limit though

@jcstein
Copy link
Member Author

jcstein commented Feb 12, 2024

Does it use badgerdb? Badegrdb suggests "a soft limit of 1048576"

@jcstein jcstein self-assigned this Feb 12, 2024
@Wondertan
Copy link
Member

I think we should remove this configuration from LN. The default hard limit in systemd is high enough(524288) for LN and since go1.20, the runtime gets up to the hard limit automatically.

@Wondertan
Copy link
Member

Wondertan commented Feb 12, 2024

@jcstein, LN uses badgerdb, but note that the shared link about limits is from Dgraph database which uses badgerdb underneath, so it's not for the badger itself. Badger needs less then that by default.

In case of FN/BN where we have multiple instances of badger and CAR files IO we definitely need more than badger suggests and the proposed value makes total sense.

@jcstein
Copy link
Member Author

jcstein commented Feb 12, 2024

Screenshot 2024-02-12 at 6 20 21 PM Screenshot 2024-02-12 at 6 20 50 PM

i'm not a db expert, but i'm nearly positive this is badgerDBs official documentation? and the google results, for example, only show other things which don't mention "db"

@jcstein
Copy link
Member Author

jcstein commented Feb 12, 2024

I think we should remove this configuration from LN. The default hard limit in systemd is high enough(524288) for LN and since go1.20, the runtime gets up to the hard limit automatically.

I'll suggest this on the pr

@jcstein jcstein requested a review from renaynay February 12, 2024 23:26
Copy link
Contributor

@rootulp rootulp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following up on this @jcstein 👍

Restart=on-failure
RestartSec=3
LimitNOFILE=4096
LimitNOFILE=65535
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM b/c this is what POPS uses.

@Wondertan
Copy link
Member

Wondertan commented Feb 13, 2024

i'm not a db expert, but i'm nearly positive this is badgerDBs official documentation? and the google results, for example, only show other things which don't mention "db"

@jcstein, the link in the description is about dgraph, not about Badger. From the link:

This page provides tips on how to troubleshoot issues with running Dgraph.

The screenshots are from Badger, and they are on the same website as Dgraph, but there are no guidelines on file limits for Badger in particular.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between bf9501a and 9125f3a.
Files selected for processing (1)
  • nodes/systemd.md (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • nodes/systemd.md

@jcstein jcstein merged commit d33aa93 into main Feb 13, 2024
@jcstein jcstein deleted the jcs/limitnofile-env-var branch February 13, 2024 14:12
@jcstein jcstein mentioned this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LimitNOFILE env var in systemd should be higher

5 participants