You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steve Millidge <sm...@c2b2.co.uk> on 2012/07/02 14:53:31 UTC

RE: Any way to deal with too many request per second?

Hi Brian,

You can tune the threads in the Tomcat HTTP connector. Set maximum threads to the maximum concurrency you are prepared to support. That way requests will wait until a thread becomes available.

Steve Millidge
C2B2
The Leading Independent Middleware Experts. 
T: 08450 539457 |M: 07920 100626 |W: www.c2b2.co.uk | E: smillidge@c2b2.co.uk
---------------------------------------------------------------------------------------------------------------
C2B2 Consulting Limited, Unit 33, Malvern Hills Science Park, Geraldine Road, Malvern, Worcestershire, WR14 3SZ
Registered in England and Wales: 4563419, Registered Office: Ardendale, Old Hollow, Malvern, Worcestershire

-----Original Message-----
From: Brian Braun [mailto:brianbraun@gmail.com] 
Sent: 30 June 2012 17:19
To: Tomcat Users List
Subject: Re: Any way to deal with too many request per second?

Hi Joseph,

Could you elaborate that further please? It sounds like a solution, but I didn't understand it.
Thanks in advance!

On Fri, Jun 29, 2012 at 8:28 PM, Joseph <wu...@gmail.com> wrote:

> Try jdk build in block queue in concurrent pkg
>
> 在 2012-6-30,7:57,Brian Braun <br...@gmail.com> 写道:
>
> > Hi,
> >
> > First of all, I'm using Ubuntu 11.1 + Tomcat 7.0.22.
> >
> > I created a RESTfull service. My clients are sending me HTTP 
> > requests,
> and
> > I return them responses. Usually, a client makes at the most 1-2 
> > requests per second which is totally fine, but some clients 
> > sometimes make about
> 30
> > requests per second and that makes my server suffer, even though I'm
> using
> > a load balancer with two servers behind it. I would like to find a 
> > way to deal with this. The best thing would be to delay them when 
> > they do that, not to totally stop or ban them, but to slow them 
> > somehow. Maybe
> creating a
> > queue for them, or maybe putting them in a lower priority, until 
> > they
> slow
> > their requests.
> > I could program this myself, but I guess there is already a solution 
> > somewhere. Maybe a Tomcat valve could do it? Does anybody know one? 
> > Or maybe some kind of filter? Any suggestions?
> >
> > Thanks in advance.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Any way to deal with too many request per second?

Posted by Jose María Zaragoza <de...@gmail.com>.
2012/7/2 Steve Millidge <sm...@c2b2.co.uk>:
> Hi Brian,
>
> You can tune the threads in the Tomcat HTTP connector. Set maximum threads to the maximum concurrency you are prepared to support. That way requests will wait until a thread becomes available.


But, if I'm not wrong, he want to punish some users , whose requesting
on intensive way ,right ?

Maybe Valve can solve your issue
You could implement a delay by source IP address, counting number of
request per second

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org