Skip to content

Commit

Permalink
perf(memory): use thread-local squence-based memory eviction policy
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx committed Apr 2, 2024
1 parent bc4f766 commit 9eb816a
Show file tree
Hide file tree
Showing 21 changed files with 696 additions and 246 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ignored = ["workspace-hack"]
normal = ["workspace-hack"]

[dependencies]
ahash = "0.8"
anyhow = "1"
arc-swap = "1"
arrow-array = { workspace = true }
Expand Down Expand Up @@ -48,6 +49,7 @@ fixedbitset = "0.5"
foyer = { workspace = true }
futures = { version = "0.3", default-features = false, features = ["alloc"] }
governor = { version = "0.6", default-features = false, features = ["std"] }
hashbrown = "0.14"
hex = "0.4.3"
http = "0.2"
humantime = "2.1"
Expand Down
24 changes: 24 additions & 0 deletions src/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,15 @@ pub struct StreamingDeveloperConfig {
#[serde(default = "default::developer::memory_controller_threshold_stable")]
pub memory_controller_threshold_stable: f64,

#[serde(default = "default::developer::memory_controller_eviction_factor_aggressive")]
pub memory_controller_eviction_factor_aggressive: f64,

#[serde(default = "default::developer::memory_controller_eviction_factor_graceful")]
pub memory_controller_eviction_factor_graceful: f64,

#[serde(default = "default::developer::memory_controller_eviction_factor_stable")]
pub memory_controller_eviction_factor_stable: f64,

#[serde(default = "default::developer::stream_enable_arrangement_backfill")]
/// Enable arrangement backfill
/// If true, the arrangement backfill will be disabled,
Expand Down Expand Up @@ -1566,12 +1575,27 @@ pub mod default {
pub fn memory_controller_threshold_aggressive() -> f64 {
0.9
}

pub fn memory_controller_threshold_graceful() -> f64 {
0.8
}

pub fn memory_controller_threshold_stable() -> f64 {
0.7
}

pub fn memory_controller_eviction_factor_aggressive() -> f64 {
2.0
}

pub fn memory_controller_eviction_factor_graceful() -> f64 {
1.5
}

pub fn memory_controller_eviction_factor_stable() -> f64 {
1.0
}

pub fn stream_enable_arrangement_backfill() -> bool {
true
}
Expand Down
2 changes: 2 additions & 0 deletions src/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ pub use risingwave_common_metrics::{
register_guarded_histogram_vec_with_registry, register_guarded_int_counter_vec_with_registry,
register_guarded_int_gauge_vec_with_registry,
};
pub mod lru;
pub mod opts;
pub mod range;
pub mod row;
pub mod sequence;
pub mod session_config;
pub mod system_param;
pub mod telemetry;
Expand Down
Loading

0 comments on commit 9eb816a

Please sign in to comment.