Nginx concurrent access Optimization
The strength of Nginx reverse proxy concurrency directly affects the system stability. During Nginx installation, the default configuration does not involve too many concurrent parameters. As a product running, you have to consider these factors. As a product running, Nginx is officially recommended to be deployed to the Linux64-bit system. Based on this suggestion, this article will consider the Nginx concurrency optimization from the system line.
1. Enable epoll support in Linux
Epoll support can greatly increase the number of system network I/O concurrency.
2. Linux File handle count limit
During the Nginx proxy process, the request data of the Business Server is cached to a local file, and then the file data is forwarded to the request client. High-concurrency client requests must limit the concurrent opening of Server File handles.
Use the ulimit command to view the Linux system file handle concurrency restrictions.
$ Ulimit-n
1024
In Linux, the default value is 1024. We need to set this value to 65535.
Modify the system file/etc/security/limits. conf, add the following information, and restart the system to take effect.
* Soft nofile 65535
* Hard nofile 65535
$ Sudo vi/etc/security/limits. conf
3. Add file restrictions and connection information to the Nginx configuration file.
Worker_rlimit_nofile 65535;
Events {
Use epoll;
Worker_connections 65535;
}
The number of Nginx concurrencies is limited, which usually results in 502 errors. The above operations can be solved in general.
-------------------------------------- Split line --------------------------------------
Deployment of Nginx + MySQL + PHP in CentOS 6.2
Build a WEB server using Nginx
Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Performance Tuning for Nginx in CentOS 6.3
Configure Nginx to load the ngx_pagespeed module in CentOS 6.3
Install and configure Nginx + Pcre + php-fpm in CentOS 6.4
Nginx installation and configuration instructions
Nginx log filtering using ngx_log_if does not record specific logs
-------------------------------------- Split line --------------------------------------
Nginx details: click here
Nginx: click here
This article permanently updates the link address: