d8888 888 888      88888888888 888      d8b                                 888       888          888       .d8888b.           888                               
      d88888 888 888          888     888      Y8P                                 888   o   888          888      d88P  Y88b          888                               
     d88P888 888 888          888     888                                          888  d8b  888          888      Y88b.               888                               
    d88P 888 888 888          888     88888b.  888 88888b.   .d88b.  .d8888b       888 d888b 888  .d88b.  88888b.   "Y888b.   88888b.  88888b.   .d88b.  888d888 .d88b.  
   d88P  888 888 888          888     888 "88b 888 888 "88b d88P"88b 88K           888d88888b888 d8P  Y8b 888 "88b     "Y88b. 888 "88b 888 "88b d8P  Y8b 888P"  d8P  Y8b 
  d88P   888 888 888          888     888  888 888 888  888 888  888 "Y8888b.      88888P Y88888 88888888 888  888       "888 888  888 888  888 88888888 888    88888888 
 d8888888888 888 888          888     888  888 888 888  888 Y88b 888      X88      8888P   Y8888 Y8b.     888 d88P Y88b  d88P 888 d88P 888  888 Y8b.     888    Y8b.     
d88P     888 888 888          888     888  888 888 888  888  "Y88888  88888P'      888P     Y888  "Y8888  88888P"   "Y8888P"  88888P"  888  888  "Y8888  888     "Y8888  
                                                                 888                                                          888                                        
                                                            Y8b d88P                                                          888                                        
                                                             "Y88P"                                                           888   

All Things WebSphere

Concerns and issues relating to all versions of WebSphere Application Server

Saturday, September 20, 2008

 

Improving performance of your web application by 2x - 5x

Caching is a very common design pattern to improve the performance of a web application. Caching can be done at multiple tiers, application, database, edge of the network.... Caching done right can improve the performance of your web application by 2x-5x. Yes sir that is correct!!! Let me lead you to the road of redemption.

Say your application is an old school J2EE style application composed of with JSP, Servlets, JSF et al. Most of the time your app. is housed in an application server. All application servers have caching frameworks that you can leverage to cache web application JSP/JSTL/Servlet responses.

  1. Look at your web application and determine what is cacheable and what is not. This is not an enjoyable activity. Its like asking someone what they want to become after growing up. At least try to determine all the obvious fragments of your site like headers, footers or relatively unchanging JSPs etc.. that can be cacheable.
  2. Employ tag libraries or configure servlet caching to start caching the web responses from these cacheable artifacts.
  3. Plugin a filter/handler/interceptor/thingamajig/custom code that interacts with caching framework that determines for every URI/request coming into the webcontainer, whether the request was a CACHE MISS, CACHE HIT or was UNELIGIBLE for caching.
  4. Log this information in some file and gather these statistics over a suitable period of time like a week.
  5. WTF do I do with this data ? 1. Determine the cacheability of your website. cacheability= no. of cache miss/no. of cache hits. The smaller this no. the better your website will be able to handle user load. 2. Most importantly look at all the URIs or requests that were demmed to be uncacheable and consider adding caching for those web fragment responses.
  6. Scrub and Repeat
Once you start watching what is cacheable and what is not, you will learn a LOT about your website and its load/user characteristics. You will be add caching for every web response that can be cached thereby improving performance and reaching nirvana.

One hint of caution about adding more caching....Please look at JVM heap usage before you start caching the whole world. Please also put in place a cache invalidation strategy. You dont want users to buy an out-of-stock item.

More on these pesky cache issues later.....

Comments:

Post a Comment

Subscribe to Post Comments [Atom]



Links to this post:

Create a Link



<< Home

Archives

December 2006   September 2008   January 2009   February 2009   March 2009   September 2009   October 2009   November 2009   December 2009   January 2010   February 2010   March 2010   April 2010   October 2010   January 2011   February 2011   April 2011   May 2011   June 2011   July 2011   August 2011   September 2011   October 2011   November 2011   December 2011   January 2012   February 2012   March 2012   April 2012   May 2012   June 2012   July 2012   August 2012   September 2012   October 2012   November 2012   January 2013   May 2013   June 2013   July 2013   September 2013   October 2013   June 2014   August 2014  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]