当前位置:首页>Linux>Linux运维-综合架构-nginx 常用模块 (上)

Linux运维-综合架构-nginx 常用模块 (上)

  • 2026-02-21 13:33:10
Linux运维-综合架构-nginx 常用模块 (上)

nginx 常用模块 (上)

目录索引模块

下载站点场景 当 ngx_http_index_module 模块找不到索引文件时,通常会将请求传递给 ngx_http_autoindex_module 模 块。

  • 当用户发起域名访问 Nignx 站点,匹配了 server_name,再匹配到 location 标签时,寻找 /
  • ,找不到 Index 的话,不会返回 403,它会寻找 ngx_http_autoindex_module 模块块处理以斜杠字符('/') 结尾的请求,并生成目录列表;
  • 再找不到的话通常会设置成返回 403 错误 ;
如图所示:站点配置文件中定义了index,它对应所支持的模块就是ngx_http_index_module

配置目录书语法演示

403 错误前的呈现下载列表;

//修改hosts文件。类似DNS劫持192.168.0.21 mirrors.fpaopao.cn//创建站点目录,目前站点目录中不存在任何文件,例如index.html等;[root@web01_0.21[ /mirrors]  pwd/mirrors[root@web01_0.21[ /mirrors]  tree.├── Centos├── MacOS└── Windows//创建站点主配置文件[root@web01_0.21[ /etc/nginx/conf.d]# pwd/etc/nginx/conf.d[root@web01_0.21[ /etc/nginx/conf.d]# vim mirrors.fpaopao.cn.conf[root@web01_0.21[ /etc/nginx/conf.d]  cat mirrors.fpaopao.cn.confserver {        listen 80;        server_name mirrors.fpaopao.cn;        location / {                    root /mirrors;                    index index.html;        }}//检查并重载[root@web01_0.21[ /mirrors]# nginx -tnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful[root@web01_0.21[ /mirrors]# systemctl reload nginx

目前的配置,返回 403 错误的根本原因是 location 层下的/里并没有匹配到 index 或者 index.html 文件;

域名访问,结果显示403,原因就是 locaiotn 层下的/ 没有 index 的文件,所以返回 403;

开启目录索引配置语法

注意:这里暂将索引功能作用到 location 层(作用域直只针对当前 locaion 层,后续若是 locaiton / 比较多时,可以放到 server 层,作用域在全局

  • 启用或禁用目录列表输出,on 开启,off 关闭
[root@web01_0.21[ /etc/nginx/conf.d]# cat mirrors.fpaopao.cn.confserver {        listen 80;        server_name mirrors.fpaopao.cn;        location / {                    root /mirrors;                    index index.html;                    autoindex on;  //暂时作用到loacaion层,启用或禁用目录列表输出,on开启,off关闭        }//检查并重载
再次刷新,在没有匹配到/,并没有返回403,而是显示了文件结构目录
可以按照实际业务需求上传一些资源,不过看起来页面显示不友好,有乱码,容量大小默认显示字节数;

指定目录列表中输出确切的文件大小(缺省是关闭的)

[root@web01_0.21[ /mirrors/Windows]# cat /etc/nginx/conf.d/mirrors.fpaopao.cn.confserver {        listen 80;        server_name mirrors.fpaopao.cn;        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;  //指定是否应在目录列表中输出确切的文件大小,on显示字节,off显示大概单位。        }}//检查语法&重载
autoindex_exact_size off指定是否应在目录列表中输出确切的文件大小

指定目录列表中的北京(本地)时间

[root@web01_0.21[ ~]# cat /etc/nginx/conf.d/mirrors.fpaopao.cn.confserver {        listen 80;        server_name mirrors.fpaopao.cn;        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;                    autoindex_localtime on;  //指定目录列表中的时间是应以本地时区还是UTC输出。on 本地时区,off UTC时间。        }}//检查语法并重载;
指定目录列表中的时间是应以本地时区还是UTC输出

设定字符集配置

[root@web01_0.21[ ~]  cat /etc/nginx/conf.d/mirrors.fpaopao.cn.confserver {        listen 80;        server_name mirrors.fpaopao.cn;        charset uft8,gbk;  //通常作用在server层,设定字符集,防止中文字 符乱码显示        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;                    autoindex_localtime on;        }}// 检查重载;

Nginx 访问控制

ngx_http_access_module 模块允许限制对某些客户端(来源)地址的访问;

注意:deny 和 allow 的顺序是有影响的 默认情况下,从第一条规则进行匹配 如果匹配成功,则不继续匹配下面的内容。 如果匹配不成功,则继续往下寻找能匹配成功的内容。

Nginx 访问控制语法配置

 vim /etc/nginx/conf.d/mirrors.fpaopao.cn.confserver {        listen 80;        server_name mirrors.fpaopao.cn;        charset uft-8;        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;                    autoindex_localtime on;                    allow 10.0.0.1/32;  //允许地址或地址段                    deny all; //拒绝所有人        }}//检查重载
禁止后的结果显示

Nginx 基础认证 (基本验证)

ngx_http_auth_basic_module 模块允许使用 HTTP 基本身份验证,验证用户名和密码来限制对资源的访问。

官方基础模块

参考链接:https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html

官方文档--示例
//官方演示的示例location / {    auth_basic           "closed site";  // 在location层中写入一个站点(描述)    auth_basic_user_file conf/htpasswd;  //基本认证后要写入一个相对或者绝对路径的文件 (用户名和密码)}

这个用户名和密码是用怎样的格式?

  • 用户名和密码必须以加密的结果文件形式展现;
  1. htpasswd
  2. openssl passwd
Specifies a file that keeps user names and passwords, in the following format:# commentname1:password1   //冒号分隔,并不是手动填写输入用户名和密码name2:password2:commentname3:password3

使用 htpasswd 生成一个密码文件

查询htpasswd,是在哪个依赖包中--httpd-tools
//安装httpd-tools[root@web01_0.21[ ~]# yum install -y httpd-tool[root@web01_0.21[ ~]# rpm -qa httpd-tools   //有的话就不用下载了httpd-tools-2.4.6-99.el7.centos.1.x86_64//使用htpaswd,生成用户名和密码,存放在指定路径下[root@web01_0.21[ /]# htpasswd -c -b /etc/nginx/ngx.passwd fengxin 123.com!Adding password for user fengxin[root@web01_0.21[ /]# cat /etc/nginx/ngx.passwdfengxin:$apr1$libgce79$qfT1cGVR1JHgLxcpxsZ6n/       //用户名:密码,符合官方格式[root@web01_0.21[ /]# cat /etc/nginx/conf.d/mirrors.fpaopao.cn.confserver {        listen 80;        server_name mirrors.fpaopao.cn;        charset uft-8;        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;                    autoindex_localtime on;# allow 10.0.0.1/32;# deny all;                   auth_basic "auth";                   auth_basic_user_file /etc/nginx/ngx.passwd;  //指定保存用户名和密码的文件        }}//检查语法并重载

htpasswd 参数详解

[root@web01_0.21[ ~]# htpasswdUsage: htpasswd [-cimB25dpsDv] [-C cost] [-r rounds] passwordfile username  //携带参数后,指定文件存放位置,里面写入了用户名 htpasswd -b[cmB25dpsDv] [-C cost] [-r rounds] passwordfile username password //携带参数后,指定文件存储位置,里面写入了用户名和密码 htpasswd -n[imB25dps] [-C cost] [-r rounds] username htpasswd -nb[mB25dps] [-C cost] [-r rounds] username password -c  Create a new file.  //创建新文件 -n  Don't update file; display results on stdout. -b  Use the password from the command line rather than prompting for it.  //允许输入明文密码 -i  Read password from stdin without verification (for script usage). -m  Force MD5 encryption of the password (default). -2  Force SHA-256 crypt() hash of the password (secure). -5  Force SHA-512 crypt() hash of the password (secure). -B  Force bcrypt aencryption of the password (very secure). -C  Set the computing time used for the bcrypt algorithm     (higher is more secure but slower, default: 5, valid: 4 to 31). -r  Set the number of rounds used for the SHA-256, SHA-512 algorithms     (higher is more secure but slower, default: 5000). -d  Force CRYPT encryption of the password (8 chars max, insecure). -s  Force SHA-1 encryption of the password (insecure). -p  Do not encrypt the password (plaintext, insecure). -D  Delete the specified user. -v  Verify password for the specified user.On other systems than Windows and NetWare the '-p' flag will probably not work.The SHA-1 algorithm does not use a salt and is less secure than the MD5 algorithm.
网页弹出了用户名和密码-输入正确的用户名和密码就可以进入

Nginx 限流限速(生产场景中常用)

为什么要限速?

限制某个用户在一定时间内能够产生的 Http 请求数。或者说限制某个用户的下载速度,多出的次数页面会抛出 503HTTP 状态码: 过载保护,。

限速应用场景

  1. 下载限速:限制用户下载资源的速度; ngx_http_core_module
  2. 请求限制:限制用户单位时间内所产生的 Http 请求数; ngx_http_limit_req_module
  3. 连接限制:限制同一时间的连接数,及并发数限制; ngx_http_limit_conn_module

请求频率限速原理

  1. 水(请求)从上方倒入水桶,从水桶下方流出(被处理);
  • 如果说水(请求)流入的过快,水桶流出(被处理)的过慢,来不及流出的水存在水桶中(缓存),然后以固 定速率流出,水桶满后则水溢出(丢弃)。
  1. 简单来说就是:当处理速度,达不到请求的速度,则会将请求放置缓存,然后持续处理。当缓存被沾满,如果还有大量的请求,则会被丢弃。
水桶漏水算法 比喻请求频率限速原理

配置前,参考官方文档 https://nginx.org/en/docs/http/ngx_http_limit_req_module.html

  • limit_req_zone  req是request的简写
  • zone=one:10m 理解成水桶最大的存储容量
  • rate=1r/s;  理解成速率,每秒只能出现一个请求的意思;
  • burst=5  触发的值 (允许容纳的缓存数)
  • $binary_remote_addr 是一个变量,顾名思义来源IP地址,
  • $remote_addr 也是一个变量,两者间的区别
  • nodelay 具体的拒绝;

参数的具体含义

  1. zone=req_one 设置使用哪个配置区域来做 限制,与上面limit_req_zone 里的name对应。
  2. 第二个参数:burst=3,设置一个大小为3的缓冲区,当有大量请求过来时,超过了访问频次限制的请求可以先放到这个缓冲区内。
  3. 第三个参数:nodelay,超过访问频次并且缓冲区也满了 的时候,则会返回503,如果没有设置,则所有请求会等待排队。
//示例http {   //工作在http层    limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;  //工作在HTTP层,定义基本请求限速规则    ...    server {        ...        location /search/ {            limit_req zone=one burst=5;  //调用,bursts是触发的值            limit_req zone=perip burst=5 nodelay;        }Directives

binary_remote_addr和remote_addr 区别

客户端IP地址作为密钥使用。需要注意的是,此处使用的变量是remoteAddress。$binaryRemoteAddress的存储大小在IPv4地址中始终为4字节,在IPv6地址中则为16字节。在32位平台上,存储状态始终占用64字节;而在64位平台上则需占用128字节。一个兆字节的存储区域可容纳约16,000个64字节状态或约8,000个128字节状态。

  • 简单来说,使用binary_remote_addr这个变量,比remote_addr存储的IP地址较多。
remote_addr 区别

定义限速配置

  • 注意: 定义在http层的变量名称只能是唯一,如果需要多次定义,需要改变其变量名称
[root@web01_0.21[ /]# cat /etc/nginx/nginx.conf   //查看nginx的主配置文件user  nginx;worker_processes  auto;error_log  /var/log/nginx/error.log notice;pid        /var/run/nginx.pid;events {    worker_connections  1024;}http {    include       /etc/nginx/mime.types;    default_type  application/octet-stream;    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';    access_log  /var/log/nginx/access.log  main;    sendfile        on;#tcp_nopush     on;    keepalive_timeout  65;#gzip  on;    include /etc/nginx/conf.d/*.conf;   //官方文档说明该模块要加在http层。因为是被包含的关系,因此可以写在站点配置文件中}//限制请求并发数配置(指令看起来稍微复杂)[root@web01_0.21[ /]# cat /etc/nginx/conf.d/mirrors.fpaopao.cn.conf       limit_req_zone $binary_remote_addr zone=req_one:10m rate=1r/s;  //http标签段定义请求限制, rate限制速率,限制一秒钟 最多一个IP请求(对来源IP做限制)server {        listen 80;        server_name mirrors.fpaopao.cn;        charset uft-8;        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;                    autoindex_localtime on;# allow 10.0.0.1/32;# deny all;# auth_basic "auth";# auth_basic_user_file /etc/nginx/ngx.passwd;                   limit_req zone=req_one burst=5 nodelay;   //调用,请求超过1r/s,剩下的将被延迟处理,请求数超过burst定义的数量,则返回503,实际的企业生产环境,不要调那么低        }}//检查重载
频繁加速的刷新页面,到一定次数后,页面会抛出503的HTTP状态码,所谓过载保护

更改限制请求的HTTP状态码

[root@web01_0.21[ /]# vim /etc/nginx/conf.d/mirrors.fpaopao.cn.conf       limit_req_zone $binary_remote_addr zone=req_one:10m rate=1r/s;server {        listen 80;        server_name mirrors.fpaopao.cn;        charset uft-8;        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;                    autoindex_localtime on;# allow 10.0.0.1/32;# deny all;# auth_basic "auth";# auth_basic_user_file /etc/nginx/ngx.passwd;                   limit_req zone=req_one burst=5 nodelay;                   limit_req_status 411;        }}//检查重载~                                                                        
更改限制请求的HTTP状态码

限制并发连接数

通常的生产场景用于VIP收费下载,还是基于来源IP做限制。

配置

[root@web01_0.21[ ~]# cat /etc/nginx/conf.d/mirrors.fpaopao.cn.conf       limit_req_zone $binary_remote_addr zone=req_one:10m rate=1r/s;      limit_conn_zone $binary_remote_addr zone=conn_od:10m;  //请求限制的定义server {        listen 80;        server_name mirrors.fpaopao.cn;        charset uft-8;        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;                    autoindex_localtime on;# allow 10.0.0.1/32;# deny all;# auth_basic "auth";# auth_basic_user_file /etc/nginx/ngx.passwd;# limit_req zone=req_one burst=5 nodelay;# limit_req_status 411;                   limit_rate 200k;       //暂时做限速,验证限制并发链接数;                   limit_conn conn_od 2;  //限制并发两个链接数        }}//检查语法,重载[root@web01_0.21[ ~]# nginx -tnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful[root@web01_0.21[ ~]# systemctl reload nginx//模拟出一个大容量文件,放在站点文件路径下[root@web01_0.21[ /mirrors/Windows]  pwd/mirrors/Windows[root@web01_0.21[ /mirrors/Windows]  dd if=/dev/zero of=/mirrors/Windows/win2016.iso bs=2048MB count=1记录了1+0 的读入记录了1+0 的写出2048000000字节(2.0 GB)已复制,19.0975 秒,107 MB/秒[root@web01_0.21[ /mirrors/Windows]# ls -l win2016.iso -rw-r--r-- 1 root root 2048000000 8月  13 19:57 win2016.iso
同时进行两个下载任务,第二个页面执行下载时,页面会抛出503http状态码
  • 由于nginx 判断来源IP,并不判断socken的五元组,所以必须取消掉一个下载请求,才可以进行第二个,在实际的场景中,抛出的503会被一个让你充值提示的页面来代替;
  • TCP 的‌ ESTABLISHED ‌状态表示‌连接已成功建立‌,双方进入正常数据传输阶段。
原因在于:当前有好几个相同IP的ESTABLISHED类型的连接

使用内部重定向机制,模拟充值提速服务

      limit_req_zone $binary_remote_addr zone=req_one:10m rate=1r/s;      limit_conn_zone $binary_remote_addr zone=conn_od:10m;server {        listen 80;        server_name mirrors.fpaopao.cn;        charset uft-8;        error_page 503 @temp;   //拦截503错误,进行内部跳转                  //location接收                   location @temp {                                default_type text/html;  //定义媒介基本资源                             return 200 'Please contact us at 18888888.';  //返回一句话而已                   }        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;                    autoindex_localtime on;                   # allow 10.0.0.1/32;                   # deny all;                   # auth_basic "auth";                   # auth_basic_user_file /etc/nginx/ngx.passwd;                   # limit_req zone=req_one burst=5 nodelay;                   # limit_req_status 411;                   limit_rate 200k;                   limit_conn conn_od 2;        }}
超过限制并发数后的页面提示

限制下载速度

某盘某雷的盈利手段之一

//从文件容量的200mb开始,才开始执行限速操作,执行限速为300kb/s,建议放在server层;[root@web01_0.21[ /mirrors/Windows]# cat /etc/nginx/conf.d/mirrors.fpaopao.cn.conf       limit_req_zone $binary_remote_addr zone=req_one:10m rate=1r/s;      limit_conn_zone $binary_remote_addr zone=conn_od:10m;server {        listen 80;        server_name mirrors.fpaopao.cn;        charset uft-8;        limit_rate 300k;  //从文件容量的200mb开始,才开始执行限速操作,执行限速为300kb/s,建议放在server层;        limit_rate_after 200m;# error_page 503 @temp;#            location @temp {#                      default_type text/html;#                      return 200 'Please contact us at 18888888.';#            }        location / {                    root /mirrors;                    index index.html;                    autoindex on;                    autoindex_exact_size off;                    autoindex_localtime on;# allow 10.0.0.1/32;# deny all;# auth_basic "auth";# auth_basic_user_file /etc/nginx/ngx.passwd;# limit_req zone=req_one burst=5 nodelay;# limit_req_status 411;#           limit_rate 200k;#           limit_conn conn_od 2;        }}//检查语法重载

某盘某雷的盈利手段之一,基于用户ID来定义,划入到VIP组(普通和白金)的范围;

下载文件进度在200mb之后,带宽被限制定义。

综合场景练习

配置需求

  1. 限制web服务器请求数处理为1秒一个,触发值为5,限制用户仅可同时下载一个文件。
  2. 当下载超过100M则限制下载速度为500k .
  3. 如果同时下载超过2个视频,则返回提示 "Please contact us at 18888888."  或者跳转到其他页面(类似会员加速充值页面);
//创建站点目录[root@web01_0.21[ /etc/nginx/conf.d]  mkdir /vip//站点目录中默认的首页文件,写入一些内容[root@web01_0.21[ /etc/nginx/conf.d]  cd /vip/[root@web01_0.21[ /vip]  echo"vip.vip.vip.vip" >index.html// DNS劫持重定向C:\Windows\System32\drivers\etc192.168.0.21 vip.fpaopao.cnC:\Users\ASUA>ping vip.fpaopao.cn正在 Ping vip.fpaopao.cn [192.168.0.21] 具有 32 字节的数据:来自 192.168.0.21 的回复: 字节=32 时间<1ms TTL=64来自 192.168.0.21 的回复: 字节=32 时间<1ms TTL=64//站点内模拟生成一个容量较大的文件[root@web01_0.21[ /vip]  dd if=/dev/zero of=/vip/vip001.iso bs=2048MB count=1[root@web01_0.21[ /vip]  ls -l总用量 2000004-rw-r--r-- 1 root root         16 8月  14 19:58 index.html-rw-r--r-- 1 root root 2048000000 8月  14 20:00 vip001.iso//定义vip.fengpaopao.cn站点配置文件[root@web01_0.21[ /vip]  cat /etc/nginx/conf.d/vip.fpaopao.cn.conf # 定义limit_req_zone $binary_remote_addr zone=req_od01:10m rate=1r/s;limit_conn_zone $binary_remote_addr zone=conn_od01:10m;server {        listen 80;        server_name vip.fpaopao.cn;        root /vip;        limit_req zone=req_od01 burst=5 nodelay;        limit_conn conn_od01 1;        limit_rate 500k;        limit_rate_after 100m;        error_page 503 500 502 @error_temp;        location @error_temp {return 302 https://pan.baidu.com/buy/checkoutcounter?from=homepage&svip=1;                }        location / {                index index.html;        }}//检查重载
正常访问

目前的配置测试,访问请求频繁会导致跳转到指定的重置页面,有一点点不符合需求(下载才会跳转到该页面)

刷新请求过快导致跳转
//调整访问请求过多,抛出指定的状态码[root@web01_0.21[ /vip]  cat /etc/nginx/conf.d/vip.fpaopao.cn.conf # 定义limit_req_zone $binary_remote_addr zone=req_od01:10m rate=1r/s;limit_conn_zone $binary_remote_addr zone=conn_od01:10m;server {        listen 80;        server_name vip.fpaopao.cn;        root /vip;        limit_req zone=req_od01 burst=5 nodelay;        limit_req_status 411;  //增加这一行        limit_conn conn_od01 1;        limit_rate 500k;        limit_rate_after 100m;        error_page 503 500 502 @error_temp;        location @error_temp {return 302 https://pan.baidu.com/buy/checkoutcounter?from=homepage&svip=1;                }        location / {                index index.html;        }}//检查重载
刷新请求过快抛出指定状态码
//请求过快也会在日志中体现[root@web01_0.21[ /vip]  tail -f /var/log/nginx/error.log2025/08/14 20:46:32 [error] 2069#2069: *18 limiting requests, excess: 5.560 by zone "req_od01", client: 192.168.0.166, server: vip.fpaopao.cn, request: "GET / HTTP/1.1", host: "vip.fpaopao.cn"2025/08/14 20:46:35 [error] 2069#2069: *18 limiting requests, excess: 5.017 by zone "req_od01", client: 192.168.0.166, server: vip.fpaopao.cn, request: "GET / HTTP/1.1", host: "vip.fpaopao.cn"
超出下载数量后跳转指定页面
F12-谷歌浏览器能够查看跳转

Nginx状态监控

  • ngx_http_stub_status_module模块提供对基本状态信息的访问。
  • 默认情况下不集成该模块,需要使用 --with- http_stub_status_module集成。
yum安装的nginx,是带有该模块的

配置示例

//可以工作在server层,通常放在location层[root@web01_0.21[ /vip]# vim /vim /etc/nginx/conf.d/vip.fpaopao.cn.conf # 定义limit_req_zone $binary_remote_addr zone=req_od01:10m rate=1r/s;limit_conn_zone $binary_remote_addr zone=conn_od01:10m;server {        listen 80;        server_name vip.fpaopao.cn;        root /vip;        limit_req zone=req_od01 burst=5 nodelay;        limit_req_status 411;        limit_conn conn_od01 1;        limit_rate 500k;        limit_rate_after 100m;        error_page 503 500 502 @error_temp;        location @error_temp {return 302 https://pan.baidu.com/buy/checkoutcounter?from=homepage&svip=1;                }        location / {                index index.html;        }        location /ngx_status {                     stub_status;  //开启状态监测                     allow 192.168.0.0/24;  //为监控脚本考虑,查看Nginx状态的url,只允许本机或者指定IP访问;                     deny all;        }}//检查,重载
- Active connections: 2    活跃的链接数是2- server accepts(已接收的总TCP连接数量) handled(已处理的TCP连接数量) requests ( 当前总http请求数量)           32263                       32263   32502 - Reading(当前读取的请求头数量。): 0 Writing:(当前响应的请求头数量) 1 Waiting: 0 (当前等待请求的空闲客户端连接数。)
状态页面由nginx提供,不用自己去开发
一个连接多个请求是正常的,若是需要一个连接一次请求,可以修改主配置文件中的这个参数为0;

如何理解Reading、Writing、Waiting ?

  • Active connections:当前活跃连接数,包括 Waiting等待连接数。
  • accepts: 已接收的总TCP连接数量。
  • handled: 已处理的TCP连接数量。
  • requests: 当前总http请求数量。
  • Reading: 当前读取的请求头数量。
  • Writing: 当前响应的请求头数量。
  • Waiting: 当前等待请求的空闲客户端连接数。

假设现在有两条船分别为C 、S。C船需要 S船的1个物品,那么此时C船就要给S船发送一个消息。

  1. S船收到这个消息时就是reading
  2. S船将物资发送给C船,这个时候就是writing
  3. 如果C船需要S船很多个物品,那么需要C船和S船建立起一个物资传送管道,不断的传送物资。这个管道建立起来的时候,就是waiting状态了。
  • waiting状态 属于已经要建立连接的一种状态;
理解Reading、Writing、Waiting
刷新网页后展示nginx状态模块的变化说明

监控该数值的大概流程

监控该数值的大概流程
//修改站点主配置文件,允许127.0.0.1网段访问[root@web01_0.21[ ~]# cat /etc/nginx/conf.d/vip.fpaopao.cn.conf # 定义limit_req_zone $binary_remote_addr zone=req_od01:10m rate=1r/s;limit_conn_zone $binary_remote_addr zone=conn_od01:10m;server {        listen 80;        server_name vip.fpaopao.cn;        root /vip;        limit_req zone=req_od01 burst=5 nodelay;        limit_req_status 411;        limit_conn conn_od01 1;        limit_rate 500k;        limit_rate_after 100m;        error_page 503 500 502 @error_temp;        location @error_temp {return 302 https://pan.baidu.com/buy/checkoutcounter?from=homepage&svip=1;                }        location / {                index index.html;        }        location /ngx_status {                     stub_status;                     allow 192.168.0.0/24;                     allow 127.0.0.1;                     deny all;        } }//使用 curl命令携带主机头[root@web01_0.21[ ~]  curl -HHost:vip.fpaopao.cn http://127.0.0.1/ngx_statusActive connections: 1 server accepts handled requests 8 8 28 Reading: 0 Writing: 1 Waiting: 0 //配合awk命令,以冒号为分隔符,取第一例最后一个数值[root@web01_0.21[ ~]  curl -s -HHost:vip.fpaopao.cn http://127.0.0.1/ngx_status | awk 'NR==1 {print $NF}'1//形成友好输出提示:这就是监控需要curl命令去提取[root@web01_0.21[ ~]  echo"当前nginx的活跃数:$(curl -s -HHost:vip.fpaopao.cn http://127.0.0.1/ngx_status | awk 'NR==1 {print $NF}') "当前nginx的活跃数:1 

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-28 18:06:24 HTTP/2.0 GET : https://f.mffb.com.cn/a/475537.html
  2. 运行时间 : 0.139209s [ 吞吐率:7.18req/s ] 内存消耗:4,890.89kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=bea041eccabaece78cbd1598ddd872f1
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000542s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000641s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.006194s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.002105s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000635s ]
  6. SELECT * FROM `set` [ RunTime:0.001181s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000627s ]
  8. SELECT * FROM `article` WHERE `id` = 475537 LIMIT 1 [ RunTime:0.007369s ]
  9. UPDATE `article` SET `lasttime` = 1772273184 WHERE `id` = 475537 [ RunTime:0.021846s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.001090s ]
  11. SELECT * FROM `article` WHERE `id` < 475537 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000811s ]
  12. SELECT * FROM `article` WHERE `id` > 475537 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.011056s ]
  13. SELECT * FROM `article` WHERE `id` < 475537 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.010619s ]
  14. SELECT * FROM `article` WHERE `id` < 475537 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.004471s ]
  15. SELECT * FROM `article` WHERE `id` < 475537 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000960s ]
0.140862s