Skip to content

Commit

Permalink
Increase vmap count in sys-tuner (#8940) (#9064)
Browse files Browse the repository at this point in the history
(cherry picked from commit a70008c)

Co-authored-by: sakridge <[email protected]>
  • Loading branch information
mergify[bot] and sakridge authored Mar 25, 2020
1 parent 03aae5e commit 5f2cf2b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sys-tuner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn tune_poh_service_priority(uid: u32) {
}

#[cfg(target_os = "linux")]
fn tune_kernel_udp_buffers() {
fn tune_kernel_udp_buffers_and_vmmap() {
use sysctl::CtlValue::String;
use sysctl::Sysctl;
fn sysctl_write(name: &str, value: &str) {
Expand All @@ -91,6 +91,9 @@ fn tune_kernel_udp_buffers() {
sysctl_write("net.core.rmem_default", "134217728");
sysctl_write("net.core.wmem_max", "134217728");
sysctl_write("net.core.wmem_default", "134217728");

// increase mmap counts for many append_vecs
sysctl_write("vm.max_map_count", "262144");
}

#[cfg(unix)]
Expand Down Expand Up @@ -145,7 +148,7 @@ fn main() {
info!("Tuning the system now");
#[cfg(target_os = "linux")]
{
tune_kernel_udp_buffers();
tune_kernel_udp_buffers_and_vmmap();
}
}
}
Expand Down

0 comments on commit 5f2cf2b

Please sign in to comment.