Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't set nginx and php-fpm as socket by default #5

Open
kintaro1981 opened this issue Jan 16, 2018 · 5 comments
Open

can't set nginx and php-fpm as socket by default #5

kintaro1981 opened this issue Jan 16, 2018 · 5 comments

Comments

@kintaro1981
Copy link

Debian 8
php 5.6.33
php-fpm
Webmin version 1.872
Virtualmin version 6.02 (upgraded from 5.99)

In Features and Plugins => Nginx website => Manage I set "socket" as in Connect Nginx to PHP processes with... but when I create a new virtualserver the connection is TCP. In templates I can't see nothing about socket/tcp connection.

I'm missing some other configuration page to have Socket as a default connection between nginx and php-fpm? ...or is a bug?

p.s. I'm using the virtualmin-nginx version 2.2 because of this issue... but in Features and Plugins page it says that the version is 2.3 (maybe it didn't update during the downgrade?)

@jcameron
Copy link
Collaborator

If you're in FPM mode, only TCP sockets are supported. That option only takes effect in FCGId mode. We ended up taking this route because there were compatability issues with socket files on some systems, and it was easier just to be consistent.

@kintaro1981
Copy link
Author

Thank you, Cameron.

So I have to manually configure templates to activate by default sockets to test if my system has issues with them?

I have to use: "Additional FPM pool options" inside Server Templates=> PHP Options?

I suggest you to add a warning in virtualmin configurations pages about the impossibility to use sockets with FPM so other users will be warned about it without searching a solution inside VM itself!

p.s. with PHP7.0 and FPM sockets are supported or it have the same issues of 5.6.x?

@jcameron
Copy link
Collaborator

Is there a particular reason you prefer socket files for FPM?

@binaryfire
Copy link

binaryfire commented Mar 13, 2019

EDIT: After some more reading, it seems sockets don't scale as well (concurrency-wise) as TCP. Seems socket errors under high loads are a thing and are resolved by switching to TCP. So maybe better to leave it as is...

Hi Jamie

The reason is that using unix sockets are faster than using TCP since the TCP stack is bypassed completely (less overhead).

http://momjian.us/main/blogs/pgblog/2012.html#June_6_2012
https://stackoverflow.com/questions/257433/postgresql-unix-domain-sockets-vs-tcp-sockets/257479#257479

For this reason, it would be great if the "connect via sockets / TCP" option was available for PHP-FPM. Would it be possible to add it?

PS. Also wondering whether there's any reason the php-fpm.d/ conf files and var/run/ sock files couldn't just use the virtual server's domain name instead of the site ID number? Would definitely make seeing what's going on more intuitive

@jcameron
Copy link
Collaborator

The reason the socket files are named after the domain ID is that it never changes, but a domain can be renamed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants