【问题标题】:cant get ab test to work with gzip无法让 ab 测试与 gzip 一起使用
【发布时间】:2016-06-07 12:47:53
【问题描述】:

这是我的 nginx gzip 配置:

 gzip on;
     gzip_vary on;
     gzip_proxied any;
     gzip_comp_level 4;
     gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

我同意它适用于所有确认我的网站是服务 gzip 的 gzip 测试网站 my 是一个简单的 html 文件,它的内容类型是Content-Type:text/html; charset=UTF-8

我的页面内容没有 gzip 是 300kb 并且 gzip 应该是 20kb 尝试运行所有选项,例如:

ab  -r -n 200 -c 10 -k -H "Accept-Encoding: gzip, deflate" http://example.com
ab  -r -n 200 -c 10 -k -H "Accept-Encoding: gzip" http://example.com
ab  -H "Accept-Encoding: gzip" -n 200 -c 10 -k  http://example.com
ab  -H "Accept-Encoding: gzip, deflate" -n 200 -c 10 -k  http://example.com

等 不管我总是得到什么Document Length: 183675 bytes 这意味着它没有得到应该小得多的 gzip 版本。

知道如何让它工作吗?我正在尝试对我的网站进行压力测试,但我总是受到网络输出速度的限制,它只有 250 Mbps,当我达到限制时,cpu 和 ram 最大只有 10%

【问题讨论】:

    标签: nginx stress-testing apachebench


    【解决方案1】:

    所以我需要添加到 nginx 配置中

    gzip_http_version 1.0;
    

    默认的 1.1 对 apache bench 来说不太好

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-31
      • 2018-01-02
      • 2016-11-14
      • 2015-02-01
      • 2019-05-10
      • 2017-11-20
      • 2011-05-24
      • 2019-05-17
      相关资源
      最近更新 更多