mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 17:02:56 +00:00
set thp:never during build
This commit is contained in:
@@ -42,6 +42,7 @@ COPY --from=pg-build /home/nonroot/pg_install/v17/lib pg_i
|
||||
COPY --chown=nonroot . .
|
||||
|
||||
ARG ADDITIONAL_RUSTFLAGS
|
||||
ENV _RJEM_MALLOC_CONF="thp:never"
|
||||
RUN set -e \
|
||||
&& PQ_LIB_DIR=$(pwd)/pg_install/v${STABLE_PG_VERSION}/lib RUSTFLAGS="-Clinker=clang -Clink-arg=-fuse-ld=mold -Clink-arg=-Wl,--no-rosegment ${ADDITIONAL_RUSTFLAGS}" cargo build \
|
||||
--bin pg_sni_router \
|
||||
|
||||
@@ -297,7 +297,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
build_tag: BUILD_TAG,
|
||||
});
|
||||
|
||||
proxy::jemalloc::disable_thp()?;
|
||||
proxy::jemalloc::inspect_thp()?;
|
||||
let jemalloc = match proxy::jemalloc::MetricRecorder::new() {
|
||||
Ok(t) => Some(t),
|
||||
Err(e) => {
|
||||
|
||||
@@ -10,6 +10,7 @@ use measured::{
|
||||
LabelGroup, MetricGroup,
|
||||
};
|
||||
use tikv_jemalloc_ctl::{config, epoch, epoch_mib, stats, version, Access, AsName, Name};
|
||||
use tracing::info;
|
||||
|
||||
pub struct MetricRecorder {
|
||||
epoch: epoch_mib,
|
||||
@@ -115,7 +116,9 @@ 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")
|
||||
pub fn inspect_thp() -> Result<(), tikv_jemalloc_ctl::Error> {
|
||||
let opt_thp: &Name = c"opt.thp".to_bytes_with_nul().name();
|
||||
let s: &str = opt_thp.read()?;
|
||||
info!("jemalloc opt.thp {s}");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user