TMAegisBeta
Thêm quy tắc cho cockroachdb

CockroachDB

TMA-COCKROACHDB-2.6

Configure Transparent Huge Pages (THP) to madvise to Avoid Increased Memory Usage

ThấpCấp 1Tự độngcockroachdb

Mô tả

Linux Transparent Huge Pages (THP) is a kernel feature that automatically manages large memory pages to improve performance for some workloads. However, for databases such as CockroachDB, this behavior can cause unpredictable latency spikes, increased memory fragmentation, and excessive CPU overhead due to THP defragmentation. Cockroach Labs recommends configuring THP to madvise instead of the default always mode. The benchmark rates this recommendation Manual; the automated check covers its objective pass criterion. Passes when madvise is the selected (bracketed) Transparent Huge Pages mode.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
out=$(cat /sys/kernel/mm/transparent_hugepage/enabled 2>/dev/null) || exit 1; printf '%s\n' "$out" | grep -o '\[[a-z]*\]'
Đầu ra mong đợi
[madvise]

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

echo madvise > /sys/kernel/mm/transparent_hugepage/enabled (and defrag), then persist it at boot (kernel parameter transparent_hugepage=madvise or a systemd unit).

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
cockroachdbos
Tham chiếu
CIS CockroachDB v25.x Benchmark v1.0.0 - 2.6 Configure Transparent Huge Pages (THP) to madvise to Avoid Increased Memory Usage

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target cockroachdb