Cách tính toán Apache Process Ram
Tác giả: Dương Nguyễn Phú Cường
Ngày đăng: 5 ngày trước
Lượt xem: 27
Đếm các tiến trình Httpd: ps aux | grep 'httpd' | awk '{print $6/1024 " MB";}' Tính Trung bình
ps aux | grep 'httpd' | awk '{print $6/1024;}' | awk '{avg += ($1 - avg) / NR;} END {print avg " MB";}'
Here's what I've done to 'solve' it:
- Set
MaxClients 7
(based on(1740.8Mb Memory on server - 900Mb for MySQL + other stuff) / 111Mb average usage per httpd process = 7.5747747747747747747747747747748
)
Therefore:
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 7
MaxRequestsPerChild 4000
</IfModule>
- Disable all Apache modules except for
authz_host_module
,log_config_module
,expires_module
,deflate_module
,setenvif_module
,mime_module
,autoindex_module
,negotiation_module
,dir_module
,alias_module
,rewrite_module
,php5_module
- Remove the
mod_ssl
package since the client isn't usinghttps://
whatsoever.
I'll report back once this new configuration has been running a while to see if this solves it.
Some inspiration here was borrowed from: http://www.activoinc.com/blog/2009/08/31/performance-optimized-httpd-conf-for-magento-ecommerce/ and http://www.activoinc.com/downloads/httpd.conf-magento