Stopping greedy http clients!
Is there a way to set a "speed limit" on tcp port 80 requests? Here's my problem:
I have a very popular site with hundreds of pages updated dynamically every 4 hours. Since high-speed internet access has become more popular, I have found more and more visitors using robots to download all pages in one quick multi-threaded connection. When you have a 1,000 people downloading 100 pages all at once you end up with a problem. I can't just block them by their IP because their IPs are dynamic.
I've tried mod_throttle (by Apache), but because my site is very popular I have to keep a huge IP list in memory so this is super memory consuming. Not only that, but because the list is so huge response time on the server is slowed considerably.
My wish is to have a speed limit. So if a user is detected of downloading x number of documents in x amount of time, they are DROPed. Then after a "wait period" they are given permission again. Experimenting a little with this has caused problems. The problem is that a Web page could easily have 30 small images so one http requeset for page a could result in 31 requests.
I don't want to set a bandwidth limit because that will only reject users who have a legit reason to be on the site. I'm only interested in temporarily blocking greedy clients consuming all my resources. Right now I'm on a multiple T-1 so it's not bandwidth that is the problem. The problem is greedy clients hitting me so hard that requests are slowed down for all visitors.
I know yahoo, ebay, cnn and usatoday have all experienced this problem, but I don't know how they solved it.
Anyone have a suggestion on how to go about doing this?
Thanks
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com
Quoted 9 lines · J and T
Is there a way to set a "speed limit" on tcp port 80 requests? Here's my problem:
I have a very popular site with hundreds of pages updated dynamically every 4 hours. Since high-speed internet access has become more popular, I have found more and more visitors using robots to download all pages in one quick multi-threaded connection. When you have a 1,000 people downloading 100 pages all at once you end up with a problem. I can't just block them by their IP because their IPs are dynamic.
I would take a look at iplimit from patch-o-matic, which "allows you to restrict the number of parallel TCP connections to a server per client IP address (or address block)". It will not block the access to your site, but you can use it to limit the number of parallel downloads the clients can use.
- David