TMAegis
Thêm quy tắc cho cockroachdb

TMA-COCKROACHDB-2.5

Disable Linux Memory Swapping to Prevent Performance and Stability Issues

Trung bìnhCấp 1Tự độngcockroachdb

Mô tả

For production CockroachDB deployments on Linux VMs or bare-metal, it is a critical requirement to disable Linux memory swapping or ensure the system has adequate RAM to prevent swap usage. Swapping database memory pages to slow disk I/O introduces severe and unpredictable latency, compromising the database's performance and stability. The benchmark rates this recommendation Manual; the automated check covers its objective pass criterion. Passes when /proc/swaps lists no active swap device. Also confirm at least 4 GiB RAM per vCPU and that --cache plus 2x --max-sql-memory stays below 80% of RAM.

Cách kiểm tra

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

shell
[ -r /proc/swaps ] || exit 1; awk 'NR > 1 {n++} END {print n+0}' /proc/swaps
Đầu ra mong đợi
0

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

swapoff -a, remove swap entries from /etc/fstab (and set vm.swappiness=0), and size RAM to at least 4 GiB per vCPU.

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.5 Disable Linux Memory Swapping to Prevent Performance and Stability Issues

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