Many people think that the problem of application performance, security and networking lies in supported services. Like Nginx is proxying too slow or remote DBMS cannot see my network. Frequently the problem in OS. Default values of system settings can restrict our environment to make the service jobs quick and simple. The best way to change your system configuration – change the system variables.
Linux systems have a lot of opportunities for customization providing thousands of variables. And it’s easy to confuse and remember for what does each variable stand for. Here is the simple cheatsheet of the most useful and popular settings for operations.
The location of system variables – /proc/sys catalog of pseudo-filesystem /proc.
1 To find the value of aimed variable:
2 To change the variable of value temporarily (up to the system shutdown):
echo 0 > /proc/sys/vm/swappiness
3 To change the value of variable permanently:
sysctl -w vm.swappiness=0
|net.netfilter.nf_conntrack_tcp_loose||Configuration of connection tracking system|
|vm.dirty_ratio||Percentage limit of system memory that can be filled with dirty pages before everything must get committed to disk|
|vm.dirty_background_ratio||Percentage limit of system memory that can be filled with “dirty” pages before the background processes like pdflush/flush/kdmflush kick in to write it to disk|
|vm.dirty_expire_centisecs||Seconds limit when page can be in cache before it needs to be written to disk|
|vm.dirty_writeback_centisecs||How often the pdflush/flush/kdmflush processes wake up and check to see if work needs to be done|
|vm.swapiness||Percentage limit of memory: below this limit the system starts to allocate memory pages to the swap space|
|vm.overcommit_memory||Defines the conditions that determine whether a large memory request is accepted (1) or denied (2). 0 is default|
Specifies the percentage of physical RAM considered when overcommit_memory is set to 2.
Set 1 when you want to flush cache pages to disk.