zoukankan      html  css  js  c++  java
  • Apache优化

    1.测试工具Apache自带的有ab.exe工具,进入cmd下,命令

       ab.exe -n 请求次数 -c 同时请求人数(并发量) url

       ab.exe -n 10000 -c 1000 http://www.baidu.com

    2.修改Apache最大并发数

       (1)在httpd.conf 文件中修改

         # Server-pool management (MPM specific)

          Include conf/extra/httpd-mpm.conf

         (2)确定当期的Apache是什么MPM模式

           进入到Apache/bin下运行 httpd.exe -l,如果看到mpm_xxx.c如果xxx是winnt,说明是winnt

           另外还可能是perfork或者worker

         (3)修改http-mpm.conf文件

            刚才查看到的是winnt模式,则修改文件中的winnt模块

           默认是

        <IfModule mpm_winnt_module>
          ThreadsPerChild 150  //并发数默认是150
          MaxRequestsPerChild 0
        </IfModule>

            把ThreadsPerChild 150改成1000,则并发数就修改成1000了

          (4)重启测试

           在linux下,一般采用的MPM是perfork模式,修改配置入下

           <IfModule mpm_prefork_module>

        StartServers 5
        MinSpareServers 5
        MaxSpareServers 10

               ServerLimit  1500   //用于修改Apache编程参数
        MaxClients 1000     //并发量
        MaxRequestsPerChild 0
      </IfModule>

  • 相关阅读:
    css布局
    常用正则表达式
    读书笔记Hadoop实战1
    C++ IDE for Linux
    由计算机的锁是怎么实现的
    pthread
    转:C++反汇编揭秘2 – VC编译器的运行时错误检查(RTC)
    PyDev Python 开发的IDE
    转:C++反汇编揭秘1 一个简单的C++程序反汇编解析
    如何查找命令对应的软件包
  • 原文地址:https://www.cnblogs.com/hanyouchun/p/4056435.html
Copyright © 2011-2022 走看看