zoukankan      html  css  js  c++  java
  • nginx如何防止高负载造成服务器崩溃

    nginx-http-sysguard模块

    一、作用
    防止因nginx并发访问量过高或者遭受攻击造成服务器宕机,可根据负载设置界面跳转。
     
    二、安装配置
    1.下载模块软件包
    wget https://github.com/alibaba/nginx-http-sysguard/archive/master.zip
    unzip /opt/master.zip
     
    2.给nginx打nginx_sysguard补丁
    cd /nginx源文件目录
    patch -p1 < nginx-http-sysguard-master/nginx_sysguard_1.3.9.patch 
     
    3.编译nginx添加模块
      nginx -V查看nginx编译选项
    nginx version: nginx/1.14.0
    built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) 
    built with OpenSSL 1.0.2o  27 Mar 2018
    TLS SNI support enabled
    configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http
    

      重新编译,增加模块

    ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-openssl=/opt/hdlnmp/src/openssl-1.0.2o --add-module=nginx-http-sysguard-master
    make

      替换nginx可执行程序

     

  • 相关阅读:
    用JavaScript玩转计算机图形学(二)基本光源
    两条像面试用的编程问题,和我的囧事
    混合语言的游戏开发系统架构
    为你详解Linux安装GCC方法
    Windows Phone 7常用资源大集合
    html5之Web Workers示例
    MFC/Win32中使用GDI+
    linux yum命令详解
    Linux development tools
    HTML5之Canvas标签简要学习
  • 原文地址:https://www.cnblogs.com/ltlinux/p/11022120.html
Copyright © 2011-2022 走看看