In my
last post about the importance of HTTP compression for ITIM Console performance I put forth this statement:
Use of the HTTP server and HTTP compression is recommended in front of single-server ITIM nodes because of the improved UI responsiveness for the Console. The HTTP server can reside on the same machine as the ITIM server itself in such a configuration.
Today I'll give you another good reason to use the HTTP server in front of even single-server systems:
Edge Side Include (ESI) caching.
Without a front-end cache, when a client makes a request for a static image it does so directly to WebSphere Application Server. WAS in return serves up the image using the File Serving Enabler. In doing this WAS has to expend some CPU and memory resources inside the JVM to service this request. Overall this is less than ideal — why not serve the static content directly from the web server? You can disable the File Serving Enabler and let the HTTP server service static content but that requires manually keeping the content deployed in the EAR in sync with the content on the web server. Instead it would be nice if there were just a caching later in the web server itself.
Enter ESI caching. The IBM HTTP Plug-in that does the load balancing of client GUI requests in a clustered environment also has built-in support for ESI which does page- and fragment-level caching. While ESI does a lot more than just caching static content, for the purpose of this discussion lets focus specifically on it's ability to cache images, Javascript, and CSS files.
If you're using the IBM HTTP server with the Plug-in in front of your WAS clusters the odds are good you're using ESI already. Out of the box, the HTTP Plug-in has ESI enabled with a cache size of 1024kb (1mb) and a cache timeout value of 300 seconds (5 minutes). Enabling ESI and the size of the cache are set from within the plugin_cfg.xml file with the following lines (if the lines aren't present -- what is listed below is assumed as the default):
<Property Name="ESIEnable" Value="true"/>
<Property Name="ESIMaxCacheSize" Value="1024"/>
With ESI when a client makes a request for a static image, the Plug-in checks to see if it's already in the ESI cache and if so serves it up directly. If not it goes off and queries the WAS server for the image and the File Serving Enabler returns it to the Plug-in which caches it and returns it back to the client. This offloads the request for static content onto the IBM HTTP server and lets WAS focus on the dynamic content.
The size of the static content (images, Javascript, and CSS) served up from the ITIM Console GUI is around 825k. For the Self-Service GUI it's around 550k. This means that if the bulk of your traffic is either one or the other -- the default 1MB cache is more than adequate to completely cache the static content. If you have lots of both kinds of traffic (such as end-user servicing their own requests for password changes in addition to helpdesk personnel doing account maintenance) you might want to bump up the cache size to 1536k or 2048k. Caution must be used when increasing this value because there is one ESI cache per HTTP process so the total memory used by the ESI cache is ESI_cache_size*HTTP_processes.
Another knob available for tuning is the cache timeout. By default any entry is only valid in the ESI cache for 5 minutes. After this time has passed the data is expired and a subsequent request will be passed back to WAS. In a busy environment with new users accessing ITIM every few minutes, this will result in a hit to WAS every 5 minutes. Because ITIM static content doesn't change once every 5 minutes, you can change the timeout value to something much higher — like once a day. This is done by adding a parameter to the JVM command line for the application server running ITIM:
-Dcom.ibm.servlet.file.esi.timeOut=3600
If you go this route you'll want to bounce your IBM HTTP server after installing an ITIM fix pack to ensure that the ESI cache is cleared for the rare case where a fix pack changes static content.
More in-depth reading about caching in front of WAS applications can be found in the developerWorks article
Static and dynamic caching in WebSphere Application Server V5. While the article is dated for WAS V5, the concepts are applicable to WAS V6 and V7 as well.