Skip to content

Commit

Permalink
add reserve fds
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg committed Feb 17, 2022
1 parent d1c6caf commit 1c18901
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 1c18901

Please sign in to comment.