Isolated PHP-FPM adoption

sparek

Verified User
Joined
Jun 27, 2019
Messages
586
I'm curious as to how many DirectAdmin server administrators are using the Isolated PHP-FPM setup that became available in DirectAdmin 1.690 (early December 2025)?

I had reservations about this when it was announced and wanted to wait a while to see what issues popped up. I'm mostly concerned about the additional memory requirements that would be necessary to run a large amount of users with their own php-fpm master configuration. By my own accounts, it looks like an idle php-fpm master process is going to consume right at 20MB of memory. That might not seem like a lot, but for 200 users that's 4GB just to idle. 600 users it's 12GB - again, just idling.

But the lack of discussions on this topic would seem to indicate that a) A lot of administrators aren't using the setup b) the setup is working flawlessly with no issues or c) administrators that have this enabled have very few users on their servers and/or a lot of free RAM.

If I'm understanding how DirectAdmin does this setup (which I may have wrong), you can check the memory usage of an idle PHP by doing at:

systemctl status php-isolated-fpm84@%username%.service

for a user on the server that has no running PHP pool processes (whatever PHP version they are using). It will show how much memory an idle php-fpm master is using. Multiply this by the number of users on the server and that's how much memory is consumed just to hold idle php-fpm master processes for each user.

Maybe it's not as big of an issue as I would think.

I'm considering implementing something similar to this on our servers, but the memory constraints still bug me.

I'm just wondering how many server administrators are using this? How many ballpark users do you have on your servers? (less than 100? 200? 500? 1000?) and are you seeing any memory capacity issues?
 
If user have multiple site and high concurrent usage, 1service could go around 500mb-1gb, or their site get DDOS, then service might go 2-3gb.

So if enable this, ensure enable resource limits on every user to prevent consume memory from bad traffic.

But either nginx/apache already have limits traffic proxy to PHP-FPM sockets, just enable resource limits. Is good idea to prevent the memory crashing.


p.s. all user might not consume high usage at the same time, so it's safe enough if you have memory around 64gb.
 
The isolated FPM services are using systemd socket activation. The systemd will start PHP-FPM service only when there is connection from the webserver to the FPM socket. The master FPM process is patched to exit if idle for more than 10 minutes. This means completely idle websites will consume no additional memory at all.

Our long term goal is to make the Isolated FPM the default PHP integration mode and deprecate the Apache fcgi mode.
 
When I experimented with this, I tried systemd socket activation but didn't have a lot of luck. I finally got it working, but the php-fpm socket hand off was slow and if the pool worker was allowed to die, systemd had trouble restarting it.

That's what lead me to believe that you had to have a running systemd php-fpm master for every user, even if it didn't have any pool workers.

Does the DirectAdmin systemd socket activation work with AlmaLinux 8? In some of the research stated that systemd socket activation was somewhat problematic in AlmaLinux 8 (actually I think it said RHEL8, but tomato... tomahto).

If systemd socket activation is working, then that would seem to answer some of these concerns.
 
Back
Top