Nginx + php-fpm High concurrency configuration (also includes part of APACHE/HTTPD)

Source: Internet
Author: User
Tags connection reset

FPM with PHP.ini (/etc/php5/fpm/php.ini), it is important to not change the security loopholes.

Cgi.fix_pathinfo=0

Remove anti-SYN flood attacks (high concurrency will actively clog Apache requests resulting in AB test under Apr_socket_recv:connection reset by Peer (104))

Reference: http://xmarker.blog.163.com/blog/static/226484057201462263815783/

Vi/etc/sysctl.conf

Net.ipv4.tcp_syncookies=0

See Ulimit number

Ulimit-sn

Ulimit Plus to 30000 +

How to modify your own Baidu, different Linux distributions seemingly not the same

Nginx.conf under Change

Worker_processes 12;

Worker_rlimit_nofile 100000;

Events {

Use epoll;

Worker_connections 65535;

}

PHP-FPM's sock mode is unreliable, and a tall one can collapse.

Php-fpm.conf (or www.conf)

Change to listen = 127.0.0.1:9000, do not use listen =/var/run/php5-fpm.sock

Process.max = 65536 (this seems useless)

PM under 4, change a little, according to a process accounted for 30M of memory calculation.

Pm.max_requests = 50000 (this seems useless)

Nginx Web server configuration under Select

Fastcgi_pass 127.0.0.1:9000;

Nginx + php-fpm High concurrency configuration (also includes part of APACHE/HTTPD)

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.