APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Sarcheck Performance Analysis for Linux


Sarcheck (http://www.sarcheck.com/) has been around for quite a while. On traditional Unix systems, Sarcheck analyzes data produced by "sar", but Linux systems don't usually have sar. It is available as part of the sysstat package on RedHat, and I do recommend that you install sysstat if you can, but Sarcheck on Linux installs its own data collection tools.

You do need to pay careful attention to the manual when installing Sarcheck. There are several very necessary directories that are not created automatically and need to be present for Sarcheck to work. I am willing to bet that this is a source of quite a few support calls, and don't understand why they just don't include those directories in their tar ball.

You also want to carefully read the section on setting up data collection with cron. For my test system, I added these entries to root's crontab:


*/10     6-16    *       *       *       /opt/sarcheck/bin/prst1
0       17      *       *       *       /opt/sarcheck/bin/prst1
*/20    6-16    *       *       *       /opt/sarcheck/bin/ps1
55      23      *       *       *       /opt/sarcheck/bin/ps2
57      23      *       *       *       /opt/sarcheck/bin/prst2
 

These *collect* data. Sarcheck does not and will not change your system in any way: it analyzes and suggests changes, but leaves the actual implementation to you. That is the right way to do it. Products that charge ahead and modify kernel variables on their own can seriously break your system.

The Sarcheck manual explains that you want data collected during active usage. There's no point in collecting statistics when the machine is generally idle (as it may be outside of office hours for many systems) and using inactive data can interfere with good analysis and recommendations.

After collecting data for a few days, you can produce reports. These early reports will probably have recommendations similar to what I saw:

RECOMMENDATIONS SECTION

All recommendations contained in this report are based solely on the conditions which were present when the performance data was collected. It is possible that conditions which were not present at that time may cause some of these recommendations to result in worse performance. To minimize this risk, analyze data from several different days and implement only regularly occurring recommendations.

Consider adjusting process priorities with the nice(C) command, optimizing applications, or improved job scheduling. Occasionally heavy CPU utilization was seen and these recommendations may help to avoid the need for a hardware upgrade.

Change the bdflush parameter 'nfract' from 50 to 55. This is the percentage of dirty buffers allowed in the buffer cache before the kernel flushes some of them.

Change the bdflush parameter 'nfract_sync' from 80 to 85. This is the percentage of dirty buffers in the buffer cache before the kernel agressively flushes them synchronously.

Change the bdflush parameter 'nfract_stop_bdflush' from 50 to 45. This is the percentage of dirty buffers in the buffer cache used to decide when to stop bdflush.

To change the value of the bdflush parameters immediately as described in the above recommendations, use the following command:

    echo "55 500 8 0 500 3000 85 45 0" > /proc/sys/vm/bdflush

With some kernels, this will not work because the file /proc/sys/vm/bdflush is read-only and you may not be able to change its permissions. If you are able to make this change and it improves performance, you can make the change permanent by adding the command to the /etc/rc.d/rc.local file.

That was from an HTML report, but Sarcheck can produce simple text output as well, and can even email reports only when recommendations have changed. Remember, it's up to you to read the recommendations and manually implement them.

If you don't already have gnuplot installed, you may want to add it. With this, Sarcheck can optionally produce graphs:

Graph of CPU usage

As you make these changes, the next day's analysis may make additional recommendations. After several weeks of running, this test system ended up with a recommendation of:

    echo "60 500 256 0 500 3000 87 50 0> /proc/sys/vm/bdflush

and no other recommendations other than:

Consider adjusting process priorities with the nice(C) command, optimizing applications, or improved job scheduling. Occasionally heavy CPU utilization was seen and these recommendations may help to avoid the need for a hardware upgrade.

You'd add the update to bdflush to a bootup script like /etc/rc.local so that it will be effective on each boot but can be quickly changed in case of problems (problems are extremely unlikely).

Of course new recommendations would pop up again as new loads and applications were added to the server. Performance tuning isn't easy, especially when loads are changing. While Sarcheck was running, this server was mostly doing very light duty as a mail server with an occasional compilationn job here and there, but next month it might take on entirely different roles.

There is always a very detailed analysis section and capacity planning guide which more fully explain the parameters looked at and what they mean. A sample report is at the Sarcheck website. The full Linux manual is also on-line.

Sarcheck is inexpensive (around $450.00 singly, half that or less for 20 copies)), though they don't seem to want to give pricing at the web site and instead request that you contact them for a specific quote. That's likely because they support so many different Unixes also, and offer quantity discounts.

For important systems, this is a small investment that will probably run unobtrusively for years after your initial tuning and only pop up from time to time as conditions change, which is exactly what most system administrators are looking for.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> Sarcheck Performance Tuning Analysis for Linux




Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Tony Lawrence



Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





We are stuck with technology when what we really want is just stuff that works. (Douglas Adams)

You learn about life by the accidents you have, over and over again, and your father is always in your head when that stuff happens. (Kurt Vonnegut)












This post tagged: