Linux Peformance Tuning

NOTE: This is currently just a few quick notes while I try to solve a performance problem on a server. This may or may not ever get finished.

Having searched the internet for some simple tips and tricks on performance tuning, and coming up with 0 (so far), I thought I’d start to write my own archive of the gems of knowledge I was picking up. These range from the tools that you need to work out where performance is lacking, as well as other ideas on what can be “tuned” for the good (without impacting on other parts of the system).

Measures

The most well-known measure of how well your system is performing is called “load”. This can be viewed using “uptime” or by using “top”. A load of less than one is what is normally quoted as “good”. What precisely this measure is of, I don’t yet know (I will, obviously, update this as time goes by)

Tools

In your arsenal of fighting high load, take a look at these tools:

top

This handy tool lists a lot of perfomance information in the top half of the screen, ranging from iowait to system load. It also shows the processess that are mostly using these resources. This is a great help in tracking down which process is causing your high load

sar

This is part of the sysstat package. Sar (providing the cron job for recording the information is set up, see the sar website for more details) give you percentage usage of various details over time. This might help you track down random high loads to at least a time-frame.

iostat

This allows you to see which drivers are getting the most read and write accessess. This might point you to a slow drive, or slow raid array that might need some tuning.

mpstat

give a quick output summary of stats of the machine. Helpful if you don’t want to keep top running

hdparam

the most useful form (that I’ve found) is hdparam -Tt /dev/hda this will give you a read and write performance measure of your hard-drive.

vmstat

virtual memory statistics, mostly looking at swap and memory usage.

Useful Converstion Website

IF your going to be doing anything with tuning, your going to need to be able to convert Megabytes to Bytes. If, like me, you can’t do that in your head, try this quick site: http://webdeveloper.earthweb.com/repository/javascripts/2001/04/41291/byteconverter.htm

Useful Network Tuning Website

http://ipsysctl-tutorial.frozentux.net/chunkyhtml/index.html

Linux Performance Tuning Form Post

If you have been searching for linux performance tuning information, this is probably the one website you will have found. It’s posted here, though it doesn’t really have much information on it. http://www.linuxforums.org/desktop/linux_performance_tuning.html

Postgres Tuning (including explenation of the kernel.sh* values)

http://www.redhat.com/docs/manuals/database/RHDB-2.1-Manual/admin_user/kernel-resources.html

A nice introduction to Performance Tuning, and problem solving
http://www.ibmsystemsmag.com/opensystems/februarymarch07/coverstory/6141p1.aspx

http://www.ibmsystemsmag.com/opensystems/aprilmay07/administrator/13402p1.aspx

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Reply