nginx-http-sysguard
阿里百川梦想创业大赛,500万创投寻找最赞的APP
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