1

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

igul222
  • 111
  • 2
  • 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 07 '11 at 12:26

2 Answers2

1

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

bahamat
  • 6,263
  • 24
  • 28
0

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.

alvosu
  • 8,437
  • 25
  • 22