Skip to content

Commit

Permalink
fix(storage): set higher max readers (#1266)
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-starkware authored Oct 16, 2023
1 parent 32bf727 commit 5e611ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/papyrus_storage/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ type DbResult<V> = result::Result<V, DbError>;
/// There is a single non clonable writer instance, to make sure there is only one write transaction
/// at any given moment.
pub(crate) fn open_env(config: DbConfig) -> DbResult<(DbReader, DbWriter)> {
const MAX_READERS: u32 = 1 << 12; // 4096 readers
let env = Arc::new(
Environment::new()
.set_geometry(Geometry {
Expand All @@ -151,6 +152,7 @@ pub(crate) fn open_env(config: DbConfig) -> DbResult<(DbReader, DbWriter)> {
..Default::default()
})
.set_max_tables(MAX_DBS)
.set_max_readers(MAX_READERS)
.open(&config.path())?,
);
Ok((DbReader { env: env.clone() }, DbWriter { env }))
Expand Down

0 comments on commit 5e611ab

Please sign in to comment.