How to monitor NGINX
-
Upload
server-density -
Category
Technology
-
view
1.602 -
download
3
description
Transcript of How to monitor NGINX
How to monitor:Nginx
David MyttonHangout on Air - Oct 2014
blog.serverdensity.com/monitor-nginx/
David Mytton
Server Density Architecture
Server Density Architecture
● ~100 servers - Ubuntu 12.04
Server Density Architecture
● ~100 servers - Ubuntu 12.04
● 50:50 virtual/dedicated
Server Density Architecture
● ~100 servers - Ubuntu 12.04
● 50:50 virtual/dedicated
● 200TB/m processed data
Server Density Architecture
● ~100 servers - Ubuntu 12.04
● 50:50 virtual/dedicated
● Nginx, Python, MongoDB
● 200TB/m processed data
Key metrics
● Requests
● Connections
● Status codes
● Server performance
Key metrics
● Requests
● Connections
Key metrics
● Requests
● Connections
Vanity
Key metrics
● Requests
● Connections
Benchmark!
Vanity
ngx_http_stub_status_module
● --with-http_stub_status_module
location /basic_status { stub_status;}
ngx_http_stub_status_module
● --with-http_stub_status_module
Active connections: 291 server accepts handled requests 16630948 16630948 31070465 Reading: 6 Writing: 179 Waiting: 106
accepts should == handled
Key metrics
● Status codes
Status codes
● 2xx = Success
● 3xx = Redirect
● 4xx = Client error
● 5xx = Server error
Status codes
● Mostly 2xx/3xx
● Sudden spikes?
Status codes
server { access_log /var/log/nginx/access_log combined; ...}
Status codes
tail -f /var/log/nginx/access_log
Status codes
$ ngxtoprunning for 411 seconds, 64332 records processed: 156.60 req/sec
Summary:| count | avg_bytes_sent | 2xx | 3xx | 4xx | 5xx ||---------+------------------+-------+-------+-------+-------|| 64332 | 2775.251 | 61262 | 2994 | 71 | 5 |
github.com/lebinh/ngxtop
Key metrics
● Server performance
Server performance
● CPU / load average
● Networking (connections)
Server Density
ngx_http_status_module
● Nginx+
demo.nginx.com/status.html
ngx_http_status_module
● Server Density Plugin
serverdensity.com/nginx/
● Monitor backends, status codes, requests
● Recommended alerts
Summary
● Determine baseline key metrics
Key metrics
● Requests
● Connections
● Status codes
● Server performance
Summary
● Determine baseline key metrics
● Nginx metrics + server performance
Summary
● Determine baseline key metrics
● Nginx metrics + server performance
● Manual tools for real time
Summary
● Determine baseline key metrics
● Nginx metrics + server performance
● Manual tools for real time
● Set up a monitoring product
Useful resources
● http://nginx.org/en/docs/http/ngx_http_stub_status_module.html
● https://www.serverdensity.com/plugins/nginx
● https://blog.serverdensity.com/monitor-nginx
● http://nginx.org/en/docs/http/ngx_http_status_module.html