Unix domain socket seems to be much better than TPC for the communication protocol between NginX and PHP-FPM so I changed the config of them like this.
$ vi /etc/php-fpm-5.6.d/www.conf
; listen = 127.0.0.1:9000 listen = /var/run/php-fpm/php-fpm-5.6.sock listen.mode = 0660
$ vi /etc/nginx/conf.d/cookstar.conf
# fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php-fpm/php-fpm-5.6.sock;
After changed the config of them, we need restart the processes. At the timing we restart PHP-FPM, php-fpm-5.6.sock is generated.
$ service php-fpm-5.6 restart $ service nginx restart
Then I confirmed it communicates via Unix domain socket.
$ netstat -a --unix unix 2 [ ACC ] STREAM LISTENING 1441769 /var/run/php-fpm/php-fpm-5.6.sock
0 Comments:
Post a Comment