Enhance FPM support
Completed
Now that EA4 has php-fpm packages I would like to see cPanel & WHM offer support for configuring per-user pools so that I can provide sites that need better performance with dedicated PHP resources.
Hey everyone! Version 60 just went to CURRENT. We're still discussing many of the concerns that were brought up here, but haven't acted on them (as far as I know). If you want to see specific things added to this feature, definitely submit feature requests for them! If you have any questions feel free to email me.
Hey everyone! Version 60 just went to CURRENT. We're still discussing many of the concerns that were brought up here, but haven't acted on them (as far as I know). If you want to see specific things added to this feature, definitely submit feature requests for them! If you have any questions feel free to email me.
With PHP-FPM users can access each other user's PHP cache and the only way to make it secure is to either disallow caches like apcu or to run a seperate PHP-FPM instance per user.
Some webhosts will want muliple pools, others will need multiple instances.
With PHP-FPM users can access each other user's PHP cache and the only way to make it secure is to either disallow caches like apcu or to run a seperate PHP-FPM instance per user.
Some webhosts will want muliple pools, others will need multiple instances.
@Matt Dees, I have looked into the possible implementation of php-fpm in EasyApache 4.
We are currently using an old mod_fastcgi instead of mod_proxy_fcgi which should also not break the MultiPHP selector provided with EA4. Is there an way to manually register additional PHP-Versions which can be
selected by the User in cPanel.
Or will your automated version of php-fpm be implemented with cPanel 54 when EA4 will be default?
Since PHP-FPM is about 2-4x faster on our servers than the other available PHP implementations it would be very helpfull if we can get it to work with the new MultiPHP selector.
@Matt Dees, I have looked into the possible implementation of php-fpm in EasyApache 4.
We are currently using an old mod_fastcgi instead of mod_proxy_fcgi which should also not break the MultiPHP selector provided with EA4. Is there an way to manually register additional PHP-Versions which can be
selected by the User in cPanel.
Or will your automated version of php-fpm be implemented with cPanel 54 when EA4 will be default?
Since PHP-FPM is about 2-4x faster on our servers than the other available PHP implementations it would be very helpfull if we can get it to work with the new MultiPHP selector.
How is this progressing?
How is this progressing?
Hello Matt,
Any update?
Hello Matt,
Any update?
Hey all! We've got this framework built, and a UI that allows you to enable/disable per-domain. We're automatically creating pools for each user as enabled as well. We are currently on schedule for this to land in v58.
Hey all! We've got this framework built, and a UI that allows you to enable/disable per-domain. We're automatically creating pools for each user as enabled as well. We are currently on schedule for this to land in v58.
FYI - I totally understand why it is unsecure to allow malicious users to access pools / cache for other users and in a typical shared hosting environment that makes sense. The downside is that you can't share the cache for things like drupal/wordpress/etc.
Our case is a bit different. We are running mod-ruid2 to isolate permissions on the file system by having apache run as the user. This avoids inadvertent interference between user apps and potentially prevents user exploits from affecting other users.
If possible, it would be preferable to have the performance benefit of a shared system mem/cache pool but have file-system level / setuid per directory.
Not sure if that is something you have considered or if there is a good work-around.
FYI - I totally understand why it is unsecure to allow malicious users to access pools / cache for other users and in a typical shared hosting environment that makes sense. The downside is that you can't share the cache for things like drupal/wordpress/etc.
Our case is a bit different. We are running mod-ruid2 to isolate permissions on the file system by having apache run as the user. This avoids inadvertent interference between user apps and potentially prevents user exploits from affecting other users.
If possible, it would be preferable to have the performance benefit of a shared system mem/cache pool but have file-system level / setuid per directory.
Not sure if that is something you have considered or if there is a good work-around.
ready to test it cause need some review for Magento 2 hosting on cPanel :)
ready to test it cause need some review for Magento 2 hosting on cPanel :)
Got a quick update for you all! This UI is in EDGE, and I like it quite a bit. I've attached a screenshot. If you have an EDGE server you should take a look. Random side note: If you would like to run an EDGE-tiered server, but don't have a spare license, you can apply for a developer license.
Got a quick update for you all! This UI is in EDGE, and I like it quite a bit. I've attached a screenshot. If you have an EDGE server you should take a look. Random side note: If you would like to run an EDGE-tiered server, but don't have a spare license, you can apply for a developer license.
Hopefully there's a GUI for default and per user / domain settings for each pool somewhere. That GUI is just an on/off setting which of course is still necessary, but is only the smallest tip of the iceberg.
Hopefully there's a GUI for default and per user / domain settings for each pool somewhere. That GUI is just an on/off setting which of course is still necessary, but is only the smallest tip of the iceberg.
Hey everyone! This feature has been delayed to v60 for usability and security concerns. It was removed from EDGE today and will make a return in a future EDGE build.
This removal includes both the UI that was included in WHM and the relevant API calls. In the event that you have configured your server to use PHP-FPM on EDGE, your current implementation will not be altered, but you will not be able to manage PHP-FPM though the WHM UI.
As always, let me know if you have questions!
Hey everyone! This feature has been delayed to v60 for usability and security concerns. It was removed from EDGE today and will make a return in a future EDGE build.
This removal includes both the UI that was included in WHM and the relevant API calls. In the event that you have configured your server to use PHP-FPM on EDGE, your current implementation will not be altered, but you will not be able to manage PHP-FPM though the WHM UI.
As always, let me know if you have questions!
The first EDGE build of cPanel & WHM version 60 (which will be 59.9999.??) will hit the EDGE tier in the next week, we think. From there it's typically another 6-8 weeks before a new version starts its move through the release tiers.
The first EDGE build of cPanel & WHM version 60 (which will be 59.9999.??) will hit the EDGE tier in the next week, we think. From there it's typically another 6-8 weeks before a new version starts its move through the release tiers.
This feature would create php-fpm configs for new accounts created? So that you don't need to make a configuration for each new account created.
This feature would create php-fpm configs for new accounts created? So that you don't need to make a configuration for each new account created.
It's not yet certain if it will or won't make it into early EDGE versions, but I do want to mention that we don't recommend you run EDGE on production servers at all. The feature is intended to replace the need to manually configure FPM pools manually, yes, and to allow you to manage many other aspects of the service as well. As soon as it hits EDGE I'll update here, for sure.
It's not yet certain if it will or won't make it into early EDGE versions, but I do want to mention that we don't recommend you run EDGE on production servers at all. The feature is intended to replace the need to manually configure FPM pools manually, yes, and to allow you to manage many other aspects of the service as well. As soon as it hits EDGE I'll update here, for sure.
I noticed that this feature was not mentioned in the august development update on the blog, was there any particular reason for that? Is this feature available in the current EDGE-tier?
I noticed that this feature was not mentioned in the august development update on the blog, was there any particular reason for that? Is this feature available in the current EDGE-tier?
We've made a ton of improvements to the PHP-FPM mangement in the Multi-PHP interface in WHM. We'd love to see you take a look!
We've made a ton of improvements to the PHP-FPM mangement in the Multi-PHP interface in WHM. We'd love to see you take a look!
Couple of question I haven't been able to get an answer on in the forum. (see here for more details - https://forums.cpanel.net/threads/confused-about-easyapache4-and-fpm.568841/#post-2305351).
If we had used the previous manual method to configure FPM, it was mentioned on the forum that "the changes you must make are not compatible with the actual FPM support in cPanel version 60."
So, if one has been running FPM over the last few versions using the previous method, will that completely break when updating to 60? ...or will it continue to work but just require some manual removals of the user.conf and userdata fpm.conf files before activating the newer method on a user by user domain by domain basis?
Also, the current instructions use the following in the fpm.conf files:
but I used the following that was recommended offsite (http://blog.remirepo.net/post/2014/03/28/PHP-FPM-and-HTTPD-2.4-improvement for the later Apache 2.4 versions:
... and it did prove to work a lot better and more compatible.
Do you know what method will be used in 60? ...because the outdated ProxyPassMatch method is pretty useless for me since it broke sites such as wordpress multi-site installs, messed with directory indexes disallowing previously working methods (like problems with site with both .php and .html indexes and FancyIndexing file listings). The SetHandler method doesn't have those problems. (see more here - https://forums.cpanel.net/threads/php-fpm-directory-index-index-html-file-not-found-problem.529701/).
Couple of question I haven't been able to get an answer on in the forum. (see here for more details - https://forums.cpanel.net/threads/confused-about-easyapache4-and-fpm.568841/#post-2305351).
If we had used the previous manual method to configure FPM, it was mentioned on the forum that "the changes you must make are not compatible with the actual FPM support in cPanel version 60."
So, if one has been running FPM over the last few versions using the previous method, will that completely break when updating to 60? ...or will it continue to work but just require some manual removals of the user.conf and userdata fpm.conf files before activating the newer method on a user by user domain by domain basis?
Also, the current instructions use the following in the fpm.conf files:
but I used the following that was recommended offsite (http://blog.remirepo.net/post/2014/03/28/PHP-FPM-and-HTTPD-2.4-improvement for the later Apache 2.4 versions:
... and it did prove to work a lot better and more compatible.
Do you know what method will be used in 60? ...because the outdated ProxyPassMatch method is pretty useless for me since it broke sites such as wordpress multi-site installs, messed with directory indexes disallowing previously working methods (like problems with site with both .php and .html indexes and FancyIndexing file listings). The SetHandler method doesn't have those problems. (see more here - https://forums.cpanel.net/threads/php-fpm-directory-index-index-html-file-not-found-problem.529701/).
will this future only available from WHM? what about with cPanel front end for users?
i think it will be really good, if user can decide to use FPM or not.
For php-fpm configuration like benny image
I think that should keep on WHM.
will this future only available from WHM? what about with cPanel front end for users?
i think it will be really good, if user can decide to use FPM or not.
For php-fpm configuration like benny image
I think that should keep on WHM.
while its only betabut think this way you have it now is not good approach.
- no chroot?? even in beta, really?
you will have a lot of work to make it right, this is why its not available now...
- only one php-fpm config file? it grabs all the fpm pool configs?? this is a huge security flaw.
php-fpm: master process (/opt/cpanel/ea-php70/root/etc/php-fpm.conf)
- creating master systemd service file? probably file must be in /etc/systemd/system/?
/usr/lib/systemd/system/ea-php70-php-fpm.service
- nameless socket and stored in root folder? it must be created in folder with its user name. and it must have user name so it will be easy to debug many issues.
/opt/cpanel/ea-php70/root/usr/var/run/php-fpm/31af0b71da8ad5e80e86ed883b85b2d83aadb2e5.sock
/opt/cpanel/ea-php70/root/usr/var/run/php-fpm/8fae611e8e6fc1fe96639813de15fd64621324e6.sock
/opt/cpanel/ea-php70/root/usr/var/run/php-fpm/c288a9f521f815ca6697f73faef0799951fcb9b7.sock
- apache log and php-fpm log in different folders??
/etc/apache2/domlogs/
/home/demo/logs/
and lots of other issues...
anyway lets talk about what we have now:
chroot - this is must have, and this is the only way to run php-fpm in multiuser shared environment. php-fpm must be crooted to user home folder. there will be some issues when you have another addon domain, projects in subfolders, etc
in nginx you can easily have master chroot folder but using "map" to dynamically map a document_root into variable and pass it to php-fpm the way you need it.
without hardcoding it in php-fpm pool.
so i guess in cpanel maybe you must have config in:
then every cpanel account must have its own php-fpm.conf file, to run its own pool config from it.
first of all - opcache sharing is very dangerous and it brings lots of errors.
then imagine a situation when server is running with 1000 e-commerce accounts and someone made a typo in one of the pool configs. php-fpm wont be able to restart and all accounts are also down. this is a big NO.
i do not want losing clients because of this.
so php-fpm.conf file must be created as:
for every user account there must be its own service file, for example:
and it will call its own php-fpm-{cpaneluser}.conf with its own pid, logs, settings and paths, this will call its own pool config file {cpaneluser}.conf
when i call opcache from one account i can see this:
all logs must be in one location per user account/domain.
i guess you have some idea.
im working with one company that manages our cpanel servers, they have modified it to run with php-fpm for EA3, im pushing them to do some modifications for EA4.
cause you guys have some much resources and time to make it right, but you always fail, and miss every new technology, always step behind...
while its only betabut think this way you have it now is not good approach.
- no chroot?? even in beta, really?
you will have a lot of work to make it right, this is why its not available now...
- only one php-fpm config file? it grabs all the fpm pool configs?? this is a huge security flaw.
php-fpm: master process (/opt/cpanel/ea-php70/root/etc/php-fpm.conf)
- creating master systemd service file? probably file must be in /etc/systemd/system/?
/usr/lib/systemd/system/ea-php70-php-fpm.service
- nameless socket and stored in root folder? it must be created in folder with its user name. and it must have user name so it will be easy to debug many issues.
/opt/cpanel/ea-php70/root/usr/var/run/php-fpm/31af0b71da8ad5e80e86ed883b85b2d83aadb2e5.sock
/opt/cpanel/ea-php70/root/usr/var/run/php-fpm/8fae611e8e6fc1fe96639813de15fd64621324e6.sock
/opt/cpanel/ea-php70/root/usr/var/run/php-fpm/c288a9f521f815ca6697f73faef0799951fcb9b7.sock
- apache log and php-fpm log in different folders??
/etc/apache2/domlogs/
/home/demo/logs/
and lots of other issues...
anyway lets talk about what we have now:
chroot - this is must have, and this is the only way to run php-fpm in multiuser shared environment. php-fpm must be crooted to user home folder. there will be some issues when you have another addon domain, projects in subfolders, etc
in nginx you can easily have master chroot folder but using "map" to dynamically map a document_root into variable and pass it to php-fpm the way you need it.
without hardcoding it in php-fpm pool.
so i guess in cpanel maybe you must have config in:
then every cpanel account must have its own php-fpm.conf file, to run its own pool config from it.
first of all - opcache sharing is very dangerous and it brings lots of errors.
then imagine a situation when server is running with 1000 e-commerce accounts and someone made a typo in one of the pool configs. php-fpm wont be able to restart and all accounts are also down. this is a big NO.
i do not want losing clients because of this.
so php-fpm.conf file must be created as:
for every user account there must be its own service file, for example:
and it will call its own php-fpm-{cpaneluser}.conf with its own pid, logs, settings and paths, this will call its own pool config file {cpaneluser}.conf
when i call opcache from one account i can see this:
all logs must be in one location per user account/domain.
i guess you have some idea.
im working with one company that manages our cpanel servers, they have modified it to run with php-fpm for EA3, im pushing them to do some modifications for EA4.
cause you guys have some much resources and time to make it right, but you always fail, and miss every new technology, always step behind...
i just noticed that MPM Event is not used when switching to php-fpm.
will it be fixed somehow?
you have to understand that this is not only opcache issue there.
i still could not test any chroots or jails, even after touching this file /var/cpanel/feature_toggles/apachefpmjail
what exactly should happen?
i just noticed that MPM Event is not used when switching to php-fpm.
will it be fixed somehow?
you have to understand that this is not only opcache issue there.
i still could not test any chroots or jails, even after touching this file /var/cpanel/feature_toggles/apachefpmjail
what exactly should happen?
Thank you, thank you, thank you to everyone (especially sparek-3 and backblaze) that's been providing feedback here. There's been some discussion around it, and both Matt and Ken have been taking a look. I know we haven't been as vocal as I'd like, but we're definitely taking your feedback into account. As soon as there's anything firm to share here, we'll let you know!
Thank you, thank you, thank you to everyone (especially sparek-3 and backblaze) that's been providing feedback here. There's been some discussion around it, and both Matt and Ken have been taking a look. I know we haven't been as vocal as I'd like, but we're definitely taking your feedback into account. As soon as there's anything firm to share here, we'll let you know!
Hey everyone! Version 60 just went to CURRENT. We're still discussing many of the concerns that were brought up here, but haven't acted on them (as far as I know). If you want to see specific things added to this feature, definitely submit feature requests for them! If you have any questions feel free to email me.
Hey everyone! Version 60 just went to CURRENT. We're still discussing many of the concerns that were brought up here, but haven't acted on them (as far as I know). If you want to see specific things added to this feature, definitely submit feature requests for them! If you have any questions feel free to email me.
Replies have been locked on this page!