NGINX+PHP-FPM changed to socket mode.

Source: Internet
Author: User

Reference
http://xieminis.me/?p=216
But he's not clear about the authority.
There is no big difference between socket and TCP mode performance
http://blog.csdn.net/liv2005/article/details/7741732

/etc/php-fpm.d/www.conf

;listen = 127.0.0.1:9000    #注销原来的listen = /dev/shm/fpm-cgi.sock    #自动创建文件listen.owner=nginx    #nginx和apache权限listen.group=apachelisten.backlog = -1    #无限并发

Nginx Virtual Host configuration file

#fastcgi_pass 127.0.0.1:9000;    #注释掉fastcgi_pass unix:/dev/shm/fpm-cgi.sock;    #使用socket文件

When resolving unixsocket, a large number of HTTP code 502,11:resource temporarily unavailable issues
Add the following in the /etc/sysctl.conf

net.core.somaxconn = 2048

And then execute it in the terminal.

sysctl -p

Restart Nginx and PHP-FPM

Everybody's dancing clothes.

NGINX+PHP-FPM changed to socket mode.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.