Cheatsheet: Linux system variables

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.

Introduction


The location of system variables – /proc/sys catalog of pseudo-filesystem /proc.

1 To find the value of aimed variable:

cat /proc/sys/vm/swappiness

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

Variables list


 

Variable

Value

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
vm.overcommit_ratio

Specifies the percentage of physical RAM considered when overcommit_memory is set to 2.

vm.drop_caches

Set 1 when you want to flush cache pages to disk.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s