logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache process size is ~300MB
Author
gtsongi



Joined: 06 Aug 2015
Posts: 3

PostPosted: Fri 07 Aug '15 11:04    Post subject: Apache process size is ~300MB Reply with quote

Hello,

I was preparing to optimize my Apache configuration. While I was reading around I saw people mentioning Apache process sizes between 10 and 40 MB. When I've checked mine on the server I saw that they are at 300. Basically every running Apache process. What can cause this? Server and Apache specs are:
Server:
CPU: Intel(R) Xeon(R) CPU E5-2609 0 @ 2.40GHz, 2 cores
Real Memory: 8GB
Virtual Memory 2GB
OS: Ubuntu 14

Apache:
Version: 2.4.7

Enabled Apache modules:
access_compat
alias
auth_basic
auth_core
authn_file
authz_core
authz_host
authz_user
autoindex
cgi
deflate
dir
env
filter
mime
mpm_prefork
negotiation
php5
reqtimeout
rewrite
setenvif
socache_shmcb
ssl
status

Apache settings:
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0

Can any of these settings or modules cause the process size to increase so much?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 07 Aug '15 11:11    Post subject: Reply with quote

That is why I use event mpm and let PHP run over fcgid.

You can use https://raw.githubusercontent.com/jsmoriss/check-httpd-limits/master/check_httpd_limits.pl

to check why your config uses that much memory.

Code:

sudo ./check_httpd_limits.pl --verbose
Back to top
gtsongi



Joined: 06 Aug 2015
Posts: 3

PostPosted: Fri 07 Aug '15 11:22    Post subject: Reply with quote

Thanks for the quick reply!
I've tried to run check_httpd_limits, but it only gives me warning about a few missing config variables before exiting with the error: ERROR: Cannot determine httpd version number.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 07 Aug '15 11:51    Post subject: Reply with quote

Argh! That is the ubuntu way of things to have the env vars in a different file that is only for the apache2ctl script.

what will work

Code:

sudo su
source /etc/apache2/envvars
./check_httpd_limits.pl --verbose
Back to top
gtsongi



Joined: 06 Aug 2015
Posts: 3

PostPosted: Fri 07 Aug '15 12:20    Post subject: Reply with quote

Thank you! This worked perfectly.
I'm just a bit confused by the numbers it is displaying. For example: PID 21852 (apache2) : 25.49 MB / 5.58 MB shared
In Webmin the same process shows 378MB. Which one is the correct number?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 07 Aug '15 15:51    Post subject: Reply with quote

I think that check_httpd_limits.pl shows the true usage.

the quickest way to check what is true.

Code:
run free -th


stop apache

run free -th again. And see it for yourself how much memory apache consumes. ( Of cause don't forget to start apache again ;) )
Back to top


Reply to topic   Topic: Apache process size is ~300MB View previous topic :: View next topic
Post new topic   Forum Index -> Apache