I am running a nginx server to serve by PHP website in Alpine Linux. I see that nginx can connect to php-fpm process via either unix socket or host:port. Are there any practical and/or theoretical performance difference between these 2 methods?
Asked
Active
Viewed 2,877 times
0
-
2Typically a file system based socket is faster, since it cuts out the overhead required for the networking layer. Also it reduces the potential security vulnerabilities, since you do not have to open a port at all, which would have to be secured again afterwards. – arkascha Jul 24 '17 at 19:50
-
https://serverfault.com/questions/195328/unix-socket-vs-tcp-ip-hostport – Iłya Bursov Jul 24 '17 at 19:51
-
https://easyengine.io/tutorials/php/fpm-sysctl-tweaking/#using-tcpip-for-fpm – Iłya Bursov Jul 24 '17 at 19:51
-
Also worth a read: https://stackoverflow.com/questions/152457/what-is-the-difference-between-a-port-and-a-socket - think this might be most definitive answer. Perhaps close as dupe if you feel it answers your question. – ficuscr Jul 24 '17 at 19:55