Tengine ngx_http_sysguard_module 过载保护模块使用
生活随笔
收集整理的這篇文章主要介紹了
Tengine ngx_http_sysguard_module 过载保护模块使用
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
簡介
Tengine是由淘寶網(wǎng)發(fā)起的Web服務(wù)器項目。它在Nginx的基礎(chǔ)上,針對大訪問量網(wǎng)站的需求,添加了很多高級功能和特性。Tengine的性能和穩(wěn)定性已經(jīng)在大型的網(wǎng)站如淘寶網(wǎng),天貓商城等得到了很好的檢驗。它的最終目標(biāo)是打造一個高效、穩(wěn)定、安全、易用的Web平臺。
運行環(huán)境:Centos 6.4 x86_64
軟件版本:tengine-1.5.2
軟件下載地址:wget http://tengine.taobao.org/download/tengine-1.5.2.tar.gz
1.編譯安裝tengine
2.編譯/etc/nginx/nginx.conf 動態(tài)加載ngx_http_sysguard_module 模塊
[root@localhost ~]# vi /etc/nginx/nginx.conf http { dso {load ngx_http_sysguard_module.so; } }3.在server段中配置過載保護:
server {listen 80;server_name 192.168.30.117;sysguard on;sysguard_load load=0.1 action=/loadlimit;sysguard_mem swapratio=20% action=/swaplimit;sysguard_mem free=100M action=/freelimit;#charset koi8-r;#access_log logs/host.access.log main;root /var/www/html;index index.html index.htm;location / {}location /loadlimit {return 403;}4.重啟tengine
[root@localhost ~]# /usr/local/nginx/sbin/nginx -s reload5.驗證過載保護功能
繼續(xù)訪問頁面發(fā)現(xiàn)403:
6.tengine過載保護功能生效
轉(zhuǎn)載于:https://blog.51cto.com/luojianlong/1382463
總結(jié)
以上是生活随笔為你收集整理的Tengine ngx_http_sysguard_module 过载保护模块使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Centos系统搭建LAMP
- 下一篇: 关于树,各种平衡树查找树的资料合集~~