Want to optimize the use of RAM in your Linux system? This will involve tuning (or optimizing) some kernel parameters. In order to do this, you'll need to go into the /etc/sysct..conf file, and modify (or add) some parameters there. Here are the parameters, along with some recommended values for each:
vm.dirty_background_ratio=5
vm.dirty ratio=10
vm.min_free_kybtes=65536
kernel.schedu_autogroup_enabled=0
Adjustment (or addtion) of these paraemters control how often dirty data is written to disk, reducing RAM usage, thus improving the performance of your Linux system!
Ah! lots of terms which can be confusing for many learners who are ready to take on L3 roles in their sysadmin journey.
The vm.dirty_background_ratio parameter determines the threshold, as a percentage of total RAM, at which the kernel's background write processes begin saving modified ("dirty") memory pages to disk.
The vm.dirty_ratio parameter sets a hard limit, also as a percentage of RAM, for dirty pages. Once this limit is reached, any process attempting to write new data will be temporarily halted until dirty pages are written out.
Reducing these percentage values encourages the kernel to write smaller amounts of changed data to disk more often. This can lead to lower peak I/O delays and reduced memory strain, especially when the system is handling significant write activity.
The vm.min_free_kbytes setting defines the absolute minimum amount of RAM, in kilobytes, that the kernel will keep free. Sets the size of the reserved free pages pool. It is also responsible for setting the min_page, low_page, and high_page thresholds that govern the behavior of the Linux kernel’s page reclaim algorithms.
This reserved memory is crucial for handling critical system operations.
The virtual memory parameters are listed in the /proc/sys/vm directory.
Tools available at your disposal to diagnose system memory issues are : vmstat, valgrind, cachegrind, memcheck.
Refer Ch08 of RH442 course for tuning memory :
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.