MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Development => Topic started by: fossxplorer on 2016-10-05, 15:04:39

Title: PHP-FPM separation for clients
Post by: fossxplorer on 2016-10-05, 15:04:39
Hi Mustafa,
can you take a look at https://ma.ttias.be/a-better-way-to-run-php-fpm/.

Often, there is some issues and i need to run fixphp or reload PHP-FPM service, but it affects all clients right?
Also, there are no sepration of APC/OPcache which is a must for us to use.

Can you plan implementing what's suggested here?
Title: Re: PHP-FPM separation for clients
Post by: MRatWork on 2016-10-05, 15:10:14
No options just restart php-fpm per-user. So, change something in php-fpm configs need restart.

As I know, php module (like apc or other) only possible per-version. So, impossible apc disable for userA but enable for userB.
Title: Re: PHP-FPM separation for clients
Post by: fossxplorer on 2016-10-05, 15:27:43
Will a fixphp --client=client1 only restart client1's php-fpm process and not touch other client's PHP-FPM processes?

APC/OPCache : It's not about enabling and disabling on per user basis, but about separating their memory space due to security.


Another important thing Mustafa, PLEASE READ https://bugs.php.net/bug.php?id=69724 and switch to DYNAMIC until this bug is fixed! We have issues related to this as in our cloud hosting syncing uses multiple request at same time!

No options just restart php-fpm per-user. So, change something in php-fpm configs need restart.

As I know, php module (like apc or other) only possible per-version. So, impossible apc disable for userA but enable for userB.
Title: Re: PHP-FPM separation for clients
Post by: MRatWork on 2016-10-05, 16:33:22
Please googling about how to php-fpm work.
Title: Re: PHP-FPM separation for clients
Post by: fossxplorer on 2016-10-06, 13:09:07
Mustafa, please please pay attention to what i post/suggest.
I've been using PHP-FPM for quite some time now and long before i started to use Kloxo-MR.
Let me know if you think i've overseen something though :)

So 2 major points with this thread is:
-  shared APC (possible APCu) and OPCache: it's a security issue in shared environment since the caches are SHARED AMONG ALL PHP-FPM pools.
- We SHOULD NOT USE ONDEMAND as the PHP-FPM process manager as there is a BUG:
The FPM pm.ondemand process manager has a subtle bug in the way it uses edge-triggered polling (with epoll() or kqueue()) that causes it not to notice when multiple requests arrive at the same time, and thus not to fork the appropriate number of children to handle them.


If you don't change to DYNAMIC, i'll have to do it in my custom config files as we can't live with this bug.
Our clients mostly sync data and it's done in parallell requests.
Of course when the bug is fixed, it's very good choice of going back to ONDEMAND since that will fit a shared hosting server better :)


Please googling about how to php-fpm work.
Title: Re: PHP-FPM separation for clients
Post by: MRatWork on 2016-10-06, 13:41:10
Think php 5.5 and 5.6 already fix this issue because both versions still mantained by php.net.
Title: Re: PHP-FPM separation for clients
Post by: MRatWork on 2016-10-06, 16:33:40
Did you check 'admin > advanced php configure' (example for admin) for change 'php-fpm type'?