Skip to content

Commit

Permalink
[Doc Retention] Tune knobs (#30835)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 17d71fc78d3a6c8fa23faef34fee6037e87f724b
  • Loading branch information
jordanhunt22 authored and Convex, Inc. committed Oct 23, 2024
1 parent 39c5662 commit 5611390
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/common/src/knobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ pub static INDEX_RETENTION_DELETE_PARALLEL: LazyLock<usize> =
/// How many parallel threads to use for deleting document log entries that have
/// expired.
pub static DOCUMENT_RETENTION_DELETE_PARALLEL: LazyLock<usize> =
LazyLock::new(|| env_config("DOCUMENT_RETENTION_DELETE_PARALLEL", 1));
LazyLock::new(|| env_config("DOCUMENT_RETENTION_DELETE_PARALLEL", 2));

/// INDEX_RETENTION_DELAY determines the size of the index retention window.
///
Expand Down Expand Up @@ -417,7 +417,7 @@ pub static INDEX_RETENTION_DELETE_CHUNK: LazyLock<usize> =

/// Chunk size of documents for deleting from Persistence.
pub static DOCUMENT_RETENTION_DELETE_CHUNK: LazyLock<usize> =
LazyLock::new(|| env_config("DOCUMENT_RETENTION_DELETE_CHUNK", 128));
LazyLock::new(|| env_config("DOCUMENT_RETENTION_DELETE_CHUNK", 256));

/// Batch size of index entries to delete between checkpoints.
pub static RETENTION_DELETE_BATCH: LazyLock<usize> =
Expand Down Expand Up @@ -449,10 +449,7 @@ pub static RETENTION_FAIL_ALL_MULTIPLIER: LazyLock<usize> =
/// also used to jitter document retention on startup to avoid a thundering
/// herd.
pub static DOCUMENT_RETENTION_BATCH_INTERVAL_SECONDS: LazyLock<Duration> = LazyLock::new(|| {
Duration::from_secs(env_config(
"DOCUMENT_RETENTION_BATCH_INTERVAL_SECONDS",
2 * 60,
))
Duration::from_secs(env_config("DOCUMENT_RETENTION_BATCH_INTERVAL_SECONDS", 60))
});

/// Maximum scanned documents within a single run for document retention unless
Expand Down

0 comments on commit 5611390

Please sign in to comment.