Re: [Jersey] Rate Limiting RESTful Web Services

From: Casper Bang <>
Date: Mon, 15 Feb 2010 14:29:03 +0100

I plan to rewrite my logging filter to update an application scoped map,
aggregating response sizes for a given user. However I would probably
use EhCache (which works as a map, ram or disk based and can persist
between restarts) not to burden a database. If you come up with
something Dário, I'd love to see a post about it here on the list. :)


Paul Sandoz wrote:
> Hi Dário,
> I do not have any experience in this area.
> I suppose you could write a Jersey request filter to do such rate
> limiting. It should be rather easy, the devil is in the details of
> where/how the information is stored.
> But perhaps web front end servers and routing hardware may also be
> able to perform such functionality before it reaches the application?
> Paul.
> On Feb 15, 2010, at 12:58 PM, Dário Abdulrehman wrote:
>> What is the recommended approach for rate limiting web services?
>> Does Jersey support this?
>> Two approaches come to my mind: at the application level, using a
>> relation of IP, timestamp and number of calls, which is used to
>> register for each IP, the number of calls made in a 24 hour period.
>> This count is reset every 24 hours. The other approach is at the OS
>> level using for example iptables (UNIX).
>> Thanks.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail: