Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

Stress-testing the Linux kernel

By Robert Williamson
2005-04-19


Evaluating System Resource Utilization

The combination of selected tests must adequately stress the system's resources. Four primary areas of the Linux kernel can affect system response and execution time:

• CPU: Time spent processing data on the CPU(s) of the machine
• Memory: Time spent reading and writing data to and from real memory
• I/O: Time spent reading and writing data to and from disk storage
• Networking: Time spent reading and writing data to and from the network

Test designers should use the following two well-known and widely used open source Linux resource monitoring tools to evaluate the resource utilization levels. (For links to download both of these tools, please see Resources later in this article.)

• top: An open source tool maintained by Albert D. Cahalan, which is is included in most Linux distributions and works on the current 2.4 and 2.6 kernels.
• sar. Another open source tool; this one is maintained by Sebastien Godard. This tool is also included in most Linux distributions and works on the current 2.4 and 2.6 kernels.

This system resource utilization evaluation phase of the method usually requires multiple attempts at getting the right combination of tests that will achieve the desired level of utilization. Over-utilization is always a concern when deciding on the combination of tests. For example, choosing a combination that is too I/O bound can create poor results for the CPU, and vice versa. This part of the method consists primarily of a large amount of trial and error, until the desired levels for all resources are attained.

The top tool is useful for quickly determining which resources (CPU, memory, or I/O) each test affects and how much of them it utilizes in a real-time fashion. The sar tool is useful for gathering network utilization statistics and recording snapshots of all utilization data to a file over a period of time.

Once a combination is chosen, a test must be run for an extended amount of time to accurately evaluate the resource utilization. The amount of time to run the test depends on the length of each test. Assuming that multiple tests are being executed concurrently, the amount of time must be long enough to allow the longest of all these tests to complete. The sar tool should also be running during this evaluation. At the conclusion of the evaluation run, you should gather and evaluate the utilization levels for all four resources.

The following example shows sar output for CPU, memory, and network utilization:

Listing 1. Example output from sar

10:48:27          CPU     %user     %nice   %system   %iowait     %idle

10:48:28 all 0.00 0.00 0.00 0.00 100.00
10:48:29 all 3.00 0.00 1.00 0.00 96.00
10:48:30 all 100.00 0.00 0.00 0.00 0.00
10:48:31 all 100.00 0.00 0.00 0.00 0.00

02:27:31 kbmemfree kbmemused %memused kbswpfree kbswpused %swpused
02:29:31 200948 53228 20.94 530104 0 0.00
02:31:31 199136 55040 21.65 530104 0 0.00
02:33:31 198824 55352 21.78 530104 0 0.00
02:35:31 199200 54976 21.63 530104 0 0.00

02:27:31 IFACE rxpck/s txpck/s rxbyt/s txbyt/s
02:29:31 eth0 738.79 741.66 76025.55 136941.85
02:31:31 eth0 743.30 744.97 76038.82 136907.77
02:33:31 eth0 744.80 745.02 76135.53 136901.38
02:35:31 eth0 742.35 744.34 75947.45 136864.77


Tutorial Pages:
» A Design Process for Standardized Testing of Linux
» Selecting Tests
» Evaluating System Resource Utilization
» Analyzing Kernel Code Coverage
» Evaluating the Final Stress Test
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» How to Install PHP 5 on Linux
» How to Install Apache 2 on Linux
» How to Install MySQL 5.0 on Linux
» SMB Caching
» Mound --Bind
» Tar Wild Card Interpretation

Ask A Question
characters left.