I am using cPanel with PHP-fpm. My server is using 100% cpu due to PHP-FPM Pool. How i can optimize this load?

OS : centos 7 Cpanel Version : Version 84 Mysql version - 5.7 Apache : Easy Apache 2.4 PHP version : 5.6 (PHP-FPM)

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello, t3stw3rks

You can simply enable the Event MPM and disable the current active MPM in your EA4 build profile. Once you start the next build, the EasyApache 4 update process will automatically take care of the installation.

cPanel have documented the differences between each MPM at:

Multi-Processing Modules - MPMs - EasyApache 4 - cPanel Documentation

Once you’ve switched to Event MPM and using PHP-FPM you will notice a significant improvement in the server’s performance.

Hope that this helps! Regards, Alex

Hi @t3stw3rks,

First and foremost, you’ll need to optimize your website, that’s the biggest issue usually! After that you can turn your attention to your droplet.

Since you are asking about your droplet, here are a few steps. Since you are using cPanel with PHP-FPM, I’ll recommend switching your mpm to mpm_event. It’s the best as far as I’m concerned. It can be changed from your EasyApache configuration in cPanel.

Additionally, you’ll need to install a module in cPanel for httpd2. This again is installed from your EasyApache configurations. Don’t forget to add OPcache as well, it works really good with mpm_event and httpd2.

I’ll recommend updating your PHP version to at least 7.2 as well, 5.6 is really old and as it’s older it’s slower.

All of the above should help you with optimizing your droplet however, you can take a look at installing redis as well.

Regards, KDSys