Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alibaba/nginx-http-sysguard
A Nginx module to protect servers when system load or memory use goes too high.
https://github.com/alibaba/nginx-http-sysguard
Last synced: 11 days ago
JSON representation
A Nginx module to protect servers when system load or memory use goes too high.
- Host: GitHub
- URL: https://github.com/alibaba/nginx-http-sysguard
- Owner: alibaba
- Created: 2012-11-26T07:13:21.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-04-17T00:26:45.000Z (over 7 years ago)
- Last Synced: 2024-08-02T14:07:37.634Z (4 months ago)
- Language: C
- Homepage:
- Size: 134 KB
- Stars: 249
- Watchers: 39
- Forks: 81
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-nginx - nginx-http-sysguard - A Nginx module to protect servers when system load or memory use goes too high. (Third Party Modules / C Modules)
README
##Description
This module can be used to protect your server in case system load or memory use goes too high.
It comes from [Tengine](http://tengine.taobao.org), an Nginx distribution with quite a few advanced features.###Examples:
server {
sysguard on;sysguard_load load=10.5 action=/loadlimit;
sysguard_mem swapratio=20% action=/swaplimit;location /loadlimit {
return 503;
}location /swaplimit {
return 503;
}
}##Installation
$ wget http://www.nginx.org/download/nginx-1.2.5.tar.gz
$ tar xzvf nginx-1.2.5.tar.gz
$ cd nginx-1.2.5
$ git clone https://github.com/taobao/nginx-http-sysguard.git
$ patch -p1 < nginx-http-sysguard/nginx_sysguard_1.2.5.patch
$ ./configure --add-module=./nginx-http-sysguard
# make && make install##Directives
**Syntax**: ***sysguard*** [on | off]
**Default**: sysguard off
**Context**: http, server, locationTurn on or off this module.
**Syntax**: ***sysguard_load*** load=number [action=/url]
**Default**: none
**Context**: http, server, locationSpecify the load threshold. When the system load exceeds this threshold, all subsequent requests will be redirected to the URL specified by the 'action' parameter. Nginx will return 503 if there's no 'action' URL defined.
**Syntax**: ***sysguard_mem*** swapratio=ratio% [action=/url]
**Default**: none
**Context**: http, server, locationSpecify the used swap memory threshold. When the swap memory use ratio exceeds this threshold, all subsequent requests will be redirected to the URL specified by the 'action' parameter. Nginx will return 503 if there's no 'action' URL.
**Syntax**: ***sysguard_interval*** time
**Default**: sysguard_interval 1s
**Context**: http, server, locationSpecify the time interval to update your system information. The default value is one second, which means Nginx updates the server status once a second.
**Syntax**: ***sysguard_log_level*** [info | notice | warn | error]
**Default**: sysguard_log_level error
**Context**: http, server, location
Specify the log level of sysguard.