My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

Feel free to contribute your patches and improvements!

USTATS module provides basic statistics for each backend in nginx upstreams:

  • Number of requests
  • Http 499/500/503 errors count
  • Tcp errors
  • Http read/write timeouts
  • Fail timeout
  • Max fails count
  • Last failed access time
  • Total fails count
  • Blacklisted backend highlighting
  • Down backends highlighting

The module allows you to sort values in some columns for each separate upstream. The data can be retrieved as JSON by appending "?json" to the end of location on which the module was set to work on (see configuration instructions below).

Installation

(tested with nginx 1.0.10)

  1. Download module source code
  2. Copy ustats folder into your nginx/src/http/modules folder
  3. Copy nginx.patch file into nginx root folder
  4. cd into nginx root folder and apply the patch:
  5.     patch -p2 -i nginx.patch
  6. Run ./configure with all parameters you normally use, but also include option
  7.     --add-module=src/http/modules/ustats
  8. make && make install

Configuration

Example

  location /ustats {
    ustats memsize=3m;
    ustats_refresh_interval 6000;
    ustats_html_table_width 95;
    ustats_html_table_height 95;
  }

The module supports a number of configuration directives:

  • syntax: ustats memsize=<size>;
context: location

Enables module handler for this location and sets the size of the shared memory that will be used to store statistics data across all worker processes. Example:
  location /ustats {
    ustats memsize=2m;
  }
  • syntax: ustats_html_table_width <number>;
context: location
default: 70
Specifies web interface table width. Values less or equal to 100 are interpreted as percents, otherwise as pixels.
  • syntax: ustats_html_table_height <number>;
context: location
default: 70
See ustats_html_table_width.
  • syntax: ustats_refresh_interval <number>;
context: location
default: 5000
Specifies page refresh interval in milliseconds.
Powered by Google Project Hosting