0

We're facing a problem with an apache server serving static files. When there are lots of requests for a resource that doesn't exist the apache starts to grow in number of processes and memory usage until it uses all the memory available and stops answering the requests.

The machine has 2GB of RAM and it has the default configuration of apache. There's a workaround for this problem? Any configuration that it's wrong maybe?

Thanks a lot!

Coconut
  • 1
  • 2

1 Answers1

1

The workaround is writing correct HTTP applications handling 404 well.

In case of apache-prefork, the webserver self-regulates quite well. Please have a look to the MaxClients directive to fit to your memory availability.

fsoppelsa
  • 457
  • 1
  • 6
  • 12
  • The main problem is that's a huge security hole, because making a ddos attack it's as simple as requesting a resource that doesn't exists and voilà. Server dead. Max clients it's put at 256, as default. Should I put it down? – Coconut Jun 06 '13 at 18:00
  • Which version of Apache and on which OS is it running? You can stop Dos attacks easily by setting your firewall. If you use GNU/Linux have a look to the `limit` module and set `--limit` for incoming connections like this: `-p tcp --dport 80 -m state --state NEW -m limit --limit 100/minute -j ACCEPT` – fsoppelsa Jun 07 '13 at 07:12