Ich habe das von jemand anderem gesehennginx
配置中 fastcgi_pass
是unix:/tmp/php-cgi.sock
Und meine Konfiguration ist 127.0.0.1:9000
(不討論負(fù)載均衡什么的,就是最簡單的一個server
)
unix:/tmp/php-cgi.sock
和127.0.0.1:9000
Was ist der Unterschied zwischen den beiden?
Ich habephp-fpm.conf
in meinem
; 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
的配置修改為/tmp/php-cgi.sock
? 嗯,unix socket會更加快一點(diǎn),不走網(wǎng)絡(luò)
另外放在/tmp目錄不如放在內(nèi)存里面
我一般放在 /dev/shm/php-fpm.sock
放在內(nèi)存讀取速度快更快的
理論上,unix socket不走網(wǎng)絡(luò),會快些,
可是,穩(wěn)定性就不那么理想了,
這里有人做過測試,你可以參考
http://blog.csdn.net/liv2005/article/details/7741732