OS Tuning
ulimit:
is a command used to set or check user limits on system resources such as memory, CPU, and the number of open files. Below are common usages of ulimit:
Performance Governors (Linux):
Performance governors are part of Linux's CPU frequency scaling mechanisms, used to determine how the CPU frequency should be managed. Simply put, they control "how fast the CPU should run under different conditions." Common CPU governors include:
--governor, -g:
When set to performance, the CPU will always operate at its maximum frequency to deliver the highest computing performance. This will improve overall system performance.
Many companies execute the following command when conducting system performance testing to ensure that the CPU operates at its maximum frequency:
drop_caches:
To clear the Linux filesystem cache during testing or prior to benchmarking, the following command is used:
dirty_ratio:
When dirty pages exceed this ratio, the kernel starts writing them to disk aggressively:
swappiness:
It decides how much the kernel prefers swapping vs. keeping data in RAM.:
reclaim_mode:
It forces memory allocations to stay within the local NUMA node when possible.:
/sys/kernel/mm/transparent_hugepage/enabled:
This setting controls whether Transparent Huge Pages are used automatically by the kernel when allocating memory. It determines if the system should attempt to use huge pages for anonymous memory (e.g., heap, stack) without requiring explicit application support:
/sys/kernel/mm/transparent_hugepage/defrag:
This controls how aggressively the kernel should defragment memory to create huge pages. Defragmentation may cause latency spikes because the kernel must compact memory.:
SMT Control (Default = Auto):
SMT Control is a setting that enables or disables Simultaneous Multithreading (SMT), allowing each CPU core to execute one or more threads concurrently to improve multitasking performance or ensure thread isolation. Values for this BIOS option can be:
Power Profile Selection (Default = Efficiency Mode):
This setting controls how the system balances power efficiency and performance across CPU, memory, and I/O subsystems. Values for this BIOS option can be:
SVM Mode (Default = Enable):
SVM (Secure Virtual Machine) Mode is a BIOS setting that enables or disables hardware-assisted virtualization on AMD processors. When enabled, it allows the use of virtualization technologies such as AMD-V, which are required by hypervisors (e.g., VMware, Hyper-V, KVM) to run virtual machines with hardware-level isolation and improved performance. Values for this BIOS option can be:
SR-IOV Support (Default = Enabled):
SR-IOV (Single Root I/O Virtualization) is a hardware-assisted virtualization technology that allows a single physical PCIe device (such as a network interface card) to present multiple virtual functions (VFs) to the operating system or hypervisor. This enables more efficient and direct access to hardware for virtual machines, reducing I/O overhead and improving performance in virtualized environments. Values for this BIOS option can be:
TDP Control (Default = Auto):
TDP Control determines how the processor’s Thermal Design Power (TDP) is managed — either automatically by the system or manually by user-defined limits. This setting affects CPU power consumption and thermal behavior. Values for this BIOS option can be:
TDP (Default = 0):
TDP (Thermal Design Power) sets a power consumption target for the CPU in watts, helping manage thermal output and power limits during operation — especially relevant when TDP Control is set to Manual.
PPT Control (Default = Auto):
PPT Control (Package Power Tracking Control) determines whether the maximum allowable CPU package power (PPT limit) is automatically set by the system or manually defined by the user to control CPU power usage. Values for this BIOS option can be:
PPT (Default = 0):
PPT defines the upper limit of total power consumption (in watts) for the CPU package, including cores, cache, and SoC components, to ensure thermal and electrical safety.
ACPI CST C2 Latency (Default = 100):
ACPI CST C2 Latency defines the response time (in microseconds) for the processor to exit the C2 low-power state and return to full operation. This setting influences how quickly the CPU can resume tasks after being in power-saving mode.
NUMA Nodes Per Socket (Default = Auto):
NUMA Nodes Per Socket (NPS) determines how many NUMA (Non-Uniform Memory Access) domains are created per CPU socket, impacting memory locality, bandwidth, and latency for multi-threaded workloads. Values for this BIOS option can be:
DRAM Scrub Time (Default = 24hr):
DRAM Scrub Time defines the periodic interval for background memory error correction (memory scrubbing), which helps detect and repair soft errors (bit flips) in DRAM to improve system reliability. Values for this BIOS option can be:
L1 Stride Prefetcher (Default = Auto):
L1 Stride Prefetcher is a processor feature that attempts to pre-load data into the L1 cache by predicting memory access patterns with regular strides, helping improve performance by reducing cache miss latency. Values for this BIOS option can be:
APBDIS (Default = 0):
APBDIS (Application Power Brake Disable) is a BIOS setting that controls whether the CPU’s internal power throttling feature (Application Power Brake, APB) is enabled or disabled. APB dynamically reduces performance under certain conditions to meet power or thermal constraints. Values for this BIOS option can be:
DF Cstates (Default = Auto)
Much like CPU cores, the Infinity Fabric can go into lower power states while idle. However, there will be a delay changing back to full-power mode causing some latency jitter. In a low latency workload, or one with bursty I/O, one could disable this feature to achieve more performance with the tradeoff of higher power consumption:
Global C-state Control (Default = Auto)
dictates a CPU's ability to enter deep power-saving states when idle. Enabling it allows the CPU to use its most energy-efficient, deeper C-states (like C6), which saves power and lowers idle temperatures but can add slight latency when waking up. Disabling it forces the CPU to use shallower states (like C1/C1E), increasing power consumption and idle temperatures but may reduce latency for tasks requiring quick wake-up, which can sometimes prevent system stutters or instability in specific scenarios, particularly with certain CPUs
Last updated Aug 8, 2025.