Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Is it possible to limit each IP requesting a page from my Apache server to, say, 1 request per second?

share|improve this question
What do you want to happen if someone tries to request two pages per second? Do you want to send them an error page? – DerfK Jan 30 '11 at 16:09
Preferably, their second request would wait forma second. – igul222 Jan 30 '11 at 16:16
Make sure you're using keep-alive for this to be feasible. Browsers usually request 3-4 files until all is fetched and without keep-alive a new connection is made for each file. – Mark Mar 7 '11 at 12:26

What you really want is a program called tc which pairs up with iptables to limit traffic.

There's another recent post asking about bandwidth limiting. The answer is the same for both of you.
controlling the bandwidth using tc

share|improve this answer

In Apache this is not done. bw_mod limit bandwidth. tc limit bandwidth. iptables connlimit limit connection. You may use iptables string and recent modules, but it is not a pretty solution.

share|improve this answer

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.