This article is a mirror article of machine translation, please click here to jump to the original article.

View: 438|Reply: 1

The Nginx reverse proxy php-fpm uses UDS to communicate

[Copy link]
Posted on 2025-9-16 17:08:19 | | | |
Requirements: nginx reverse proxy to php-fpm processing, communication uses TCP protocol, how to use more efficient UDS for communication?
.NET/C# processes communicate between gRPC and Unix domain sockets
https://www.itsvse.com/thread-11051-1-1.html

For single-server deployments or when the web server and PHP-FPM are on the same machine: Unix domain sockets are often preferred due to their performance and security benefits. Because UDS avoids the overhead of the TCP/IP protocol stack, it reduces data replication and context switching, making it more efficient. In real-world tests, using UDS can typically increase throughput by 10%~30% with lower latency.

First, modify the php-fpm configuration, for example:www.conffile, configured as follows:

If you have a php-fpm container running on docker,UDS may not take effectThe reason is because zz-docker.conf overwrites our configuration, and the modification is as follows:

Dockerfile:The hyperlink login is visible.

At the same time, when starting the container, the UDS is mapped and increased-v /data/phprun:/var/runParameter.



The first letter is s to indicate that this is a socket file (i.e. UDS)

nginx is modified as follows:

Reference:The hyperlink login is visible.




Previous:ICBC card (debit card) expiration solution
Next:Nginx reverse proxy ASP.NET Core use UDS communication
 Landlord| Posted on 2025-9-18 10:37:21 |
Nginx reverse proxy ASP.NET Core use UDS communication
https://www.itsvse.com/thread-11069-1-1.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com