V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
yangxin0
V2EX  ›  程序员

搜狐后台开发 pre-interview 题目

  •  
  •   yangxin0 · 2016-02-29 20:18:42 +08:00 · 1418 次点击
    这是一个创建于 2992 天前的主题,其中的信息可能已经有所发展或是发生改变。

    问题: 编写一个 ab(Apache Benchmark) 的替代程序,请尽可能的兼容 ab 你所认为重要的功能和参数。

    ab [options] http://hostname[:port][/path]
    -n requests number of requests to perform
    -c concurrency number of multiple requests to make
    -t timelimit seconds to max. wait for responses
    -i use HEAD instead of GET
    -v verbose

    代码在这里: https://github.com/YangXin/ab

    使用它: 切换到 ab 的目录直接 make , 然后尝试一下 ./ab -c 20 -n 100 http://blog.csdn.net/johnstrive/article/details/50667557

    注意:
    1 、在计算一些数据大小的时候我与 ab 有一些不同, 我没有研究 ab 内部实现,但是这些区别不影响我们对结果分析
    - 在计算 transfer data 的时候, 我计算从 TCP 拿到的所有数据
    - 在计算 html data 的时候, 我计算 http 的 payload

    2 、对于 http 协议我也是只实现了一个子集, 我实现了基本的 chunked 模式和 content-length

    PS :各位同行有后台开发坑位没, 联系方式 [email protected]

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