Tuesday, 15 September 2020

php-fpm Tuning

Target 1000 concurrent users untuk TAO

CPU 


CPU 10 core

$ cat /proc/cpuinfo | grep "model name"

model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
model name : Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz

Memory 

$free -g
              total        used        free      shared  buff/cache   available
Mem:             16           0          14           0           1          15
Swap:             0           0           0

Tuning

MySQL menggunakan konfigurasi seperti di jelaskan ... disini ..., Ketika concurent user 16 s.d 27, ke website utama, bukan TAO, MySQL memakan memory kurang lebih 800M s.d 900M.

Untuk mengetahui concurrent user, jalankan perintah : 

 $ netstat -plan | grep :80 | wc -l
 $ netstat -plan | grep :443 | wc -l


Terkadang, tiba-tiba server seperti hang tidak bisa menerima request sama sekali, menurut diskusi [7], solusi yg bisa dicoba mengubah kongurasi php-fpm.conf

emergency_restart_threshold=3

emergency_restart_interval=1m

process_control_timeout=5s

Referensi

  1. PHP-FPM Process Calculator, https://spot13.com/pmcalculator/
  2. Optimizing PHP-FPM for High Performance,  https://geekflare.com/php-fpm-optimization/
  3. Performance enhacements for Apache and PHP, https://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html
  4. Optimizing PHP Application Concurrency, https://devcenter.heroku.com/articles/php-concurrency
  5. PHP-FPM tuning for high load – The Best practices!, https://bobcares.com/blog/php-fpm-tuning-high-load/
  6. Moodle performance - examples of configurations, https://moodle.org/mod/forum/discuss.php?d=395623
  7. Optimizing NGINX and PHP-fpm for high traffic sites, http://www.softwareprojects.com/resources/programming/t-optimizing-nginx-and-php-fpm-for-high-traffic-sites-2081.html
  8. Constantly have to reload PHP-FPM, https://serverfault.com/questions/575457/constantly-have-to-reload-php-fpm
  9. Apache2 and php fpm performance optimization — Step-by-step guide, https://medium.com/@sbuckpesch/apache2-and-php-fpm-performance-optimization-step-by-step-guide-1bfecf161534
  10. What Are The Best PHP Accelerators?, https://wp-rocket.me/blog/best-php-accelerators/
  11. How to Enable and Monitor PHP-FPM Status in Nginx, https://www.tecmint.com/enable-monitor-php-fpm-status-in-nginx/

1 comment:

  1. Informative blog! it was very useful for me.Thanks for sharing. Do share more ideas regularly.
    Village Talkies a top-quality professional corporate video production company in Bangalore and also best explainer video company in Bangalore & animation video makers in Bangalore, Chennai, India & Maryland, Baltimore, USA provides Corporate & Brand films, Promotional, Marketing videos & Training videos, Product demo videos, Employee videos, Product video explainers, eLearning videos, 2d Animation, 3d Animation, Motion Graphics, Whiteboard Explainer videos Client Testimonial Videos, Video Presentation and more for all start-ups, industries, and corporate companies. From scripting to corporate video production services, explainer & 3d, 2d animation video production , our solutions are customized to your budget, timeline, and to meet the company goals and objectives.
    As a best video production company in Bangalore, we produce quality and creative videos to our clients.

    ReplyDelete