I have an apache2 server with an application that uses a postgres db on Debian/Linux. The server has 1.2 gigs of ram.
On the client side (browser), if I keep refreshing the window (F5) non-stop for a long period of time (about 1 minute), apache2 and postgresql end up crashing, and all comes back to normal after they recover. This is due to the poor programming of the application, aspect I don't have control over, and the fact that I'm hammering the server with requests and it's trying to answer to all of them.
My question, are there tools on Debian that can see an abusive IP and block it for a certain amount of time? Anything will help.
Update: this is from a server side standpoint, abstracting the inefficient/load-intensive actions that every HTTP request require to complete. Forget about the application, think of it from a server standpoint.
Thanks
mod_evasive can do it as you've found. You can also do it with iptables, take a look at http://www.debian-administration.org/articles/187