nginx - Munin:nginx 请求的 y 轴上的 'm' 是什么意思?

标签 nginx rrdtool munin

我有以下 munin 生成的 nginx 请求图:

nginx requests by day

y 轴中的“m”是什么意思?

位于/usr/share/munin/plugins/nginx_request 的 nginx munin 插件正在提取:

if ($response->content =~ /^\s+(\d+)\s+(\d+)\s+(\d+)/m) {
    print "request.value $3\n";

这意味着它正在使用 nginx_status 的第三个组件,这似乎是总的累积请求数。这是来自同一服务器的示例执行:

$ curl http://127.0.0.1/nginx_status
Active connections: 1 
server accepts handled requests
 2936 2936 4205 
Reading: 0 Writing: 1 Waiting: 0 

munin nginx 插件将以下内容传递给 rrdtool:

print "graph_title Nginx requests\n";
print "graph_args --base 1000\n";
print "graph_category nginx\n";
print "graph_vlabel Request per second\n";
print "request.label req/sec\n";
print "request.type DERIVE\n";
print "request.min 0\n";
print "request.label requests port $port\n";
print "request.draw LINE2\n";

最佳答案

“m”是单位的“毫”前缀。因此,400 m 表示 0.400。

默认情况下,RRDTool 使用 SI 前缀——2000 显示为 2k,0.01 显示为 10m 等等。这通常不是问题,除非没有单位或被测量的东西在小数部分没有意义。

停止此行为的方法是不使用 GPRINT 中的 %s(这修复了图例),并使用 --units-exponent=0 选项(这修复了 Y 轴)。不过,我不知道是否有可能让 munin 这样做。不过,您也许可以修改插件以将“--units-exponent 0”添加到 graph_args。

关于nginx - Munin:nginx 请求的 y 轴上的 'm' 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21695942/

相关文章:

php - 每秒 Apache 请求数

nginx - 如何找到并停止在端口 443 上运行服务器的进程

redis - php时间序列数据库

centos - 强制重新生成所有图表

linux - Munin 动态图缩放(dynazoom)不起作用(CentOS6、nginx、php-fpm)

nginx - 避免 CR :LF characters in NGINX

python - 在python中将字符串转换为字典

munin - 我如何设置 munin 插件乘法

django - munin 运行 munin-cron 时无法复制内容

nginx - 拒绝在框架中显示 'https://example.com/app/appName',因为它在 Shopify 中将 'X-Frame-Options' 设置为 'deny'