In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the role of Nginx in the architecture". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the role of Nginx in the architecture"?
A brief introduction to Nginx
Nginx is a very lightweight HTTP server written by Russians, Nginx, pronounced "engine X", is a high-performance HTTP and reverse proxy server, but also an IMAP/POP3/SMTP proxy server.
Nginx is famous for its stability, rich module library, flexible configuration and low consumption of system resources. The industry agrees that it is a lightweight replacement for Apache2.2+mod_proxy_balancer, not only because it responds very quickly to static pages, but also because its number of modules is nearly 2 prime 3 of Apache. The support for proxy and rewrite modules is very thorough, and it also supports mod_fcgi, ssl and vhosts, which is suitable for the front-end HTTP response of mongrel clusters.
At present, Nginx is applied in many large domestic enterprises, and the popularization rate is increasing year by year. The reason for choosing Nginx is also simple:
First, it can support 5W high concurrent connections.
Second, low memory consumption
Third, the cost is low.
The role of Nginx in the architecture:
Gateway
-the general entrance to the customer.
Virtual host
-one machine provides services for different domain names / ip/ ports
Routin
-use reverse proxy to integrate follow-up services into a complete business
Static server
-mvvm mode, used to publish front-end html/css/js/img
Load cluster
-use upstream to load multiple tomcat
II. Characteristics of Nginx
Compared with other web servers, Nginx features:
1. High speed
Nginx uses pre-read, connection pooling, memory pooling and other technologies to make a single HTTP request faster.
2. Good expansibility
The structure of Nginx is a "core + module" structure, and Nginx itself is an event handling and distribution architecture for Epool or Kqueue, which we will talk about later.
3. High reliability
The core of Nginx consists of a light management process (master process) and several working processes (worker process). Specific HTTP requests are load balanced within the worker process. If a worker process terminates abnormally, the management process will quickly restart a new worker process to replace that process.
4. Low memory footprint
In general, 10000 inactive HTTP active connections take up only 2.5MB memory. For every 10000 connections expanded by ngx_lua, it only takes up 2.xMB memory.
5. High concurrency
Deployed in situations above the 10,000 level.
The idea of Nginx fully asynchronous and non-blocking IBG O is carried out in the core, module and ngx_lua module. No matter the module implemented by itself or the script code implemented through lua, it runs at a high speed without blocking.
6. Hot deployment
Because the management process and worker process of Nginx are designed separately, the hot deployment function can be implemented. That is, the system is uninterrupted to upgrade the executable program, update the configuration file, update the log.
7. Open source
III. Nginx architecture design
Highly modular design is the architectural foundation of Nginx. The Nginx server is decomposed into multiple modules, each of which is
A functional module is only responsible for its own functions, and the principle of "high cohesion, low coupling" is strictly followed between modules.
Nginx module diagram
Core module
The core module is an essential module for the normal operation of the Nginx server, providing error logging, configuration file parsing,
Core functions such as event-driven mechanism and process management.
Standard HTTP module
The standard HTTP module provides functions related to HTTP protocol parsing, such as port configuration, web page coding settings, HTTP.
Response head setting and so on.
Optional HTTP module
The optional HTTP module is mainly used to extend the standard HTTP functions so that Nginx can handle some special services, such as:
Flash multimedia transmission, parsing GeoIP requests, SSL support, etc.
Mail service module
The mail service module is mainly used to support Nginx mail services, including POP3 protocol, IMAP protocol and
Support for SMTP protocol.
Third-party module
The third-party module is designed to extend Nginx server applications and complete developer-defined functions, such as Json support, Lua
Support, etc.
Thank you for your reading, the above is the content of "what is the role of Nginx in the architecture". After the study of this article, I believe you have a deeper understanding of the role of Nginx in the architecture, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.