How to test Nginx's high performance

Source: Internet
Author: User
Tags epoll

Brief introduction

Nginx ("Engine X") is a high-performance HTTP and reverse proxy server, also a IMAP/POP3/SMTP proxy server;

As a lightweight Web server, with less memory, concurrency and other advantages, is high-connection concurrency scenario Apache Good alternative;

This article mainly introduces Nginx as a Web server, compared to the performance advantages of Apache;

The next article will introduce Nginx as the direction of the proxy server implementation;


Important Features

Non-blocking: During data replication, the first phase of disk I/O is non-blocking;

Event-driven: The communication mechanism uses the EPOLL model to support larger concurrent connections;

Master/worker structure: A master process that generates one or more worker processes;


Infrastructure architecture

How Nginx achieves high concurrency:

The I/O model employs an asynchronous, non-blocking event-driven mechanism that processes multiple prepared events, such as the epoll mechanism, from a process.

The difference between Nginx and Apache for high concurrency processing:

For Apache, each request will have a single worker thread, and when the concurrency increases, it will also produce a large number of worker threads, resulting in a sharp increase in memory consumption, while the context switch of the thread will also lead to higher CPU overhead, resulting in severe performance degradation in high concurrency scenarios;

For Nginx, a worker process has only one main thread, and through event-driven mechanism, it realizes the cyclic processing of multiple prepared events, thus achieving lightweight and high concurrency;


Deployment Configuration

Installation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Yum-y Groupinstall "Development tools" Yum-y Groupinstall "Server Platform Development"

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.