Author Topic: PHP-FPM Running in Top 5 Resources  (Read 4289 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
PHP-FPM Running in Top 5 Resources
« on: February 03, 2022, 10:33:32 PM »
As the subject states I see PHP-FPM running in Top 5 Resources and driving CPU usage up. I do not have PHP-FPM installed.

Did install PHP-FPM at one time but deleted using the button shown with version installed in PHP-FPM Selector.

Thing is, I will see two processes popup and they using 7% of CPU each. They do drop down in processes, but why are they still there if I removed PHP-FPM completely?

I did some searching here in forum, but I'm not finding a good topic to help me understand. Thanks in advance for input.

Offline
***
Re: PHP-FPM Running in Top 5 Resources
« Reply #1 on: February 03, 2022, 11:16:18 PM »
php-fpm gets installed here:

Code: [Select]
ls /opt/alt
Run the command above to confirm if there is any php-fpm still installed

Offline
*
Re: PHP-FPM Running in Top 5 Resources
« Reply #2 on: February 04, 2022, 12:20:45 AM »
Thank you for reply @iraqiboy90

I see this after running
Code: [Select]
ls /opt/alt

php74  php81

That is what I have installed.

This is screencap example: https://i.imgur.com/yMsYqJ0.png
« Last Edit: February 04, 2022, 12:27:46 AM by oleteacher »

Offline
***
Re: PHP-FPM Running in Top 5 Resources
« Reply #3 on: February 04, 2022, 09:54:56 AM »
Thank you for reply @iraqiboy90

I see this after running
Code: [Select]
ls /opt/alt

php74  php81

That is what I have installed.

This is screencap example: https://i.imgur.com/yMsYqJ0.png

Delete these folders if you like, at your own risk. Maybe a site is using one of them.

Offline
*
Re: PHP-FPM Running in Top 5 Resources
« Reply #4 on: February 04, 2022, 04:19:27 PM »
Quote
Delete these folders if you like, at your own risk. Maybe a site is using one of them.

Not sure that would be good. I only have 3 sites as this is new install of CWP. PHPInfo from one site shows this:

Code: [Select]
Server API CGI/FastCGI

Virtual Directory Support disabled
Configuration File (php.ini) Path /opt/alt/php81/usr/php
Loaded Configuration File /opt/alt/php81/usr/php/php.ini

I only have PHP CGI installed and they show to be in /opt/alt/ directory?

Offline
***
Re: PHP-FPM Running in Top 5 Resources
« Reply #5 on: February 04, 2022, 06:27:59 PM »
Sorry, I may have misunderstood your previous comment.

php74  php81

That is what I have installed.

yes, you have php cgi in /opt/alt. They are named php74 and php81 for you. PHP-FPM74 for example would be a folder named php-fpm74.

So, now we are back to square one.

If you have root access, login with SSH then install htop if it's not installed.
Code: [Select]
yum install htop
Run htop then press F4 to filter by word. Write "fpm" and it will show you processes with the name fpm in it. Take a look on the far right and you will see the path of where it is.

Here's an example:


Notice that CWP panel uses php-fpm 7.2.30 located in this path /usr/local/cwp/php71. DO NOT DELETE IT.

Offline
*
Re: PHP-FPM Running in Top 5 Resources
« Reply #6 on: February 04, 2022, 10:39:45 PM »
Sorry, I may have misunderstood your previous comment.

Run htop then press F4 to filter by word. Write "fpm" and it will show you processes with the name fpm in it. Take a look on the far right and you will see the path of where it is.

Here's an example:


Notice that CWP panel uses php-fpm 7.2.30 located in this path /usr/local/cwp/php71. DO NOT DELETE IT.

Maybe I am chasing a ghost :)

Installed/ran htop:



I did not know CWP used php-fpm. So, you have taught me something good! Never paid attention and assumed it ran on fastcgi.

The php-fpm processes are standard since CWP uses?

Now I ask your opinion. Is php-fpm a better choice over php cgi?

Thank you for your help and lesson.




Offline
***
Re: PHP-FPM Running in Top 5 Resources
« Reply #7 on: February 05, 2022, 12:34:27 AM »
You're welcome.

I'm not an expert, but from the small research I've done, php-fpm has more features, is faster, and is more secure than CGI, only downside is it uses more memory. Don't take my word for it. Here's a good article explaining the difference:
https://chriswiegman.com/2011/10/fastcgi-vs-suphp-vs-cgi-vs-mod_php-dso/

I believe the main php (php version switcher menu) on CWP is suPHP.

For security, I wouldn't advice in using CGI unless you can lock down those features that can become a security issue, but PHP CGI on CWP can be applied to specific folders instead of an entire domain which is a cool thing to have for those users/clients who have complicated websites...