Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrize max open files and col state cache size #6584

Merged
merged 29 commits into from
Apr 14, 2022

Conversation

EdvardD
Copy link
Contributor

@EdvardD EdvardD commented Apr 12, 2022

Create store section in the neard config to pass various parameters to the store;
Add max_open_files and ColState cache size parameters,
Rework read_only store and enable statistics parameters.

@EdvardD EdvardD requested a review from a team as a code owner April 12, 2022 15:16
@EdvardD EdvardD requested a review from mm-near April 12, 2022 15:16
Copy link
Contributor

@mina86 mina86 left a comment

Choose a reason for hiding this comment

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

The default on Debian and Ubuntu is 1024 RLIMIT_NOFILE so this will cause failures in production. If we’re increasing the count we should also set the limit at startup. I’m doing that in recompress_storage so we should use something similar at command startup.

core/store/src/db.rs Outdated Show resolved Hide resolved
nearcore/src/config.rs Outdated Show resolved Hide resolved
nearcore/src/config.rs Outdated Show resolved Hide resolved
nearcore/src/config.rs Outdated Show resolved Hide resolved
nearcore/src/config.rs Outdated Show resolved Hide resolved
core/store/src/db.rs Outdated Show resolved Hide resolved
core/store/src/db.rs Outdated Show resolved Hide resolved
core/store/src/db.rs Outdated Show resolved Hide resolved
nearcore/src/lib.rs Outdated Show resolved Hide resolved
core/store/src/lib.rs Outdated Show resolved Hide resolved
core/store/src/db.rs Outdated Show resolved Hide resolved
@mm-near
Copy link
Contributor

mm-near commented Apr 12, 2022

@mina86 - AFAIK in production we already set the max open files to 65k (at least when running as systemctl).

But yes, doing the increase in the code might be nice - as it will decrease number of failures on user side.

What we could do @EdvardD - lower the value back to 512 in this PR - and afterwards send another PR That increases it to 10k and does the ulimit setting.

@EdvardD
Copy link
Contributor Author

EdvardD commented Apr 12, 2022

The default on Debian and Ubuntu is 1024 RLIMIT_NOFILE so this will cause failures in production. If we’re increasing the count we should also set the limit at startup. I’m doing that in recompress_storage so we should use something similar at command startup.

I was thinking of only running the daemon but you're right the client can run it one-off. I returned 512 in this PR and will increase the number in the followup.

core/store/src/db.rs Outdated Show resolved Hide resolved
nearcore/src/lib.rs Outdated Show resolved Hide resolved
@EdvardD EdvardD requested review from mm-near and mina86 April 13, 2022 10:45
core/store/src/db.rs Outdated Show resolved Hide resolved
core/store/src/lib.rs Outdated Show resolved Hide resolved
nearcore/src/config.rs Outdated Show resolved Hide resolved
nearcore/src/config.rs Outdated Show resolved Hide resolved
nearcore/src/config.rs Outdated Show resolved Hide resolved
nearcore/src/config.rs Outdated Show resolved Hide resolved
nearcore/src/lib.rs Outdated Show resolved Hide resolved
core/store/src/db.rs Outdated Show resolved Hide resolved
@EdvardD EdvardD requested a review from mina86 April 13, 2022 14:11
core/store/src/db.rs Outdated Show resolved Hide resolved
core/store/src/db.rs Outdated Show resolved Hide resolved
core/store/src/db.rs Outdated Show resolved Hide resolved
core/store/src/lib.rs Outdated Show resolved Hide resolved
core/store/src/lib.rs Outdated Show resolved Hide resolved
core/store/src/lib.rs Outdated Show resolved Hide resolved
core/store/src/lib.rs Outdated Show resolved Hide resolved
nearcore/src/config.rs Show resolved Hide resolved
@EdvardD EdvardD merged commit c20014c into master Apr 14, 2022
@EdvardD EdvardD deleted the parametrize_max_open_files_and_col_state_cache_size branch April 14, 2022 06:50
pompon0 pushed a commit that referenced this pull request Apr 15, 2022
Create store section in the neard config to pass various parameters to the store;
Add max_open_files and ColState cache size parameters,
Rework read_only store and enable statistics parameters.
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.

3 participants