Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mimalloc allocator and adjust message save threshold #1492

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 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 bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name = "bench"
version = "0.2.0"
edition = "2021"
license = "Apache-2.0"
# Due to dependency to integration, which has a dependency to server, setting
# mimalloc on server is also setting it on bench.

[dependencies]
async-trait = "0.1.86"
Expand Down
2 changes: 1 addition & 1 deletion configs/server.toml
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ validate_checksum = false
# The threshold of buffered messages before triggering a save to disk (integer).
# Specifies how many messages accumulate before persisting to storage.
# Adjusting this can balance between write performance and data durability.
messages_required_to_save = 5000
messages_required_to_save = 1000

# Segment configuration
[system.segment]
Expand Down
2 changes: 1 addition & 1 deletion integration/tests/server/scenarios/system_scenario.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ pub async fn run(client_factory: &dyn ClientFactory) {
assert_eq!(topic.name, TOPIC_NAME);
assert_eq!(topic.partitions_count, PARTITIONS_COUNT);
assert_eq!(topic.partitions.len(), PARTITIONS_COUNT as usize);
assert_eq!(topic.size, 55890);
assert_eq!(topic.size, 55914);
assert_eq!(topic.messages_count, MESSAGES_COUNT as u64);
let topic_partition = topic.partitions.get((PARTITION_ID - 1) as usize).unwrap();
assert_eq!(topic_partition.id, PARTITION_ID);
Expand Down
10 changes: 2 additions & 8 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[package]
name = "server"
version = "0.4.152"
version = "0.4.153"
edition = "2021"
build = "src/build.rs"
license = "Apache-2.0"

[features]
default = []
mimalloc = ["dep:mimalloc"]
tokio-console = ["dep:console-subscriber", "tokio/tracing"]

[dependencies]
Expand Down Expand Up @@ -35,6 +34,7 @@ futures = "0.3.31"
human-repr = "1.1.0"
iggy = { path = "../sdk" }
jsonwebtoken = "9.3.1"
mimalloc = "0.1"
moka = { version = "0.12.10", features = ["future"] }
openssl = { version = "0.10.70", features = ["vendored"] }
opentelemetry = { version = "0.27.1", features = ["trace", "logs"] }
Expand Down Expand Up @@ -94,12 +94,6 @@ zip = "2.2.2"
[dev-dependencies]
mockall = "0.13.1"

[target.'cfg(not(target_env = "msvc"))'.dependencies]
mimalloc = { version = "0.1", optional = true }

[target.'cfg(target_env = "musl")'.dependencies]
mimalloc = { version = "0.1", features = ["override"] }

[build-dependencies]
figment = { version = "0.10.19", features = ["json", "toml", "env"] }
serde_json = "1.0.138"
Expand Down
2 changes: 0 additions & 2 deletions server/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#[cfg(any(feature = "mimalloc", target_env = "musl"))]
use mimalloc::MiMalloc;

#[cfg(any(feature = "mimalloc", target_env = "musl"))]
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

Expand Down