• 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

last_nginx.conf and php-fpm.sock issues

theoc31

New Pleskian
Hi there,

I spent hours researching how I could change nginx to use TCP/IP rather than a unix socket to connect to PHP-FPM.
In /etc/nginx/nginx/conf (global) I could see that this configuration was indeed set but noticed in the error_logs for nginx, that any domain (i.e. vhost) was still using unix sockets causing connectivity issues (slow page loading when ~100 concurrent users).

So I went to /var/www/vhosts/xxxx/conf/last_nginx.conf and noticed that the file is auto-generated and contains
Code:
fastcgi_pass "unix:/var/www/vhosts/system/xxxx/php-fpm.sock";
which is the issue! It was stopping any vhost from using the TCP/IP connection rather than a unix socket.

I tried placing
Code:
 fastcgi_pass    127.0.0.1:9000;
into the Plesk web panel (i.e. the Web Settings NGINX directives) but it wouldn't accept it to override the Plesk generated config.

So I looked in /usr/local/psa/admin/conf/templates/ and tried to see if there was a nginx template but I can't see which file places the above line into the vhost configs.

Once I manually edited the "last_nginx.conf" I could have very large concurrent users on the my website. Is there a way to permanently edit this line?

Thanks,
Theo
 
Ok if there isn't any support or ideas from the Community is there a way I can submit this issue to Parallels?
As I think is a fundamental issue which needs to be resolved! It doesn't make sense the way it is set up currently limiting functional usage of Plesk and Nginx with PHP-FPM.
 
Hi,

I have same problem with this. My site has heavy load when making SOAP requests to a remote system for Magento product updating.

I have found that php-fpm pools are created from this script:

/usr/local/psa/lib/modules/python/phpinimng/phpinimng.py

At line 190 you can find:

[%(vhost)s]
; Don't override following options, they are relied upon by Plesk internally
prefix = %(vhosts_d)s/$pool
user = %(user)s
group = psacln

listen = php-fpm.sock <--- I want to change this to 127.0.0.1:9000
listen.owner = root
listen.group = psaserv
listen.mode = 0660

Ill give a try a night and let you know.
 
Did the following, but I dont expect it to survive after an update. Do it at your own risk and make backup of modified files. This is my custom php-fpm config for my needs, so it may not be suitable for your site. Read about it before changing mode and values.

Modified files:

usr/local/psa/lib/modules/python/phpinimng/phpinimng.py

;listen = php-fpm.sock
listen = 127.0.0.1:9000
listen.owner = root
listen.group = psaserv
listen.mode = 0660

; Following options can be overridden
chdir = /

; By default use ondemand spawning (this requires php-fpm >= 5.3.9)
;ORIGINAL SETTINGS START
;pm = ondemand
;pm.max_children = 5
;pm.process_idle_timeout = 10s
; Following pm.* options are used only when 'pm = dynamic'
;pm.start_servers = 1
;pm.min_spare_servers = 1
;pm.max_spare_servers = 1
;ORIGINAL SETTINGS END

pm = dynamic
pm.max_children = 16
pm.max_requests = 1500
request_terminate_timeout = 0
rlimit_files = 65536
rlimit_core = unlimited
catch_workers_output = no

/usr/local/psa/admin/conf/templates/default/domain/service/fpm.php

<?php
/**
* @var Template_VariableAccessor $VAR
*/
?>
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi.conf;


As we are using port 9000 for this php-fpm pool, we need to change that port for default pool

/etc/php-fpm.d/www.conf

listen = 127.0.0.1:9001
 
Back
Top