You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jasdeep <js...@gmail.com> on 2007/05/19 08:22:30 UTC

Handling requests through servlets vs struts action class ?

Hi All,
I am developing a web application which is going to receive and send
millions of sms's .
I am using Kannel (www.kannel.org) as my SMS gateway server.
Now kannel server recognizes each sms and i have configured it to send
recived SMS to my web application .

Firstly was using the struts action class for receiving the SMS i.e. Kannel
sends it to URL i specify in kannel configuration .
But then i thought it may have serious performance penalty as struts action
is using single thread model (AFAIK).
So i decide to shift to servlet based application ,is it a good idea ?
I am double minded ,can anybody help me out .

Regards ,
Jasdeep
-- 
View this message in context: http://www.nabble.com/Handling-requests-through-servlets-vs-struts-action-class---tf3781482.html#a10694173
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Handling requests through servlets vs struts action class ?

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
There should be no additional concurrency limitations for struts actions 
as for any request handled by other servlet implementations. It's the 
container that determines how each request is handled. In the simplest 
case it will use a thread per request drawn from an available thread 
pool.  Struts doesn't prevent this.

However, assuming the Kannel server performs a post to your applicable 
for every SMS received and you anticipate receiving a large volume of 
requests per second:
  - what are you doing when you receive each request?  If you're simply 
persisting some data and not rendering a complex response then there may 
be little justification for using any MVC framework.  A servlet may be 
fine;
  - it would be worthwhile considering a framework intended for handling 
these kinds of server-to-server messages (eg. a web service framework) 
rather than a hand-written servlet;
  - if you still want to go with the servlet vs. struts option, turn off 
all unnecessary interceptors (in S2) and use your existing code and a 
post-bot to compare the performance of the two options for some test 
data.  By using a servlet you lose the advantages of the framework 
(interceptors, validation, mapping of request parameters and templates 
for the response) but you have to weigh that up against the performance 
cost for your specific scenario.

regards,
Jeromy

jasdeep wrote:
> Hi All,
> I am developing a web application which is going to receive and send
> millions of sms's .
> I am using Kannel (www.kannel.org) as my SMS gateway server.
> Now kannel server recognizes each sms and i have configured it to send
> recived SMS to my web application .
>
> Firstly was using the struts action class for receiving the SMS i.e. Kannel
> sends it to URL i specify in kannel configuration .
> But then i thought it may have serious performance penalty as struts action
> is using single thread model (AFAIK).
> So i decide to shift to servlet based application ,is it a good idea ?
> I am double minded ,can anybody help me out .
>
> Regards ,
> Jasdeep
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Handling requests through servlets vs struts action class ?

Posted by Craig McClanahan <cr...@apache.org>.
On 5/18/07, jasdeep <js...@gmail.com> wrote:
>
> But then i thought it may have serious performance penalty as struts action
> is using single thread model (AFAIK).

This is not a correct assumption.  In Struts 1, there is a single
*instance* of each Action, but it can be processing multiple requests
(on multiple threads) at once.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org