openresty + nginx-http-sysguard 調研使用

openresty 擴展使用

install

https://openresty.org/cn/nginx

openresty + TMD (nginx-http-sysguard)

https://github.com/alibaba/nginx-http-sysguard, 淘寶開源限流模塊git

安裝

>brew install pcre openssl  # 安裝依賴, 須要下載源碼
>git clone https://github.com/taobao/nginx-http-sysguard.git  # 如今TMD
>patch -p1 < ../../nginx-http-sysguard/nginx_sysguard_1.3.9.patch  # 使用patch修復文件,在目錄./bundle/nginx-XX執行,是待修復的文件的上級目錄
>./configure --prefix=/Users/a002/IdeaProjects/openresty-1.13.6.2/openresty  --add-module=./nginx-http-sysguard --with-openssl=./openssl-1.0.2k  --with-pcre=./pcre-8.40
>make -j2 & make install   # 雙核編譯,核數

系統負載 + 系統內存 壓測效果

  • 已經閱讀源碼: 經過unix系統函數加載系統負載和內存信息,檢測信息超出配置, 則return 503
  • 在現實的業務系統中使用的場景不大,或者沒有lua限流算法的應用場景更加廣闊
  • https://github.com/alibaba/nginx-http-sysguard
相關文章
相關標籤/搜索