disable thp

This commit is contained in:
Conrad Ludgate
2024-10-03 14:29:52 +01:00
parent 6588edd693
commit 37f5a6434b
2 changed files with 7 additions and 1 deletions

View File

@@ -297,6 +297,7 @@ async fn main() -> anyhow::Result<()> {
build_tag: BUILD_TAG,
});
proxy::jemalloc::disable_thp()?;
let jemalloc = match proxy::jemalloc::MetricRecorder::new() {
Ok(t) => Some(t),
Err(e) => {

View File

@@ -9,7 +9,7 @@ use measured::{
text::TextEncoder,
LabelGroup, MetricGroup,
};
use tikv_jemalloc_ctl::{config, epoch, epoch_mib, stats, version};
use tikv_jemalloc_ctl::{config, epoch, epoch_mib, stats, version, Access, AsName, Name};
pub struct MetricRecorder {
epoch: epoch_mib,
@@ -114,3 +114,8 @@ jemalloc_gauge!(mapped, mapped_mib);
jemalloc_gauge!(metadata, metadata_mib);
jemalloc_gauge!(resident, resident_mib);
jemalloc_gauge!(retained, retained_mib);
pub fn disable_thp() -> Result<(), tikv_jemalloc_ctl::Error> {
let opt_thp: &Name = "opt.thp".name();
opt_thp.write("never")
}