Optimization Moodle HTTPD For Centos

5:44 AM 0 Comments

Show used memory for apache process

ps aux | grep 'httpd' | awk '{print $6/1024 " MB";}'

And for resume:

ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'

show server MPM
# httpd -V

Server MPM:     prefork

And than
MaxRequestWorkers = Total available memory * 80% / Max memory usage of apache process

Example i have 91GB ram, and 50MB max memory per process (usualy per process not more than 100MB)
MaxRequestWorkers = 91000 * 0.8 / 50 = 1400

and than usualy i add 1400+100=1500 for ServerLimit

So configure mpm prefork
#vi /etc/httpd/conf.modules.d/00-mpm.conf

<IfModule mpm_prefork_module>
MaxRequestWorkers 1400
ServerLimit 1500
</IfModule>

# systemctl restart httpd

NCA

Support you how to install server, networking and Programming Easy

0 comments:

You can post comment with english language or indonesia language.
Anda bisa memberikan komentar dalam bahasa inggris atau bahasa indonesia.