Skip to content
프로젝트

alibaba/nginx-http-sysguard

GitHub에서 보기

소개

A Nginx module to protect servers when system load or memory use goes too high.

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

##Description

This module can be used to protect your server in case system load or memory use goes too high.
It comes from Tengine, 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, location

Turn on or off this module.

Syntax: sysguard_load load=number [action=/url]
Default: none
Context: http, server, location

Specify 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, location

Specify 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, location

Specify 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.

관련 프로젝트 살펴보기

불러오는 중…