| It is important at the outset to understand what result you are trying to achieve and to have some repeatable way to measure performance, such as a test sequence that reports average response time for completing a typical user task. When performance tuning, you will probably want to have a short duration test that allows you to quickly test the effect of a particular tweak, as well as a longer duration test that more closely represents the usage of the system in production. Below is a list of recommended tasks for tuning your application. They are described in detail in the linked pages. -
System-based tasks: -
Create a model (picture) of the overall architecture by describing all computers in the system and the data and control flows between them. -
If any one computer seems to be the constraint (bottleneck) on the overall application performance, check the operating system setup on that computer to see how the operating system is configured. -
Note how the JVM is being used. (See also step 2.2 below for the application-related tuning of the JVM.) -
Understand any middleware you are using and the available options for tuning it. -
Application based tasks: A vital rule of performance tuning is to make only one change at a time. Otherwise you can never be quite sure which change in options or configuration caused a subsequently observed change in performance. After each change evaluate the result using your benchmark test to see if performance improved. You may also want to monitor the application with one or more of the performance analysis tools to see the effects of the change in detail. -
Run the application and create a baseline level of performance. A perhaps obvious prerequisite to this step is a working application. If you encounter any defects while tuning, you will need to get them fixed before resuming the performance work. Depending on the magnitude of the changes that make up the fix, you may need to back up a few steps in your tuning effort. -
Use the tuning steps information, making one change at a time. After each change, re-evaluate the performance of your test case to see if you are making progress. -
Most applications have command line options and you should investigate them to understand their effect on performance. Run the application with each option. You may also need to run combinations of options. Make only one change at a time before re-evaluating the result, and document each change. Choose the optimal set of options and continue future tuning with those. While tuning you may turn on logging or debugging flags to assist in analyzing application execution. When running the application for performance evaluation, ensure that all such options are set to the values typically used in a production environment. -
Check for other problems. These include pathological symptoms you may see for CPU, disk, memory, network, JVM, and application issues. The linked page contains suggestions for correcting these problems. Again, after each change re-evaluate the performance of your test case to see if you are making progress. Ideally, after completing these steps your application performance will meet your requirements. If the performance is not yet acceptable, then you need to run through the steps again, paying close attention to areas where the application falls behind. For instance, perhaps you observe that cpu usage on the database server is 100%. You might add capacity there or rework your database indexing scheme for more efficient searches. Look for the squeakiest wheel and grease it. (And then the next squeakiest, and so on...) |