You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Camilo Gonzalez <ic...@yahoo.com> on 2007/02/09 21:12:40 UTC

Struts2 Performance

Hi all!

Well, I've been using, along with my development team, Struts2 since version 2.0.1, and
recently moved to 2.0.5.

Everything seems allright with Struts2 performance, however, we've been doing tests
just before shipping into production (in just a week) and have found the following:

1) Parameters interceptor when receiving high load got really slow per request.
I don't know if it has something to do with the OGNL Values Stack. Any feedback
in this point would be great.

Anyway, we had to develop a lightweight Parameters Interceptor of our own (which I attach),
and improved significantly the number of responses per second. Of course, it doesn't use
OGNL Value Stack and not supports Wrapper Arrays. However, String, and Integer arrays are supported.
Long, Float or other Basic Type Wrappers Arrays are of easy implementation.

2) Well, besides Struts2 we use Spring (and Hibernate). Tracking the times of response per request
on each step, we found that Struts2 creates a Response object (as far as I know, always of the class
org.apache.struts2.dispatcher.ServletDispatcherResult). Anyway, in every request, Struts2 attempts to get
an object from the ObjectFactory (in this case Spring), with the name 
org.apache.struts2.dispatcher.ServletDispatcherResult, which of course, doesn't exist unless you
define it in your beans definition file, so, the ObjectFactory creates a new object of the type 
org.apache.struts2.dispatcher.ServletDispatcherResult. This creation process, when faced to a high concurrent load
of requests gets really, really slow (still don't know why). The solution, very simple in fact, is to define a bean
in your spring bean file:

<bean id="org.apache.struts2.dispatcher.ServletDispatcherResult"
        class="org.apache.struts2.dispatcher.ServletDispatcherResult" scope="prototype"
        autowire="byName">
</bean>

Have a nice day,

Camilo Gonzalez



__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/