Nginx concurrent access Optimization

Source: Internet
Author: User

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:

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.