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.

I have apache2 running on ubuntu 10.04 with 512mb ram. It all seems ok, until i start start making requests to the server. When I watch my memory usage, it jumps up about 5-10% every time I browse to another page. I am assuming this is new apache processes running to server the content. I am not bothered about that, but it doesn't come back down when I stop requesting pages.

I am using Django and wsgi if that makes any difference.

EDIT:

from: /etc/apache2/apache2.conf

Timeout 300
KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 3

<IfModule mpm_prefork_module>
StartServers          1
MinSpareServers       1
MaxSpareServers       5
MaxClients           15
MaxRequestsPerChild   0
</IfModule>



<IfModule mpm_worker_module>
StartServers          2
MinSpareThreads      25
MaxSpareThreads      75
ThreadLimit          64
ThreadsPerChild      25
MaxClients          150
MaxRequestsPerChild   0
</IfModule>



<IfModule mpm_event_module>
StartServers          2
MaxClients          150
MinSpareThreads      25
MaxSpareThreads      75
ThreadLimit          64
ThreadsPerChild      25
MaxRequestsPerChild   0
</IfModule>

I already edited the mpm_prefork_module to be smaller, but that didn't fix it!

share|improve this question
    
Avoid mod_wsgi embedded mode and prefork if at all possible. See 'blog.dscpl.com.au/2009/03/…;. Same issue for mod_wsgi embedded mode as for mod_python. Use of prefork means configuring/tuning Apache MPM settings for far persistent Python web application rather than defaults which are setup for static files and PHP. –  Graham Dumpleton Feb 27 '11 at 7:39
    
Thanks for the link.Sounds like what I may be looking for. It's not working though :-) –  Designer023 Feb 28 '11 at 10:46
add comment

2 Answers

Can you post here what are the settings of your apache

MaxRequestsPerChild

MaxClients

also some top output or whatever you are seeing when it jumps could be great to help us understand and explain where memory is going.

share|improve this answer
    
I have already modified the mpm_prefork_module but I don;t think that helped. Thanks for looking –  Designer023 Feb 23 '11 at 16:40
add comment

It shouldn't come back down. Its only an issue if you're running out of memory. Otherwise most software will use as much memory as possible and keep using it.

This sounds like working as expected. A few apache children start up, consume some memory, and stay running with in the bounds of max and min spare servers.

You can browse the documentation and make more adjustments if you like. Say reduce MaxSpareServers. Then you won't have as many apache processes hanging around.

share|improve this answer
    
I reduced the numbers and now it sits at about 70% of memory usage. If I happen to run any larger memory processes off apache it should give me some head room –  Designer023 Feb 24 '11 at 9:13
add comment

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.