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)