I saw that fastcgi_pass
in other people’s nginx
configuration is unix:/tmp/php-cgi.sock
But my configuration is 127.0.0.1:9000
(not talking about load balancing, just the simplest oneserver
)
unix:/tmp/php-cgi.sock
and 127.0.0.1:9000
?
I see in my
php-fpm.conf
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
listen
to /tmp/php-cgi.sock
?
Well, unix socket will be faster and does not use the network
In addition, it is better to put it in the /tmp directory than to put it in the memory
I usually put it in /dev/shm/php-fpm.sock
Put it in the memory and read it faster
Theoretically, unix socket will be faster if it does not go through the network,
However, the stability is not so ideal,
Someone has done the test here, you can refer to it
http://blog.csdn.net/liv2005/article/details/7741732