We’ll cover some more advanced forms of improve the performance of linux.
Disabling than anything, or fiddling with the interface.
I separated the 3 things that I normally use to improve my servers, and virtual machines.
For those who do not know what is ramlog … can kill yourself now. Just kidding, read the rest. Then mate.
As the name says Rams – log means store the log in the ram, instead of pouring it on disk directly. How common is used by syslog.
Thus is avoided that there is always written to disk, which is a bottleneck of performance on any server. Exist only when the ramlog is restarted or stopped.
The use of ramlog, makes a big difference in performance
Ramlog – http://www.tremende.com/ramlog site you can find the installation tutorial for various distributions.
For ubuntu would be:
wget http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb sudo dpkg-i ramlog_2.0.0_all.deb sudo reboot
Loading /tmp in memory
Using tmpfs if we can put tmp into ram.
But … what is tmpfs?
Simple, tmpfs, is just a file system, instead of storing it in HD stores everything in memory. However after booting, everything is lost. So it is suitable to place temporary files only.
To enable tmpfs is simple, put in fstab (/etc/fstab):
# Put /tmp to RAM by http://viniciusmuniz.com/ tmpfs /tmp tmpfs defaults, noexec, nosuid 0 0
If you want you can set a size for tmp, getting:
# Put /tmp to RAM by http://viniciusmuniz.com/ tmpfs /tmp tmpfs defaults, size = 512m, noexec, nosuid 0 0
Change settings sysctl
Do this performance improvement knowledge that can compromise your OS.
But … What is sysctl?
sysctl is used to modify the parameters of execution kernel in time execution. The parameters available for modification are available in /proc/sys/.
To change this, open the file /etc/sysctl.conf, and if there is the following lines, add them, if not, change them.
kernel.shmmax = 268435456 # to 32 bits kernel.shmmax = 1073741824 # to 64 bits kernel.msgmni = 1024 fs.file-max = 8192 kernel.sem = "250 32000 32 1024"
Change swap usage
By default on some operating systems, the swap comes with a default of 60 percent usage.
Decrease the percentage of programs in swap , that if any application using swap, will make a big difference in performance.
Open the file /etc/ sysctl.conf, and search for “vm.swappiness” (if not act add at end of file), and change it to:
vm.swappiness = 10
Hope you enjoyed the post, and if you want to get more news about linux, php, and other related topics. Give a like page on facebook here a> and sign up for our list here, and comment if you liked and did not like it too!