Using the performance tuning wizard  Tuning servlet and JSP settings and code

Chapter 5: Web Application Tuning

Tuning server and Web application settings

These Web application and server settings can affect the performance of your Web-based application.

Tracing properties

Tracing properties enable additional logging, which can be useful when debugging problems. However, tracing requires additional file I/O and computation. For best performance, disable these trace properties unless you are troubleshooting a related issue:

An easy way to verify that all tracing properties are disabled is to run the server and Web application performance tuning wizards.

Session timeouts

Servlets and JSPs can use sessions to store temporary data required to maintain a Web user’s session. EAServer also uses sessions internally in the Web application security implementation. The Web application Session Timeout property specifies how long a session can remain inactive, with no requests issued from the client. Since sessions consume memory resources, you should tune this setting to balance memory requirements against the possibility of users losing their session.

To configure this property, set the Session Timeout property in the EAServer Manager Web Application Properties dialog box, or by setting the property.

Class loader settings

EAServer uses custom class loaders to allow you to refresh implementation classes without restarting the server. Loading multiple copies of the same class uses memory unnecessarily. To avoid this issue, configure a common class loader for use by the Web application and the components that it calls. To do this, configure an application-level or server-level class list, as described in Chapter 30, “Configuring Custom Java Class Lists,” in the EAServer Programmer’s Guide.

Servlet buffer pools

Internally, EAServer uses 4K and 8K temporary buffers when assembling servlet responses. These buffers are pooled and reused to avoid the overhead of repeated buffer allocation and garbage collection. To tune the number of buffers pooled, you can set the server properties below, using the Advanced tab in the Servlet properties window:

The default for both is 128. You can override the default by setting the value to a positive integer. A value of 0 means buffers are never pooled

The required buffers are allocated on an as-needed basis, rather than being preallocated as server start-up. Once allocated, buffers are pooled and reused until the specified size is reached. If a peak in client activity requires more buffers than the pool size, additional buffers are allocated, then released for garbage collection after use.

The default configuration suffices for most applications. If the buffer pool size is too small, performance.may decline due to allocation of new buffers. Allocation is costly because the Java VM initializes the allocated byte arrays to 0, which is not required by EAServer. Garbage collection is also costly. On the other hand, if the buffer size is too large, buffers allocated during periods of peak activity may be rarely used while consuming memory that would otherwise be available for other tasks.

For request processing, EAServer uses 8K buffers by default, and uses 4K buffers only when a servlet calls ServletResponse.setBufferSize() to request a buffer size other than 8K. If your application never or seldom changes the buffer size, you can set to 0 so that 4K buffers are not pooled.

To determine whether the settings are correct, examine the servlet request patterns to see if the number of concurrent requests often exceeds the buffer pool sizes. If so, consider increasing the value.

Clustered deployments

If you deploy your Web application in a cluster, tune the settings described in “Web application settings”.

HTTP and HTTPS listener configuration

The HTTP listener parameters can affect the performance of your application. “Listener tuning” describes how to tune these settings.

SSL and performance

You can configure Web pages to require SSL as described in Chapter 3, “Using Web Application Security,” in the EAServer Security Administration and Programming Guide. SSL encryption can protect critical client data, such as passwords and credit card numbers. However, SSL adds overhead to the network transfer phase. Use SSL only when the extra security is required.

Copyright © 2005. Sybase Inc. All rights reserved. Tuning servlet and JSP settings and code