Skip to content

Commit cc5edc9

Browse files
emmaling27Convex, Inc.
authored and
Convex, Inc.
committed
reduce FUNRUN_CLIENT_MAX_REQUESTS_PER_UPSTREAM 32 -> 25 (#24013)
Reduce `FUNRUN_CLIENT_MAX_REQUESTS_PER_UPSTREAM` default value from 32 to 25. This spreads load more evenly. GitOrigin-RevId: 1c783fa7372f1866305fa693d4a3219506f2ea16
1 parent b0e5a41 commit cc5edc9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

crates/common/src/knobs.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,9 +805,17 @@ pub static FUNRUN_FETCH_CLIENT_CACHE_SIZE: LazyLock<usize> =
805805
LazyLock::new(|| env_config("FUNRUN_FETCH_CLIENT_CACHE_SIZE", 100));
806806

807807
/// The maximum number of concurrent requests a single client can make to a
808-
/// single Funrun server. 25% out of the v8 limit of 128 threads is 32.
808+
/// single Funrun server.
809+
/// NOTE: When changing this value, ensure that the following parameters
810+
/// for pro satisfy this inequality. This makes sure that if one funrun instance
811+
/// is down, we still have enough capacity to satisfy requests if a backend is
812+
/// maxing out its concurrent function call limits.
813+
///
814+
/// max_concurrent_queries +
815+
/// max_concurrent_mutations + max_concurrent_v8_actions < (number of funrun
816+
/// nodes - 1) * FUNRUN_CLIENT_MAX_CONCURRENT_REQUESTS_PER_UPSTREAM
809817
pub static FUNRUN_CLIENT_MAX_REQUESTS_PER_UPSTREAM: LazyLock<usize> =
810-
LazyLock::new(|| env_config("FUNRUN_CLIENT_MAX_REQUESTS_PER_UPSTREAM", 32));
818+
LazyLock::new(|| env_config("FUNRUN_CLIENT_MAX_REQUESTS_PER_UPSTREAM", 25));
811819

812820
/// The maximum number of retries a Funrun client will perform. The client only
813821
/// retries overloaded errors.

0 commit comments

Comments
 (0)