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

enlarge max_open_files #3217

Merged
merged 3 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions config/src/storage_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,9 @@ pub struct RocksdbConfig {
}

impl RocksdbConfig {
#[cfg(any(target_os = "macos"))]
#[cfg(unix)]
fn default_max_open_files() -> i32 {
4096
}

#[cfg(any(target_os = "linux"))]
fn default_max_open_files() -> i32 {
4096
40960
nkysg marked this conversation as resolved.
Show resolved Hide resolved
}

#[cfg(windows)]
Expand Down
4 changes: 3 additions & 1 deletion node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ use starcoin_types::system_events::SystemStarted;
use std::sync::Arc;
use std::time::{Duration, SystemTime};

const RES_FDS: u64 = 4096;

pub struct NodeService {
registry: ServiceRef<RegistryService>,
}
Expand Down Expand Up @@ -277,7 +279,7 @@ impl NodeService {
"rocksdb max open files {}",
config.storage.rocksdb_config().max_open_files
);
check_open_fds_limit(config.storage.rocksdb_config().max_open_files as u64)?;
check_open_fds_limit(config.storage.rocksdb_config().max_open_files as u64 + RES_FDS)?;
let storage = Storage::new(StorageInstance::new_cache_and_db_instance(
CacheStorage::new_with_capacity(config.storage.cache_size(), storage_metrics.clone()),
DBStorage::new(
Expand Down