Skip to content

Commit

Permalink
chore: increase sql conn acquire rate limits
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Jun 18, 2024
1 parent 84c187e commit 6672145
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/pools/src/utils/sql_query_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ lazy_static::lazy_static! {
governor::clock::DefaultClock,
governor::middleware::NoOpMiddleware
> = governor::RateLimiter::direct(
// Limit how many connections can be created to the database
governor::Quota::per_second(std::num::NonZeroU32::new(16).unwrap())
// Allow creating at most 5 connections at the same time
.allow_burst(std::num::NonZeroU32::new(256).unwrap())
// Limit how fast the pool size can grow in order to encourage reusuing existing
// connections instead of opening new ones.
governor::Quota::per_minute(std::num::NonZeroU32::new(10 * 60).unwrap())
.allow_burst(std::num::NonZeroU32::new(500).unwrap())
);
}

Expand Down
4 changes: 2 additions & 2 deletions svc/pkg/cluster/standalone/default-update/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ pub async fn run_from_env(use_autoscaler: bool) -> GlobalResult<()> {
.into_iter()
.map(|(pool_type, pool)| {
let desired_count = match pool_type {
PoolType::Ats => Some(pool.desired_count),
PoolType::Job | PoolType::Gg => {
PoolType::Ats | PoolType::Gg => Some(pool.desired_count),
PoolType::Job => {
if use_autoscaler {
None
} else {
Expand Down

0 comments on commit 6672145

Please sign in to comment.