Chapter 5: Web Application Tuning
These Web application and server settings can affect the performance of your Web-based application.
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:
Servlet engine tracing The server property com.sybase.jaguar.server.servlet.trace enables tracing in the servlet engine. You can set this property in the Log/Trace tab of the Server Properties dialog box, or on the Advanced tab.
Web application security tracing The Web application property com.sybase.jaguar.webapplication.sectrace enables tracing in the security subsystem of the EAServer Web application container. Set this property on the Advanced tab in the Web application properties dialog box.
Response cache debugging The server property com.sybase.jaguar.server.http.cache.debug enables tracing in the static page caching engine. You can set this property on the Static Page Caching tab in the Server Properties dialog box, using the Enable Server Log Debug Messages check box. You can also use the Advanced tab.
An easy way to verify that all tracing properties are disabled is to run the server and Web application performance tuning wizards.
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 com.sybase.jaguar.webapplication.session-config property.
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.
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:
com.sybase.jaguar.server.servlet.max8kbuffers specifies the number of internal 4K servlet response buffers.
com.sybase.jaguar.server.servlet.max4kbuffers specifies the number of internal 4K servlet response buffers.
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 com.sybase.jaguar.server.servlet.max4kbuffers 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.
If you deploy your Web application in a cluster, tune the settings described in “Web application settings”.
The HTTP listener parameters can affect the performance of your application. “Listener tuning” describes how to tune these settings.
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.|