V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
yadam
V2EX  ›  问与答

如何压测 nginx 读取单个小静态文件到极限

  •  
  •   yadam · 2015-04-16 15:12:33 +08:00 · 1901 次点击
    这是一个创建于 3315 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有一个需求,就是想测试一下 nginx 处理单个小文件能到多大的 QPS

    • 硬件:4 core, 4G mem, hdd
    • 软件: open files: 65535

    nginx 配置:

    • 4 worker(cpu_affinity到4 core)
    • worker_connections 65535;
    • access_log off;error_log off;

    读取文件:nginx 默认的 index.html(616字节)

    我用了 ab/webbench/http_load尝试在同一个局域网/本机, 多进程压测, 但是都上不去.

    ab -n 1000000 -c 50 http://10.210.128.66/
    测试结果 Requests per second: 12283.14 [#/sec] (mean)

    httpserver的 CPU 一直维持在5%左右, iostat 显示空闲(我觉着可能是因为 index.html 已经被 cache 在内存中了).

    我哪儿的姿势不对?

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3501 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 12:01 · PVG 20:01 · LAX 05:01 · JFK 08:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.