During your testing, the CPU utilization of one of your servers may reach high levels (95% or above). High CPU utilization indicates CPU saturation. You have exhausted the processing capacity of this computer. What are your options after the application server CPU reaches full utilization? Is this the maximum load for your server, or can you add more load to this server? To answer these questions, we explore the components of the burdened CPU. We also look at the throughput plateau and corresponding response times of the busy system. High User CPUIn Figure 13.4, the total CPU contains a high amount of user CPU (68% in this case). High user CPU means the server is very busy handling requests from the web application. Also, notice that the system component of CPU in our example is at 30%. For Java applications, the system component of CPU normally tends to be somewhat high. Figure 13.4. Example of high CPU utilization. From "Experiences with Successful Website Performance Testing," presented by Stacy Joines at the Solutions 2001 conference, San Francisco, CA. IBM Corp. 2001. Reprinted by permission of IBM Corp.
If the application uses most of the CPU, consider these choices before continuing with your testing. First, consider your response time. For a reasonably tuned application, the CPU saturation indicates a throughput plateau for your testing on this server. In other words, you cannot continue to increase throughput on this server regardless of how much additional load you apply. However, the CPU saturation does not necessarily mean the server cannot support additional load. Users only know response time. A saturated server may continue to support increasing load as long as the response time remains acceptable. Of course, the server queues the arriving load once the server becomes saturated . However, if the wait in the queue remains short, the overall response time remains acceptable as well. (See Chapter 1 for more discussion on throughput, load, and response time dynamics.) Under normal conditions, we don't recommend increasing the load on a saturated CPU. The additional load waits for CPU resources to free. If load increases on this server, the wait time grows linearly for all users. As a general rule, try to keep queues in front of your HTTP server to allow optimal load balancing. Minimizing queues within your application and database server provides the optimal performance. However, your test results may show that the high user CPU does not prevent you from achieving your performance objectives. Let's assume you anticipated getting better throughput or response time through the server than you're currently achieving. Let's look at some of the common causes of high CPU utilization during a test run. How to DiagnoseDuring your tests, the CPU utilization reaches 100%. If the user component of CPU exceeds 75%, with little or no utilization in the wait component, the system runs with high user CPU utilization. How to Resolve
High System CPUAs mentioned in the previous section, the system component of CPU tends to run somewhat high with Java applications. However, other factors influence system CPU. Too much time devoted to this component impacts the CPU capacity available to run the web application. Figure 13.5 shows the application server at 80% CPU utilization. Of this, the system component absorbs 45% of the utilization. Figure 13.5. Example of high system CPU utilization. From "Experiences with Successful Website Performance Testing," presented by Stacy Joines at the Solutions 2001 conference, San Francisco, CA. IBM Corp. 2001. Reprinted by permission of IBM Corp.
How to DiagnoseObserve the CPUs on your application server. If your CPU is near 100%, look at the breakdown between user, system, and wait time. Check to see if the system component is using more than 30% of the total CPU, and there is little to no wait time. How to Resolve
High Wait CPUExcessive wait CPU indicates a serious performance problem, and it usually occurs when the CPU interacts with a slower resource. Usually the high wait cycle problem emerges when the server spends a proportionally large amount time interacting with the hard disk. However, occasionally high I/O wait times result from network problems or other issues. Any machine is prone to high wait CPU, although it most commonly occurs on database and web application servers. Figure 13.6 shows the database server at 75% CPU utilization, with 50% of this devoted to wait time. Figure 13.6. Example of high CPU wait on a database server
Note that all database servers usually show some amount of CPU wait. However, if this component becomes too high, it shows that the CPU accomplishes very little aside from waiting on the hard disk. In these cases, tuning is usually appropriate. How to Diagnose
How to Resolve
|