使用nginx-module-vts监控各虚拟主机的流量 一、概述 由于所有业务只有一个公网IP入口,无法统计到每个业务的流量带宽,好在nginx上通过域名进行业务区分,可以借助nginx-module-vts模块来实现需求。 本文将主要用到以下几个模块和工具: nginx-module-vts: Nginx virtual host traffic status mod
nginx-module-vts:Nginx的监控模块,能够提供JSON格式的数据产出。nginx-vts-exporter:主要用于收集Nginx的监控数据,并给Prometheus提供监控接口,默认端口号9913。Prometheus:监控Nginx-vts-exporter提供的Nginx数据,并存储在时序数据库中,可以使用PromQL对时序数据进行查询和聚合。
cd tengine docker build -t harbor.evescn.com/devops/tengine:2.4.0-nginx-module-vts . docker push harbor.evescn.com/devops/tengine:2.4.0-nginx-module-vts nginx.conf 文件 Copy user nginx; # This number should be, at maximum, the number of CPU cores on your system. worker_processes ...
1. nginx-module-vts 准备 2.查看已安装的的 nginx 编译参数 3. 重新编译 nginx 添加 nginx-module-vts 模块 4. 验证 1.nginx-module-vts准备 # 解压 unzip nginx-module-vts-master.zip # 将解压包移动到/usr/local/目录 mv nginx-module-vts-master /usr/local/ 2.查看已安装的的nginx编译参数 # 进...
要在Nginx中安装vts(虚拟主机流量状态)模块,你需要按照以下步骤进行操作。这些步骤涵盖了了解vts模块、安装依赖、下载源代码、编译Nginx以及验证安装等过程。 1. 了解vts模块及其与Nginx的兼容性 nginx-module-vts 是Nginx的一个监控模块,用于提供Nginx虚拟主机流量状态的数据。该模块能够输出JSON格式的数据,方便进行监控...
shell> CC=gcc ./auto/configure --with-cc-opt='-fprofile-use -fprofile-dir=/somewhere/nginx-module-vts/objs' --with-ld-opt='-lgcov' --add-module=/somewhere/nginx-module-vts shell> make Synopsis http { vhost_traffic_status_zone; ...
缓存在所有工作进程之间共享。 在大多数情况下,nginx-module-vts使用的共享内存大小不会增加太多。 当使用vhost_traffic_status_filter_by_set_key指令时,共享内存的大小会增加很多,但是如果过滤器的键是固定的(例如,国家代码的总数约为240),则不会持续增加。
gitclonegit://github.com/vozlt/nginx-module-vts.git 配置文件 http{ vhost_traffic_status_zone;server{location/status { vhost_traffic_status_display;vhost_traffic_status_display_formathtml; } } } 配置内容介绍: vhost_traffic_status_zone:自动开启流量统计模块 ...
nginx-module-vts(https://github.com/vozlt/nginx-module-vts)是一个第三方的nginx module,使用它可以查看nginx各个vhost的通讯状态和统计数据,比较类似于haproxy自带的stats page。这个nginx模块的下载地址为https://github.com/vozlt/nginx-module-vts/releases。编
nginx-module-vts: Nginx virtual host traffic status module,nginx的监控模块,能够提供json、html、prometheus格式的数据产出。 nginx-vts-exporter: Simple server that scrapes Nginx vts stats and exports them via HTTP for Prometheus consumption。主要用于收集nginx的监控数据,并给Prometheus提供监控接口,默认端口号...