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)