• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved 503 on one domain

KarlmitC

New Pleskian
Hello everyone,

My problem is that one of my domains is just not starting/is having a 503 error.
I already tried to restart everythin etc but it didn't help.
When I tried to reapply the hosting settings I got an error with the PHP configuration which says that the plesk-php71-fpm.service failed.
When I ran the command to get the status I get the following:

Code:
plesk-php71-fpm.service: Start request repeated too quickly.
Failed to start The PHP 7.1.2 FastCGI Process Manager.

Does anybody know how to solve that?
 
I looked into the plesk-php71-fpm logs and got "server reached max_children setting (5)".
But that's given only for one of my subdomains which is working.
Only my main domain isn't working...
 
Last edited:
Hi KarlmitC,

Failed to start The PHP 7.1.2 FastCGI Process Manager.
It indicates, that your choosen PHP-FPM - service ( Plesk-PHP-FPM-7.1.2 ) isn't up and not working. You could check this with the following command over your command line ( logged in as user "root" ):

service plesk-php71-fpm status
 
... and once that is solved, for the "max_children" setting that is too low for your website, try custom values like pm.max_children=25 and pm_max_requests=10000.

# touch /var/www/vhosts/system/DOMAIN.TLD/conf/php.ini
# echo -e "[php-fpm-pool-settings]\npm.max_children = 25\npm.max_requests = 10000\n" > /var/www/vhosts/system/DOMAIN.TLD/conf/php.ini
# /usr/local/psa/bin/domain --update-php-settings DOMAIN.TLD
 
Hi KarlmitC,


It indicates, that your choosen PHP-FPM - service ( Plesk-PHP-FPM-7.1.2 ) isn't up and not working. You could check this with the following command over your command line ( logged in as user "root" ):

service plesk-php71-fpm status
Yes, the process/service is not running.
Code:
plesk-php71-fpm.service: Start request repeated too quickly.
Failed to start The PHP 7.1.2 FastCGI Process Manager.
But after manually starting the service again every domain but the main domain isn't working.
 
Hi KarlmitC,

you might be confronted with a current bug ( pls. see as well: => https://support.plesk.com/hc/en-us/...iles-are-downloaded-instead-of-being-executed ), but for Plesk Onyx, Plesk provides as well a temporary "custom fix" ( at the very same KB - article ), untill the bug is completely fixed.
Thanks, that worked.
And just a another question regarding that max_children. Is the way described above the right one, because I don't even have the directory conf in the directory of my domain. And is it enough if I do that for the main domain or do I have to apply that for every subdomain and if yes, how would I do that?
 
Hi KarlmitC,

I'm glad that the custom fix worked for you, regarding the "too quickly" service starts. ;)

And just a another question regarding that max_children. Is the way described above the right one, because I don't even have the directory conf in the directory of my domain. And is it enough if I do that for the main domain or do I have to apply that for every subdomain and if yes, how would I do that?

I think that @Peter Debik will respond shortly to your additional questions, regarding the (sub)domain - modifications of "pm.max_children" and "pm.max_requests" for the "php-fpm-pool-settings".
 
Is the way described above the right one, because I don't even have the directory conf in the directory of my domain.
Check the command line again: "# touch /var/www/vhosts/system/DOMAIN.TLD/conf/php.ini" -> The /conf directory is not descending from your subscription home directory, but from /vhosts/system. You cannot see that directory from within the subscription. In order to do the extra PHP FPM setting you need to login via SSH to your Linux console with root privileges and apply the commands from there.

And is it enough if I do that for the main domain or do I have to apply that for every subdomain and if yes, how would I do that?
You need to do this for every domain or subdomain that you provide webspace for separately. This is for you can set the PHP attributes for each domain and subdomain separately, including PHP FPM settings. Use the same method as for the main domain, but instead of the main domain, enter the subdomain. Example:
# touch /var/www/vhosts/system/SUB.DOMAIN.TLD/conf/php.ini
# echo -e "[php-fpm-pool-settings]\npm.max_children = 25\npm.max_requests = 10000\n" > /var/www/vhosts/system/SUB.DOMAIN.TLD/conf/php.ini
# /usr/local/psa/bin/domain --update-php-settings SUB.DOMAIN.TLD
 
# touch /var/www/vhosts/system/SUB.DOMAIN.TLD/conf/php.ini
# echo -e "[php-fpm-pool-settings]\npm.max_children = 25\npm.max_requests = 10000\n" > /var/www/vhosts/system/SUB.DOMAIN.TLD/conf/php.ini
# /usr/local/psa/bin/domain --update-php-settings SUB.DOMAIN.TLD

First of all, thank you a lot for explaining that.
I found everything but my last question would be now, whether or not the example values you gave are really usable or not and if there's like a way to calculate those values (like this one: https://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/).
And should I change the values
Code:
pm.start_servers
pm.min_spare_servers
pm.max_spare_servers
as well?
 
Last edited:
Unfortunately all these values depend on the actual load of the server, the amount of RAM you have, the CPU power, the number of requests made to a website, the number of concurrent requests and the runtime of the scripts that requests execute. The Plesk default value is 5 max_children and too low for most applications, but set so low probably because it ensures that on small virtual servers it is a reasonable value. 25 children should not be a big deal for many servers, and the number of max_requests only determines, how long a child stays alive. The number of children determines, too, how much RAM is set aside. The number of spare_servers can be high, if the server is expecting many requests, and it should not be too high, because too many processes clog the CPU. There is no formula to determine perfect values. More spare_server make starting a script faster, but they also use more resources for nothing, if no requests need to be handled.
 
Back
Top