Skip to content
ngx_http_reqstat_module from tengine 2.1.0 adopted for nginx
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


  • ngx_http_reqstat_module This module supports collecting the running status of nginx according to specific key (domain, url, etc). It comes from Taobao Tengine @


This module will help monitor running status of nginx.

  • It can provide running status information of nginx.

  • The information is divided into different zones, and each zone is independent.

  • The status information is about connections, requests, response status codes, input and output flows, rt, and upstreams.

  • It shows all the results by default, and can be set to show part of them by specifying zones.


patch -p1 < /path/to/nginx-http-reqstat/connection.patch ./configure --add-module=/path/to/nginx-http-reqstat


http {
    req_status_zone server "$host,$server_addr:$server_port" 10M;

    server {
        location /tenginestats {

        req_status server;
  • when you call '/tenginestats', you will get the results like this:

    • Each line shows the status infomation of a "$host,$server_addr:$server_port".

    • Line format:

      • kv value of the variable defined by the directive 'req_status_zone'
      • bytes_in_total total number of bytes received from client
      • bytes_out_total total number of bytes sent to client
      • conn_total total number of accepted connections
      • req_total total number of processed requests
      • 2xx total number of 2xx requests
      • 3xx total number of 3xx requests
      • 4xx total number of 4xx requests
      • 5xx total number of 5xx requests
      • other total number of other requests
      • rt_total accumulation of rt (round trip time)
      • upstream_req total number of requests calling for upstream
      • upstream_rt accumulation of upstream rt
      • upstream_tries total number of times calling for upstream
  • tsar can parse the result and monitor, see also



Syntax: req_status_zone zone_name value size

Default: none

Context: main

create shared memory for this module. 'zone_name' is the name of memory block. 'value' defines the key, in which variables can be used. 'size' defines the size of shared memory.


req_status_zone server "$host,$server_addr:$server_port" 10M;

the memory is 10MB, the key is "$host,$server_addr:$server_port", and the name is "server".
  • Notice, if you want to use tsar to monitor, you should not use comma in the key.


Syntax: req_status zone_name1 [zone_name2 [zone_name3]]

Default: none

Context: main、srv、loc

Enable monitoring. You can specify multiple zones to monitor.


Syntax: req_status_show [zone_name1 [zone_name2 [...]]]

Default: all the targets defined by 'req_status_zone'

Context: loc

Display the status information. You can specify zones to display.


This is a tengine module copied from tengine-2.1.0, and made to work with nginx. It follows original tengine license.

You can’t perform that action at this time.