nginx infrastructure

WBOY
Release: 2016-07-29 09:09:12
Original
879 people have browsed it

Key constraints in web server design

  1. Performance
    1. Network performance
    2. Latency per request
    3. Network efficiency
  2. Scalability
  3. Simplicity
  4. Modability
  5. Visibility
  6. Portability
  7. Reliability

Nginx’s architectural design

  1. Modular design
    A high degree of modular design is the architectural foundation of Nginx. Except for a small amount of core code, everything else is a module.
    Features:
    1. Highly abstract module interface
    2. Module interface is very simple and has high flexibility
    3. Design of configuration module
    4. Simplification of core module interface
    5. Multi-level, multi-category module design
  2. Event-driven architecture
    Events are generated by some event sources and collected and distributed by one or more event collectors. Then many event processors will register the events they are interested in and "consume" these events.

  3. Multi-stage asynchronous processing of requests
    Multi-stage asynchronous processing of requests can only be implemented based on event-driven architecture.
    Divide a request processing process into multiple stages according to the event triggering method, and each stage can be triggered by event collectors and distributors.

  4. Management process, multi-work process design
    Nginx adopts a design method of one master management process and multiple worker processes.
    Advantages of this design:
    1. Utilize the concurrent processing capabilities of multi-core systems
    2. Load balancing
    3. The management process will be responsible for monitoring the status of the worker process and managing its behavior
  5. Platform-independent code implementation
    Implemented in C language, try to minimize the use of code related to the operating system platform.
    Nginx re-encapsulates logs, various basic data structures, common algorithms and other tool software.
    The core code is implemented using code that is independent of the operating system, and system calls related to the operating system have independent implementations for each operating system.

  6. Memory pool design
    Consolidating multiple operations of requesting memory from the system into one operation greatly reduces the consumption of CPU resources and reduces memory fragmentation.

  7. HTTP filtering module using unified pipeline filter mode

  8. Some other user modules

    The core structure ngx_cycle_t in the Nginx framework

').addClass('pre-numbering').hide( ); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above has introduced the Nginx infrastructure, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template