Monday, January 14, 2008

My debut blog - struts 2 performance

Hi Esteemed folks, the intent of creating this blog is to share my day 2 day experiences/observations on implementation/design of java projects. I work as a senior java developer for an investment bank in NY and i enjoy coding a lot.

Recently i was given the task of evaluating struts 2 framework for our new project and i was very excited to adopt this in our team. i had used version 2.0.1 in my earlier job and it did help to achieve a cleaner design/less code at the presentation layer, but i was worried about the performance aspect of it, especially the custom tags and ognl expressions. but i read on the forum that they had worked on the performance issues in 2.0.11 and so i thought of taking a stab at this using the new release 2.0.11

I downloaded the Apache JMeter to benchmark the results. JMeter is a very lightweight performance evaluation tool from Apache and the learning curve was a couple of hours, believe me or not. Now lets get our hands a bit dirty. The first step was to write a simple jsp page with a few struts 2 form tags, input elements and a iterator tag which loops 100 times over a ognl expression, expression traverses an object to a dept level of 2.

JMeter has a feature of running the agent remotely which simulates the users hitting the web url. i installed the agent on 2 unix boxes. deployed the web application on weblogic 9.2 with JVM heap size of 1 GB on an intel dual core 2.4 GHz box. the test scenario consisted of 200 users hitting the same action url which then forward the request to the test jsp. no database calls were invoked. in my first run, the results were shocking, average response time being 5000 ms.

That kinda prompted me to look at tuning aspect of the framework, changed the dev flag to false, enabled template caching, set the JSP reload check to -1 etc, more details at http://struts.apache.org/2.0.11/docs/performance-tuning.html and i ran the test scenario again and this time the results were dramatic, the average response time was less than 10 ms.

To conclude, you dont have to trade-off the performance of your web application by adopting struts 2. It definitely fits in with your performance requirements of a MVC framework, not to forget wealth of features it brings along. if you are curious about knowing more of struts 2, have a peek at my article http://www.javaworld.com/javaworld/jw-10-2007/jw-10-struts2inaction.html which has a sample code that you can use to kick the tyres.

Feel free to drop a line in case i wasnt clear about anything and i would be glad to clarify/elaborate the same,

its 7.30 PM now, got to rush home,

cheers,
Venkat

1 comment:

Anonymous said...

I am reaching out to you as I saw your information on Linked-In and was wondering if you might be open to any other job opportunities at this time.

My firm, Andiamo Partners, is a financial technology recruitment firm and we work closely with many of the top investment banks and hedge funds in the NYC area – specializing in positions relating financial trading system development.

Our core clients (Goldman Sachs, Morgan Stanley, Two Sigma Investments, and many financial technology firms in NYC) would be very interested in speaking to someone with your background - particularly since you coming out of Lehman Brothers.

We have a complete job listing available at www.ITWallStreet.com if you’d like to see some specific positions. Otherwise, please feel free to give me a call at any time. Thank you!

Patrick Burke | Senior IT Recruiter
Andiamo Partners | Financial Services Practice
42 Broadway, 20th Floor ∙ New York, NY 10004
Main: 212-488-1595 | Direct: 646-747-5166 | Fax: 212-742-1970
patrick.burke@andiamopartners.com
Linked in Profile: http://www.linkedin.com/pub/1/379/2b9
To view our open positions, please visit www.ITWallStreet.com