Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
    
How can we know what is wrong if you don't tell us your configuration? –  Deer Hunter Jun 6 '13 at 10:50

1 Answer 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.

share|improve this answer
    
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 6 '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 7 '13 at 7:12

Your Answer

 
discard

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.