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

Java知识分享网

Java1234官方群25:java1234官方群17
Java1234官方群25:838462530
        
SpringBoot+SpringSecurity+Vue+ElementPlus权限系统实战课程 震撼发布        

最新Java全栈就业实战课程(免费)

AI人工智能学习大礼包

IDEA永久激活

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

锋哥开始收Java学员啦!

Python学习路线图

锋哥开始收Java学员啦!
当前位置: 主页 > 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:



 

 
 

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

锋哥公众号


锋哥微信


关注公众号
【Java资料站】
回复 666
获取 
66套java
从菜鸡到大神
项目实战课程

锋哥推荐