cgi - How can I implement server-side rate limiting for a Perl web service? -


I have a Pearl-based CGI / Fast CGI web service and they are able to stop the aggressive customers from the IP address Rated-Cmates want to work too much.

I have looked around for some code and found in CPAN but it is for client requests; It has no stubbornness and there is no per-user config, so it is not really useful to limit server-side rate.

I am looking for suggestions for some of the things already existed, otherwise I will need to roll my roll on some simple persistence like tie-to-per-IP address and some batch work The tokens that manage.

"post-text" itemprop = "text">

I used track rate by all the hits at every IP address. This is a cache, so over time the data will end, but if you set the size and expire the time period, then it should not be a problem.

The IP address is the hash key and the hash value is an array of timestamps I have a second data structure (which is also supported) that has a hash of restricted IP address, updated according to the data from the first structure Gaya.


Comments