HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Unneeded Apache 2 Modules (http://www.howtoforge.com/forums/showthread.php?t=52189)

lewis_saint 7th April 2011 15:40

Unneeded Apache 2 Modules
 
I am running Apache 2.2.16 on Debian Squeeze with ISPConfig 3.0.3 and am looking to reduce my apache2 process memory footpint. Currently, running 'ps -ylC apache2 --sort:rss' gives me:
Code:

S    33 13100 24996  0  80  0 10452 65841 -      ?        00:00:00 apache2
S    33 13089 24996  0  80  0 10724 65963 -      ?        00:00:00 apache2
S    33 13088 24996  0  80  0 10728 65963 -      ?        00:00:00 apache2
S    33 13087 24996  0  80  0 10740 65963 -      ?        00:00:00 apache2
S    33 13090 24996  0  80  0 10824 65965 -      ?        00:00:00 apache2
S    33 13096 24996  0  80  0 12212 65920 -      ?        00:00:00 apache2
S    33 13065 24996  0  80  0 14848 66758 -      ?        00:00:00 apache2
S    0 24996    1  0  80  0 17704 65808 -      ?        00:00:01 apache2
S    33 13061 24996  0  80  0 21816 68390 -      ?        00:00:00 apache2
S    33 13085 24996  1  80  0 29464 69924 -      ?        00:00:00 apache2
S    33 12776 24996  0  80  0 30200 70431 -      ?        00:00:00 apache2
S    33 12775 24996  0  80  0 30544 69999 -      ?        00:00:00 apache2
S    33 12271 24996  0  80  0 39424 72353 -      ?        00:00:00 apache2
S    33 13084 24996  1  80  0 43220 73327 -      ?        00:00:00 apache2
S    33 13063 24996  1  80  0 43400 73343 -      ?        00:00:01 apache2
S    33 13095 24996  2  80  0 43936 73552 -      ?        00:00:00 apache2
S    33 12774 24996  0  80  0 44200 73539 -      ?        00:00:00 apache2
S    33 13101 24996  3  80  0 45212 73882 -      ?        00:00:00 apache2
S    33 13059 24996  1  80  0 45712 74024 -      ?        00:00:00 apache2
S    33 13099 24996  3  80  0 45872 74077 -      ?        00:00:00 apache2
S    33 13094 24996  4  80  0 46148 74140 -      ?        00:00:00 apache2
S    33 12781 24996  1  80  0 50676 75153 -      ?        00:00:01 apache2

My enabled modules are currently:
Code:

actions.conf          authz_user.load  include.load      proxy.load
actions.load          autoindex.conf  mime.conf        reqtimeout.conf
alias.conf            autoindex.load  mime.load        reqtimeout.load
alias.load            cgi.load        negotiation.conf  rewrite.load
auth_basic.load      deflate.conf    negotiation.load  setenvif.conf
authn_file.load      deflate.load    php5.conf        setenvif.load
authz_default.load    dir.conf        php5.load        status.conf
authz_groupfile.load  dir.load        proxy.conf        status.load
authz_host.load      env.load        proxy_http.load  suexec.load

Apache2.conf has Timeout 30, KeepAliveTimeout 15, MaxKeepAliveRequests 100 and prefork with:
Code:

    StartServers          5
    MinSpareServers      5
    MaxSpareServers      10
    MaxClients          75
    MaxRequestsPerChild 1000

Why are my apache processes running at 50Mb each?

Regards,

Lewis

falko 8th April 2011 14:22

Have you tried this guide? http://www.howtoforge.com/configurin...um_performance

Also, do you use some sort of PHP opcode cacher, e.g. eAccelerator, Xcache, or APC?

lewis_saint 8th April 2011 15:02

Hey falko,

Thank you for getting back to me. I don't use any sort of PHP opcode cacher, and have seen the article you mentioned.

I already have HostnameLookups Off, and configured MaxClients and whatnot, as specified earlier. Out of the modules that I currently have enabled, are there any known 'offenders' who use a large amount of RAM? What's the primary reason that my apache2 processes would be using 50Mb of RAM so quickly after starting?

Regards,

Lewis

falko 9th April 2011 12:49

I'm using
Code:

Timeout 300
MaxKeepAliveRequests 1000000
KeepAliveTimeout 2
StartServers          5
MinSpareServers      5
MaxSpareServers      10
MaxRequestsPerChild  0

Can you try these?

lewis_saint 9th April 2011 16:30

By setting 'MaxRequestsPerChild' to 0, the apache documentation says: 'the process will never expire' - is that really what one wants?

Additionally, will any of those settings have any immediate effect on the memory footprint?

till 11th April 2011 10:42

The momory footprint is ok for apache and should be no problem. What you can try is to uninstall php modules that you dont need and that you disable apache mod_proxy and mod_proxy httpd

lewis_saint 11th April 2011 15:54

Quote:

Originally Posted by till (Post 255000)
The momory footprint is ok for apache and should be no problem. What you can try is to uninstall php modules that you dont need and that you disable apache mod_proxy and mod_proxy httpd

Your guide says that the memory should be 2-3Mb, or 15Mb if using PHP, but then you tell me that it is normal that I have 50Mb processes?

Also, I have already gotten rid of all the modules I believe I am not using. The rest I am unsure about. I am definitely using the proxy stuff, but is it a known memory hog?

till 12th April 2011 10:30

Quote:

Your guide says that the memory should be 2-3Mb, or 15Mb
To which guide do you refer, please post the exact sentence. Apache never uses only 2-3 MB RAM.

lewis_saint 12th April 2011 12:43

http://www.howtoforge.com/configurin...um_performance

"Child process size for serving static file is about 2-3M. For dynamic content such as PHP, it may be around 15M."

till 12th April 2011 13:08

Thats not a guide that I have written, please see author information.

Also this refers to a separate server for static contents and not a server that serves dynamic content like your server. A server for dynamic content loads modules like PHP inside the server process.

And the guide is from 2006, so it most likely for apache 1 (which uses less RAM) or a old apache 2 version and not the current apache 2.2.


All times are GMT +2. The time now is 14:01.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.