Skip to content

Commit

Permalink
store: Set the limiter to the same size as the query_semaphore
Browse files Browse the repository at this point in the history
  • Loading branch information
lutter authored and leoyvens committed Mar 15, 2024
1 parent 2c4d720 commit 5b5d400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions store/postgres/src/connection_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,8 @@ impl PoolInner {
builder.build_unchecked(conn_manager)
});

let limiter = Arc::new(Semaphore::new(pool_size as usize));
let max_concurrent_queries = pool_size as usize + ENV_VARS.store.extra_query_permits;
let limiter = Arc::new(Semaphore::new(max_concurrent_queries));
info!(logger_store, "Pool successfully connected to Postgres");

let semaphore_wait_gauge = registry
Expand All @@ -805,7 +806,6 @@ impl PoolInner {
const_labels,
)
.expect("failed to create `query_effort_ms` counter");
let max_concurrent_queries = pool_size as usize + ENV_VARS.store.extra_query_permits;
let query_semaphore = Arc::new(tokio::sync::Semaphore::new(max_concurrent_queries));
PoolInner {
logger: logger_pool,
Expand Down

0 comments on commit 5b5d400

Please sign in to comment.