Abnormally large Apache Process Size

Abnormally large Apache Process Size

by Ariden Lei -
Number of replies: 5
I am greatly annoyed by the abnormally large apache process size. If I set memory_limit=512M, the apache proces size can increase up 400MB.
I try to reduce the apache process size by setting a lower value of PHP memory limit (memory_limit=256M) but it causes failure of some web request actions such as checking the Inbox of a lot of email. It seems that PHP memory is not enough. Even for normal situation, the number of concurrent users is limited by the relatively large apache process size e.g. 200MB.
I checked that the loaded module is not too much.
Is anyone can advise how to reduce the apache process size? Thank you very much.
[ -- ] httpd is currently using 994.79 MB of memory.
[ -- ] The largest apache process is using 338.19 MB of memory
[ -- ] The smallest apache process is using 281.48 MB of memory
[ -- ] The average apache process is using 297.30 MB of memory
[ OK ] Current Apache Process Count is 6, including the parent PID.
--------------------------------------------------------------------------------
### GENERAL FINDINGS & RECOMMENDATIONS ###
--------------------------------------------------------------------------------
Apache2buddy.pl report for server: moodle.xxxx.xxx (x.x.x.x):
Settings considered for this report:
        Your server's physical RAM:                                   135826 MB
        Remaining Memory after other services considered:             114666 MB
        Apache's MaxRequestWorkers directive:                         512      <--------- Current Setting
        Apache MPM Model:                                             worker
        Largest Apache process (by memory):                           338 MB
        Apache appears to be running in worker mode.
        Please check manually for backend processes such as PHP-FPM and pm.max_children.
        Apache2buddy ONLY calculates maxclients for prefork model.
--------------------------------------------------------------------------------
A log file entry has been made in: /var/log/apache2buddy.log for future reference.
[root@moodle ~]# ps -ylC httpd | awk '{x += $8;y += 1} END {print "Process Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024); print "Total Number of Processes: "(y-1)}'
Process Memory Usage (MB): 1050.47
Average Proccess Size (MB): 175.079
Total Number of Processes: 6

Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_worker_module (static)
 authn_file_module (shared)
 authn_socache_module (shared)
 authn_core_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_core_module (shared)
 authnz_ldap_module (shared)
 access_compat_module (shared)
 auth_basic_module (shared)
 socache_shmcb_module (shared)
 reqtimeout_module (shared)
 filter_module (shared)
 mime_module (shared)
 ldap_module (shared)
 log_config_module (shared)
 env_module (shared)
 headers_module (shared)
 setenvif_module (shared)
 version_module (shared)
 proxy_module (shared)
 proxy_connect_module (shared)
 proxy_wstunnel_module (shared)
 proxy_ajp_module (shared)
 ssl_module (shared)
 unixd_module (shared)
 status_module (shared)
 autoindex_module (shared)
 dir_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 php7_module (shared)


Average of ratings: -
In reply to Ariden Lei

Re: Abnormally large Apache Process Size

by Paul Raper -
Just out of interest, do you have any other parameters that may help such as Moodle version, operating system, database etc. Size of installation and number of users could be useful too.
In reply to Paul Raper

Re: Abnormally large Apache Process Size

by Ariden Lei -
Moodle 3.8, CentOS 7.4, Apache 2.4.29, MySQL5.7, DB size 21GB, 135GB Ram
We run online quiz for 530 students for the time being.
In reply to Ariden Lei

Re: Abnormally large Apache Process Size

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
May be relevant: Qptimal value of KeepAliveTimeout https://moodle.org/mod/forum/discuss.php?d=427958. Currently at the top of Hardware and performance forum.

Either way, you are more likely to get responses in the H&P forum https://moodle.org/mod/forum/view.php?id=596. You might want to request the moderator to move the discussion to H&P.
In reply to Visvanath Ratnaweera

Re: Abnormally large Apache Process Size

by Ariden Lei -
Please move my post to the H&P forum https://moodle.org/mod/forum/view.php?id=596. Thank you very much.
In reply to Ariden Lei

Re: Abnormally large Apache Process Size

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hello Ariden. I am moving your post to the Hardware and Performance forum.