Welcome to the world of Infosys Engineering! It is a half a billion plus organization that takes pride in shaping our engineering aspirations and dreams and bringing them to fruition. We provide engineering services and solutions across the lifecycle of our clients’ offerings, ranging from product ideation to realization and sustenance, that caters to a cross-section of industries - aerospace, automotive, medical devices, retail, telecommunications, hi tech, financial services, energy and utilities just to name a few major ones.

« How Real is Cloud Adoption | Main | The Current State of Affairs of Software Defined Networking »

JEE: Server Performance and Configuration -Part 2

  1. Guest Posted by

Anupindi Ravi Shankar, Senior Technology Architect, Manufacturing,Infosys Limited.

In my previous blog post, we talked about WebSEAL configuration settings for performance improvement. In this blog we will discuss on the performance related configuration settings for IBM HTTP server.


Going by the Internet definition,  IBM HTTP server (IHS)  is a full-featured, cross platform enabled  Web server, based on Apache HTTP server (httpd.apache.org)  that runs on AIXHP- UX ,Linux, Solaris, Windows NT and z/OS.

An often and the most common scenario in JEE web applications deployment is that the web server is under utilized by making it as a mere load balancer before the application server cluster. Almost all web servers and especially IBM HTTP server provides many OOTB configurations to improve the web application response time and thereby improving the overall application performance.

In the below depicted illustrative deployment view of JEE web application, IBM HTTP server acts as a load balancer for the application server cluster. If you notice, IBM HTTP server layer itself is clustered enabled to provide high availability and to avoid the single point of failure. We will not be talking about clustering and other deployment related aspects in this blog but would focus mainly on the other capabilities provided by the IBM HTTP server.


secondBlogPost.jpg                                            Fig1: illustrative Deployment view of the Web Application

Any typical web UI page is composed of the following UI elements in JEE world.

1.       JSP template pages.

2.       External JavaScript files (JS).

3.       Cascading style sheets (CSS).

4.       Images (jpg/png/tif etc.)

Browser makes a separate GET request (as seen in the below snapshot) to download each of the static files from the server. Each such request puts extra burden on application server resources like thread pool, memory, I/O and CPU.In most of the cases the amount of time it takes to process each such request is comparatively high which leads to high response time of the web page.


 The better deployment option would be to host the static files on a separate JVM and free application server from serving the static content. This separate JVM can be none other than the web server itself.

The question still prevails is how the new JVM or web server help in reducing the number of GET requests made by the client browser. After exploring many of the configuration capabilities provided the IBM HTTP server, I found the following two configuration options to be most useful and satisfying the desired need.

1.       Gzip of static content.

2.       Static content caching.

Before I talk about the two configuration settings, it is very important to know that there are 2 different ways to make configuration settings to the IBM HTTP server. The first option is to make changes directly to the main configuration file (i.e. httpd.conf) and the second is to use .htaccess files. The second method allows making configuration changes on a per-directory basis.

secondblogdisclaimer.jpg Since my experience is with httpd.conf file, I will show how to make configuration settings in this file.

Gzip of static content

Gzip mainly refers to the file compression and decompression technology which is based on DEFLATE algorithm (combination of Lempel-Ziv and Huffman coding).It compresses and thereby reduces the size of the static files like JavaScript and CSS.

To enable HTTP server for Gzip following configuration need to be done in the httpd.conf file.

1.       Uncomment the following line

                LoadModule deflate_module modules/mod_deflate.so

2.       Add the following to compress html, plain text, javascript, CSS and JSON MIME types

<IfModule mod_deflate.c>

     SetOutputFilter DEFLATE

     AddOutputFilterByType DEFLATE text/html text/plain text/css application/x-

    javascript  application/json


Mod_Deflate module provides many other capabilities as shown below:-




BrowserMatch  Directive


By-pass Image compression


Input decompression


Dealing with proxy servers


Setting the compression level

For details pertaining to each of the above settings please refer to the following Apache link

Static content caching

IBM HTTP server provides the following capabilities to cache the static content.

1.       Module Expires Header to cache the static content at the browser level.

2.    Module cache and mem_cache to cache static content by the web server.

Module Expires Header to cache the static content at the browser level

To enable Expires Header directive following configuration need to be done in the httpd.conf file.

1.       Uncomment the following line

                 LoadModule expires_module modules/mod_expires.so

        2.   Add the following expires_module

              <IfModule expires_module>

                ExpiresActive On
               ExpiresDefault "access plus 1 month"
               ExpiresByType text/html "access plus 1 month 15 days"
               ExpiresByType image/jpeg "access plus 1 month 15 days"
               ExpiresByType image/jpg "access plus 1 month 15 days"
               ExpiresByType image/gif "access plus 1 month 15 days"
               ExpiresByType image/png "access plus 1 month 15 days"
               ExpiresByType application/x-javascript "access plus 1 day"
               ExpiresByType text/css "access plus 1 day"


In the above configuration I have specified ExpiresByType for different MIME Types.For images and html files the ExpiresByType is set to 45 days from the current date and for JavaScript and CSS files it is set to 1 day. This setting enables the web server to intercept the response header of the matching MIME types and add the Expires attribute. The updated response header will have attribute like this...

Expires: Wed, 17 Sep 2012 21:32:10 GMT

..which indicates to the web browser to cache the corresponding MIME type in its internal cache for the stipulated period of time as mentioned in the Expires attribute. In the above case the browser will cache the corresponding file till 17th September 2012 and will not send any GET request for it and serve the content from Cache. If all the static contents are cached like this then the number of GET requests send by browser will be reduced drastically, thereby improving the response time of the application.

In the above configuration, the expires header are generalized for all MIME types. There can be a scenario where we want to specify different expiry time for static contents of a particular directory without mixing them with the main configuration settings.IBM HTTP server also provides the capability to specify different expiry time for static contents. It can be achieved by adding the corresponding directory to the <location element as shown below:-

<Location /img>
ExpiresActive on  
ExpiresDefault "access plus 2 hours"

The above configuration specifies that all the images in the /img folder should have the Expires header value set as 2 hours from the access time. It boils down to the fact that the browser will cache these images of this directory for 2 hours and after 2 hours they will again be downloaded from the server. Within 2 hours all the requests for these images files will be served from the browser cache.

The drawback of the above approach is that, it increases the possibility of browser serving the stale content if the corresponding static files are changed on the server. To prevent browser from serving the stale content we can do one of the following:-

1. Enable ETAG in the web server configuration settings.
2. Append timestamp or some unique identifier to the static content URL

Module cache and mem_cache to cache static content by the web server

IBM HTTP server provides the in-memory caching of the static content to further improve the response time to serve the static content. In the absence of in-memory caching I/O operations are performed to serve the static content requests.

To enable mod_cache and mod_mem_cache directives following configuration need to be done in the httpd.conf file

1. Uncomment the following lines
         LoadModule cache_module modules/mod_cache.so     
         LoadModule mem_cache_module modules/mod_mem_cache.so

2. Add the following mod_cache and mod_mem_cache

<IfModule mod_cache.c>
CacheMaxExpire            172800
CacheIgnoreCacheControl   on
CacheEnable   mem /ProductImages

<IfModule mod_mem_cache.c>
MCacheMaxObjectCount        10000
MCacheMaxObjectSize            1000000 
MCacheMinObjectSize             0
MCacheSize                                  512000 
MCacheRemovalAlgorithm   GDSF (Greedy-Dual Size Frequency)

For in-depth details of each of the above configuration settings please visit the following Apache link

I hope these HTTP server configurations will come in handy when you are working on performance engineering for your Web Application. Do share with me your experience after using them.

In the next one, I will talk about remaining performance configuration settings for IBM HTTP server.


logging POST body on IBM HTTP server

How can I enable option for logging POST body on IBM HTTP server ?

there must we some settings to enable post body logging.

We need to log the Body for POST request into the Log file from where we can read the Body and send it to the request on IBM HTTP Server. IBM HTTP Server was installed on Ubuntu Linux Server.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter