システムパフォーマンス入門

パフォーマンスに詳しいインフラに憧れて

ユーザ用ツール

サイト用ツール


· 最終更新: 2021/03/15 by kurihara


NginxのServer-statusでリソース監視

Nginxにstub_statusがあるか確認

–with-http_stub_status_modulegがあるか確認します。

$ nginx -V
nginx version: nginx/1.18.0 (Ubuntu)
built with OpenSSL 1.1.1f  31 Mar 2020
TLS SNI support enabled
configure arguments: (略)--with-http_stub_status_module (略)


閲覧設定

Nginxの設定フィアルに以下を書きます。

server {

   #Server Status
    location /nginx_status {
        stub_status on;
        access_log off;
        allow 127.0.0.1;
        allow xx.xx.xx.xx;
        deny all;
    }
}


確認方法

curlで確認

curl -u http://xx.xx.xx.xx:yyyy/nginx_status
curl -u user:password http://xx.xx.xx.xx:yyyy/nginx_status
$ curl -u user:password http://xx.xx.xx.xx:yyyy/nginx_status
Active connections: 4
server accepts handled requests
 10274 10274 30519
Reading: 0 Writing: 1 Waiting: 3


wgetで確認

wget -q -O - http://xx.xx.xx.xx/nginx_status
wget --http-user=xxxxx --http-passwd=xxxx  -q -O - http://xx.xx.xx.xx:yyyy/nginx_status
$ wget --http-user=xxxx --http-passwd=xxxx  -q -O - http://xx.xx.xx.xx:8888/nginx_status
Active connections: 7
server accepts handled requests
 10245 10245 30479
Reading: 0 Writing: 1 Waiting: 6




関連ページ


· 最終更新: 2021/03/15 by kurihara

ページ用ツール