nginx-http-sysguardNginx 模块

联合创作 · 2023-10-01 15:47

nginx-http-sysguard 是阿里巴巴开发的一个 Nginx 模块,用来保护运行 Nginx 服务器的系统负载和内存使用不会太高。

配置方法:

server {
    sysguard on;

    sysguard_load load=10.5 action=/loadlimit;
    sysguard_mem swapratio=20% action=/swaplimit;

    location /loadlimit {
        return 503;
    }

    location /swaplimit {
        return 503;
    }
}

安装:

$ 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
浏览 3
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报