Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

        
AI编程,程序员挑战年入30~100万高级指南 - 职业规划
SpringBoot+SpringSecurity+Vue权限系统高级实战课程        

IDEA永久激活

Java微信小程序电商实战课程(SpringBoot+VUe)

     

AI人工智能学习大礼包

     

PyCharm永久激活

66套java实战课程无套路领取

     

Cursor+Claude AI编程 1天快速上手视频教程

     
当前位置: 主页 > Java文档 > Java基础相关 >

Nginx High Performance PDF 下载


时间:2025-07-18 18:20来源:http://www.java1234.com 作者:转载  侵权举报
Nginx High Performance
失效链接处理
Nginx High Performance PDF 下载

 
 
相关截图:
 


主要内容:
 


The NGINX architecture
NGINX has its foundation in event-based architecture (EBA). In EBA, components 
interact predominantly using event notiffcations instead of direct method calls. These 
event notiffcations, occurring from different tasks, are then queued for processing 
by an event handler. The event handler runs in an event loop, where it processes an 
event, de-queues it, and then moves on to the next event. Thus, the work executed by 
a thread is very similar to that of a scheduler, multiplexing multiple connections to a 
single ffow of execution. The following diagram shows this:
When compared with the thread-based architecture, EBA gives better performance 
output. In EBA, there are a ffxed number of threads performing tasks and no new 
threads are formed. Thus, we achieve better utilization of the CPU and an improved 
memory footprint. There is also no overhead of excessive context switching and 
no need for a thread stack for each connection. Ideally, the CPU becomes the only 
apparent bottleneck of an event-driven application.
NGINX runs one master process and several worker processes. The master process 
reads/evaluates the conffguration and maintains the worker processes. All request 
processing is done by the worker processes. NGINX does not start workers for every 
request. Instead, it has a ffxed pool of workers for request processing. Each worker 
accepts new requests from a shared listen queue. The worker then uses the available 
event-notiffcation interfaces, such as epoll and kqueue, to process each connection 
in an efffcient event loop. The idea is to optimize the utilization of the server's 
resources using nonblocking/asynchronous mechanisms when possible. By doing 
so, each worker is able to process thousands of connections. The following diagram 
shows this:



 

 
 

------分隔线----------------------------


锋哥推荐