Skip to content

Commit 5469e5b

Browse files
committed
Reduce in memory queue limit by 16x
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 74a4c26 commit 5469e5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/types/src/config/worker.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub struct InvokerOptions {
179179
///
180180
/// Defines the threshold after which queues invocations will spill to disk at
181181
/// the path defined in `tmp-dir`. In other words, this is the number of invocations
182-
/// that can be kept in memory before spilling to disk.
182+
/// that can be kept in memory before spilling to disk. This is a per-partition limit.
183183
in_memory_queue_length_limit: NonZeroUsize,
184184

185185
/// # Limit number of concurrent invocations from this node
@@ -223,7 +223,7 @@ impl Default for InvokerOptions {
223223
None,
224224
Some(Duration::from_secs(10)),
225225
),
226-
in_memory_queue_length_limit: NonZeroUsize::new(1_056_784).unwrap(),
226+
in_memory_queue_length_limit: NonZeroUsize::new(66_049).unwrap(),
227227
inactivity_timeout: Duration::from_secs(60).into(),
228228
abort_timeout: Duration::from_secs(60).into(),
229229
message_size_warning: NonZeroUsize::new(10_000_000).unwrap(), // 10MB

0 commit comments

Comments
 (0)