Skip to content

Commit 6e05b8e

Browse files
committed
don't apply immediately if we have queued items, only apply if job worker has all the capacity in the world. reduce apply timeout and apply queue
1 parent e6c1293 commit 6e05b8e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/corro-agent/src/agent/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ pub async fn handle_changes(
760760
// complicated loop to process changes efficiently w/ a max concurrency
761761
// and a minimum chunk size for bigger and faster SQLite transactions
762762
loop {
763-
while (buf_cost >= max_changes_chunk || !queue.is_empty())
763+
while (buf_cost >= max_changes_chunk || !queue.is_empty() && join_set.is_empty())
764764
&& join_set.len() < MAX_CONCURRENT
765765
{
766766
// Process if we hit the chunk size OR if we have any items and available capacity

crates/corro-types/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub const DEFAULT_GOSSIP_PORT: u16 = 4001;
88
const DEFAULT_GOSSIP_IDLE_TIMEOUT: u32 = 30;
99

1010
const fn default_apply_queue() -> usize {
11-
100
11+
50
1212
}
1313

1414
const fn default_wal_threshold() -> usize {
@@ -38,7 +38,7 @@ const fn default_small_channel() -> usize {
3838
}
3939

4040
const fn default_apply_timeout() -> usize {
41-
50
41+
10
4242
}
4343

4444
#[derive(Debug, Clone, Serialize, Deserialize)]

0 commit comments

Comments
 (0)