Nginx模块化

  • Nginx基于模块化设计,每个模块是一个功能实现,分布式开发,团队协作
  • 核心模块、标准HTTP模块、可选HTTP模块、邮件模块、第三方模块
  • 编译后的源码目录objs/ngx_modules.c
  • https://coding.net/u/aminglinux/p/nginx/git/blob/master/4z/module.md

objs文件是Nginx源码编译后产生的,在objs中的ngx_modules.c存放着相关模块,modules中的每行extern对应着一个模块,每个模块的信息可以在源码包中找到。

[root@localhost objs]# more ngx_modules.c

#include <ngx_config.h>
#include <ngx_core.h>

extern ngx_module_t ngx_core_module;
extern ngx_module_t ngx_errlog_module;
extern ngx_module_t ngx_conf_module;
extern ngx_module_t ngx_regex_module;
extern ngx_module_t ngx_events_module;
extern ngx_module_t ngx_event_core_module;
extern ngx_module_t ngx_epoll_module;
extern ngx_module_t ngx_http_module;
extern ngx_module_t ngx_http_core_module;
extern ngx_module_t ngx_http_log_module;
extern ngx_module_t ngx_http_upstream_module;
extern ngx_module_t ngx_http_static_module;
extern ngx_module_t ngx_http_autoindex_module;
extern ngx_module_t ngx_http_index_module;
extern ngx_module_t ngx_http_mirror_module;
extern ngx_module_t ngx_http_try_files_module;
extern ngx_module_t ngx_http_auth_basic_module;
extern ngx_module_t ngx_http_access_module;
extern ngx_module_t ngx_http_limit_conn_module;
extern ngx_module_t ngx_http_limit_req_module;
extern ngx_module_t ngx_http_geo_module;
extern ngx_module_t ngx_http_map_module;
extern ngx_module_t ngx_http_split_clients_module;
extern ngx_module_t ngx_http_referer_module;
extern ngx_module_t ngx_http_rewrite_module;
extern ngx_module_t ngx_http_proxy_module;
extern ngx_module_t ngx_http_fastcgi_module;
extern ngx_module_t ngx_http_uwsgi_module;
extern ngx_module_t ngx_http_scgi_module;
extern ngx_module_t ngx_http_memcached_module;
extern ngx_module_t ngx_http_empty_gif_module;
extern ngx_module_t ngx_http_browser_module;
extern ngx_module_t ngx_http_upstream_hash_module;
extern ngx_module_t ngx_http_upstream_ip_hash_module;
extern ngx_module_t ngx_http_upstream_least_conn_module;
extern ngx_module_t ngx_http_upstream_keepalive_module;
extern ngx_module_t ngx_http_upstream_zone_module;
extern ngx_module_t ngx_http_write_filter_module;
extern ngx_module_t ngx_http_header_filter_module;
extern ngx_module_t ngx_http_chunked_filter_module;
extern ngx_module_t ngx_http_range_header_filter_module;
extern ngx_module_t ngx_http_gzip_filter_module;
extern ngx_module_t ngx_http_postpone_filter_module;
extern ngx_module_t ngx_http_ssi_filter_module;
extern ngx_module_t ngx_http_charset_filter_module;
extern ngx_module_t ngx_http_userid_filter_module;
extern ngx_module_t ngx_http_headers_filter_module;
extern ngx_module_t ngx_http_copy_filter_module;
extern ngx_module_t ngx_http_range_body_filter_module;
extern ngx_module_t ngx_http_not_modified_filter_module;

Nginx的web请求机制

  • 并行处理:多进程、多线程、异步       高并发:异步非阻塞状态
  • https://coding.net/u/aminglinux/p/nginx/git/blob/master/4z/IO.md

Nginx事件驱动模型(是高并发,异步非阻塞的实现手段)

  • https://coding.net/u/aminglinux/p/nginx/git/blob/master/4z/event.md

设计架构概览

  • Nginx基于模块化设计、基于事件驱动模型处理请求、主进程和工作进程
  • https://coding.net/u/aminglinux/p/nginx/git/blob/master/4z/jg.md

Nginx架构分析(20200202)的更多相关文章

  1. nginx架构分析之 模块化

    Nginx涉及到的模块分为核心模块.标准HTTP模块.可选HTTP模块.邮件服务模块以及第三方模块等五大类. 核心模块 核心模块是指Nginx服务器正常运行时必不可少的模块,它们提供了Nginx最基本 ...

  2. nginx架构分析之 架构

    Nginx服务器使用 master/worker 多进程模式. 主进程(Master process)启动后,会接收和处理外部信号: 主进程启动后通过fork() 函数产生一个或多个子进程(work ...

  3. nginx架构分析之 事件驱动模型

    事件驱动模型 事件驱动模型是实现异步非阻塞的一个手段.事件驱动模型中,一个进程(线程)就可以了. 对于web服务器来说,客户端A的请求连接到服务端时,服务端的某个进程(Nginx worker pro ...

  4. ELK+redis搭建nginx日志分析平台

    ELK+redis搭建nginx日志分析平台发表于 2015-08-19   |   分类于 Linux/Unix   |  ELK简介ELKStack即Elasticsearch + Logstas ...

  5. 使用elk+redis搭建nginx日志分析平台

    elk+redis 搭建nginx日志分析平台 logstash,elasticsearch,kibana 怎么进行nginx的日志分析呢?首先,架构方面,nginx是有日志文件的,它的每个请求的状态 ...

  6. SLG手游Java服务器的设计与开发——架构分析

    微信公众号[程序员江湖] 作者黄小斜,斜杠青年,某985硕士,阿里 Java 研发工程师,于 2018 年秋招拿到 BAT 头条.网易.滴滴等 8 个大厂 offer,目前致力于分享这几年的学习经验. ...

  7. tomcat架构分析(connector BIO 实现)

    出处:http://gearever.iteye.com 在tomcat架构分析(概览)中已经介绍过,connector组件是service容器中的一部分.它主要是接收,解析http请求,然后调用本s ...

  8. 【转载】Instagram架构分析笔记

    原文地址:http://chengxu.org/p/401.html Instagram 架构分析笔记 全部 技术博客 Instagram团队上个月才迎来第 7 名员工,是的,7个人的团队.作为 iP ...

  9. 万字长文:ELK(V7)部署与架构分析

    ELK(7版本)部署与架构分析 1.ELK的背景介绍与应用场景 在项目应用运行的过程中,往往会产生大量的日志,我们往往需要根据日志来定位分析我们的服务器项目运行情况与BUG产生位置.一般情况下直接在日 ...

随机推荐

  1. ios--->cell里面 self 和self.contentview的区别

    一般我们向cell中添加子视图,有两种方式 [cell addSubview:] [cell.contentView addSubview:] 区别在于进行cell编辑时,比如cell内容向左移或者右 ...

  2. Docker底层架构之控制组

    概述 控制组(cgroups)是 Linux 内核的一个特性,主要用来对共享资源进行隔离.限制.审计 等. 只有能控制分配到容器的资源,才能避免当多个容器同时运行时的对系统资源的竞争. 控制组技术最早 ...

  3. 每天一道Java题[9]

    题目 native关键字的作用是什么? 解答 首先,需了解JNI(Java Native Interface),它是连接Java平台与本地C代码的一个API. 其次,用native关键字声明的方法,是 ...

  4. window nginx 中文路径, 文件名乱码问题解决

    window nginx 中文路径, 文件名乱码, error, not found 此问题是由于windows系统编码与nginx编码设置不一致导致的,因此我们要统一二者的编码 nginx编码设置 ...

  5. <背包>solution-CF118D_Caesar's Legions

    Caesar's Legions Gaius Julius Caesar, a famous general, loved to line up his soldiers. Overall the a ...

  6. 安装MySQL出现[Errno 256] No more mirrors to try

    今天安装数据库时出现错误提示,如下图: 解决办法如下: yum clean all #清除仓库缓存 yum makecache #将服务器包信息缓存到本地 然后再执行数据库安装指令 yum insta ...

  7. postgresql spi开发笔记

    #include "postgres.h" #include "fmgr.h" #include <string.h> #ifdef PG_MODU ...

  8. SpringBoot使用ELK日志收集ELASTIC (ELK) STACK

    1:资源 # 文档向导 # logstash https://www.elastic.co/guide/en/logstash/current/index.html #kibana https://w ...

  9. Go语言实现:【剑指offer】对称的二叉树

    该题目来源于牛客网<剑指offer>专题. 请实现一个函数,用来判断一颗二叉树是不是对称的.注意,如果一个二叉树同此二叉树的镜像是同样的,定义其为对称的. Go语言实现: 方法一:递归 / ...

  10. Coroutine 终止协程和异常处理

    终止协程和异常处理 协程中未处理的异常会向上冒泡,传给 next 函数或 send 方法的调用方(即触发协程的对象) 终止协程的一种方式:发送某个哨符值,让协程退出.内置的 None 和 Ellips ...