Determining factors  The tuning process

Chapter 1: Introduction

Measurement and diagnosis tools

There are several tools available to measure the performance of your code and server configuration.

Instrumented code

In your code, add optional logic that you can enable to record timing information. Measure the execution time for major tasks such as:

In Java code, you can record timings by calling System.currentTimeMillis(). Logging can degrade performance, so be sure to encapsulate the timing code in logic that allows you or your administrators to selectively enable tracing for areas where you are tuning. To allow configuration of the log options, you can use Log4j or the Java Logging package. Both of these packages allow simple configuration of logging options and can be integrated with EAServer. For more information, see “Configuring log profiles” in the EAServer System Administration Guide.

Profiling software

Profiling software measures the frequency of execution of each method or function in your code. Some profiles can also break down the execution time and memory use by each object. Popular options include:

Load-testing tools

Load-testing software simulates multiple clients, allowing you to replicate real-world timings and server loads in your test environment. These tools typically allow you to run multiple scripted HTTP client sessions that simulate typical end user request patterns. Popular options include:

NoteLoad-testing strategies When setting performance goals, you must also specify a usage pattern that reflects real-world use of the application. For example, interactive users do not usually submit one request per second. A catalog shopper may download a part description, read it, download another, add it to the shopping cart, and so forth before checking out. To get accurate performance results, you must set up your test tools to mimic typical request patterns, including the “think time” between subsequent requests.

Memory and CPU usage monitors

You can monitor memory and process CPU time using system tools such as top on UNIX systems or the Task Manager or Performance Monitor on Windows. Many profiling tools such as OptimizeIt track memory and can help you find the source of memory leaks. In EAServer, you can configure memory thresholds for each server as described in “Configuring memory thresholds”.

In Java code, you can log the amount of free memory reported by the methods freeMemory() and totalMemory() in the java.lang.RunTime class to track total memory use in the Java dynamic allocation heap.

You can also turn on tracing for the Java garbage collector as described in “Trace-logging options”.

EAServer monitoring and tracing tools

EAServer includes these monitoring and tracing tools.

Runtime monitoring with EAServer Manager

EAServer Manager includes a runtime monitor that shows component, Web application, and connection cache statistics. For more information, see Chapter 11, “Runtime Monitoring,” in the EAServer System Administration Guide.

In a clustered deployment, you can monitor the per-server load as described in “Viewing the current per-server load” in Chapter 7, “Load Balancing, Failover, and Component Availability,” in the EAServer System Administration Guide.

Runtime monitoring APIs

EAServer includes several APIs that you can use to create your own monitoring applications, including:

For additional documentation of these APIs, see the generated HTML reference documentation in the html/ir subdirectory of your EAServer installation.

Trace-logging options

You can configure some EAServer subsystems to log trace data to the server log file, including:

Copyright © 2005. Sybase Inc. All rights reserved. The tuning process