Skip to content

Commit e814d6b

Browse files
committed
Reduce in memory queue limit by 16x (#2455)
This was previously across all partitions, but since 1.1 its per partition. And it is 350M per partition. Those entries are not initially used, but as you scale to 1m invocations per partition, all the memory pages in the queue's ring buffer are dirtied and contribute to RSS. This leads to 9G of usage on a 24 partition node. This PR reduces the limit by 16x to 21M per partition, or 562M on a 24 partition node, which it will reach after 1.5 million invocations. A more manageable figure, even if it still appears as a 'leak' until that amount is reached.
1 parent 34d181c commit e814d6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/types/src/config/worker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub struct InvokerOptions {
163163
///
164164
/// Defines the threshold after which queues invocations will spill to disk at
165165
/// the path defined in `tmp-dir`. In other words, this is the number of invocations
166-
/// that can be kept in memory before spilling to disk.
166+
/// that can be kept in memory before spilling to disk. This is a per-partition limit.
167167
in_memory_queue_length_limit: NonZeroUsize,
168168

169169
/// # Limit number of concurrent invocations from this node
@@ -207,7 +207,7 @@ impl Default for InvokerOptions {
207207
None,
208208
Some(Duration::from_secs(10)),
209209
),
210-
in_memory_queue_length_limit: NonZeroUsize::new(1_056_784).unwrap(),
210+
in_memory_queue_length_limit: NonZeroUsize::new(66_049).unwrap(),
211211
inactivity_timeout: Duration::from_secs(60).into(),
212212
abort_timeout: Duration::from_secs(60).into(),
213213
message_size_warning: NonZeroUsize::new(10_000_000).unwrap(), // 10MB

0 commit comments

Comments
 (0)