LNMP use socket to connect Nginx optimize PHP-FPM performance
There are 2 ways to connect fastcgi nginx: TCP and UNIX domain sockets
What is a UNIX domain socket. --Wikipedia
A Unix domain socket or an IPC socket is a terminal that enables data communication between two or more processes on the same operating system. Compared to pipelines, Unix domain sockets can use both byte streams and data queues, while pipe traffic can only be accessed by byte streams. The Unix domain sockets interface is similar to the Internet socket, but it does not communicate using the network underlying protocol. The Unix domain socket function is a component of the POSIX operating system.
Unix domain sockets uses the address of the system file as its own identity. It can be referenced by the system process. So two processes can open a UNIX domain sockets to communicate at the same time. However, this mode of communication occurs in the kernel of the system and does not spread through the network.
Configuration method to change TCP to socket mode:
1, modify the PHP-FPM configuration file (if it is compiled installation may be/etc/php-fpm, depending on the specific circumstances)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.