Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

today we ran apachebench on our server to stress test it. Of course, our system peaked and disk I/O was massive. Can we avoid that other people run such "tests" or some sort of attack to stress our system?

We are running apache on centos, iptables is running. Not really sure what's the best way to avoid that problem?

share|improve this question
up vote 2 down vote accepted

IPTables can limit the number of connections per second per origin host. xinetd also has similar functionality; but i don't think it's worth running it in front of Apache. Of course, a DDOS attack would go past that limitation (that's the first 'D'). At that point, syncookies and some router-based limits will keep your box from crashing, but service will suffer anyway.

share|improve this answer

You can use the recent module with iptables to block requests that come in to fast from a specific ip. Here is an article with some examples. If you get into more DoS attacks that overwhelm your bandwidth then you might need to get the ISP involved when this happens. The general topic you want to research is Denial of Service (DoS) attacks.

share|improve this answer

It takes 6 quadcore xeons running ab against one of our Varnish cache headends before our network is saturated. Varnish seems to have no problem. We could upgrade our Varnish machine to a 10g connection and push more machines at it, but, what's the point?

If one instance of ab is crushing your server, you might want to analyze your webapp/stack. ab tests only one page, which really should be one of the easiest things in the world for any webapp to handle.

What happens when you get an equivalent amount of real traffic that mimic's the ab test that crushed your server?

share|improve this answer
you're right, thanks for the insight! – solsol Jun 29 '10 at 14:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.