httperf 一个高性能的压力测试工具

Written by bixuan on 2008年06月26号 – 22:14

做个标记:)

Httperf is a tool for measuring web server performance. It provides a flexible facility for generating various HTTP workloads and for measuring server performance. The focus of httperf is not on implementing one particular benchmark but on providing a robust, high-performance tool that facilitates the construction of both micro- and macro-level benchmarks. The three distinguishing characteristics of httperf are its robustness, which includes the ability to generate and sustain server overload, support for the HTTP/1.1 and SSL protocols, and its extensibility to new workload generators and performance measurements.

Httperf 是一个高效的 http 压力测试工具,使用它可以模拟出超过1千的并发访问,能充分测试出 web server 的性能。而之前使用的 siege 测试工具则未能突破 500 个并发测试(如果您知道如何可以实现,请告诉我)

使用 httperf 应该能了解到自己编写 yo2cache 软件性能极限如何了

以下是 gzip 格式访问的测试数据(因缓存文件以 gzip 格式保存,所以性能是最高的)

oneoo@oneoo-pc:~/Desktop$ httperf –server oneoo.com –num-conns 2000 –add-header “accept-encoding: gzip” httperf –client=0/1 –server=oneoo.com –port=80 –uri=/ –send-buffer=4096 –recv-buffer=16384 –add-header=’accept-encoding: gzip’ –num-conns=2000 –num-calls=1 Maximum connect burst length: 1 Total: connections 2000 requests 2000 replies 2000 test-duration 1.304 s Connection rate: 1533.7 conn/s (0.7 ms/conn, <=1 concurrent connections) Connection time [ms]: min 0.6 avg 0.7 max 6.3 median 0.5 stddev 0.2 Connection time [ms]: connect 0.0 Connection length [replies/conn]: 1.000 Request rate: 1533.7 req/s (0.7 ms/req) Request size [B]: 81.0 Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples) Reply time [ms]: response 0.6 transfer 0.0 Reply size [B]: header 302.0 content 10482.0 footer 0.0 (total 10784.0) Reply status: 1xx=0 2xx=2000 3xx=0 4xx=0 5xx=0 CPU time [s]: user 0.29 system 1.01 (user 22.4% system 77.6% total 100.0%) Net I/O: 16273.4 KB/s (133.3*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0

以下是 deflate (2级压缩率)格式访问的统计数据(需要从 gzip 解压,再压缩为 deflate 的数据处理)

oneoo@oneoo-pc:~/Desktop$ httperf –server oneoo.com –num-conns 2000 –add-header “accept-encoding: deflate” httperf –client=0/1 –server=oneoo.com –port=80 –uri=/ –send-buffer=4096 –recv-buffer=16384 –add-header=’accept-encoding: deflate’ –num-conns=2000 –num-calls=1 Maximum connect burst length: 1 Total: connections 2000 requests 2000 replies 2000 test-duration 4.113 s Connection rate: 486.2 conn/s (2.1 ms/conn, <=1 concurrent connections) Connection time [ms]: min 2.0 avg 2.1 max 11.8 median 2.5 stddev 0.3 Connection time [ms]: connect 0.0 Connection length [replies/conn]: 1.000 Request rate: 486.2 req/s (2.1 ms/req) Request size [B]: 84.0 Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples) Reply time [ms]: response 0.6 transfer 1.5 Reply size [B]: header 305.0 content 11014.0 footer 0.0 (total 11319.0) Reply status: 1xx=0 2xx=2000 3xx=0 4xx=0 5xx=0 CPU time [s]: user 0.91 system 3.20 (user 22.2% system 77.8% total 100.0%) Net I/O: 5414.3 KB/s (44.4*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0

以下是 deflate (4级压缩率)格式访问的统计数据

oneoo@oneoo-pc:~/Desktop$ httperf –server oneoo.com –num-conns 2000 –add-header “accept-encoding: deflate” httperf –client=0/1 –server=oneoo.com –port=80 –uri=/ –send-buffer=4096 –recv-buffer=16384 –add-header=’accept-encoding: deflate’ –num-conns=2000 –num-calls=1 Maximum connect burst length: 1 Total: connections 2000 requests 2000 replies 2000 test-duration 5.329 s Connection rate: 375.3 conn/s (2.7 ms/conn, <=1 concurrent connections) Connection time [ms]: min 2.6 avg 2.7 max 32.8 median 2.5 stddev 0.7 Connection time [ms]: connect 0.0 Connection length [replies/conn]: 1.000 Request rate: 375.3 req/s (2.7 ms/req) Request size [B]: 84.0 Reply rate [replies/s]: min 374.8 avg 374.8 max 374.8 stddev 0.0 (1 samples) Reply time [ms]: response 0.6 transfer 2.0 Reply size [B]: header 305.0 content 10457.0 footer 0.0 (total 10762.0) Reply status: 1xx=0 2xx=2000 3xx=0 4xx=0 5xx=0 CPU time [s]: user 1.29 system 4.01 (user 24.2% system 75.2% total 99.4%) Net I/O: 3975.4 KB/s (32.6*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0

以下是文本格式访问的统计数据

oneoo@oneoo-pc:~/Desktop$ httperf –server oneoo.com –num-conns 2000 –add-header “accept-encoding: normal” httperf –client=0/1 –server=oneoo.com –port=80 –uri=/ –send-buffer=4096 –recv-buffer=16384 –add-header=’accept-encoding: normal’ –num-conns=2000 –num-calls=1 Maximum connect burst length: 1 Total: connections 2000 requests 2000 replies 2000 test-duration 2.349 s Connection rate: 851.3 conn/s (1.2 ms/conn, <=1 concurrent connections) Connection time [ms]: min 1.1 avg 1.2 max 5.8 median 1.5 stddev 0.2 Connection time [ms]: connect 0.0 Connection length [replies/conn]: 1.000 Request rate: 851.3 req/s (1.2 ms/req) Request size [B]: 83.0 Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples) Reply time [ms]: response 0.6 transfer 0.6 Reply size [B]: header 278.0 content 42562.0 footer 0.0 (total 42840.0) Reply status: 1xx=0 2xx=2000 3xx=0 4xx=0 5xx=0 CPU time [s]: user 0.62 system 1.73 (user 26.2% system 73.7% total 99.9%) Net I/O: 35683.0 KB/s (292.3*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0

从以上数据可以看到 yo2cache 性能挺好的,最高能达到每秒 1500 个并发处理。性能瓶颈是出现在缓存数据的解压与压缩处理上,如果缓存空间足够大的话,可以考虑保存多种格式的缓存数据,就能解决这个瓶颈问题。

而在 deflate 数据压缩方面,因为2级压缩率与4级压缩率所产生的数据量差距不大,但并发性能有一定差距,可以考虑使用 2 级压缩率。

From:http://oneoo.com/articles/httperf-the-pressure-of-a-high-performance-test-tools.html

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏乐沙弥的世界

基于innobakcupex跨实例不完全恢复步骤

   MySQL在基于热备的基础上,可以实现对原有实例的完全或不完全恢复。而很多时候,原有实例部署了DRBD或者MHA等,在这种情况下,基于原有实例进行恢复会影...

993
来自专栏运维小白

13.2 连接mysql

连接mysql 本地连接——>即使没有指定,但默认使用sock连接,使用/tmp/mysql.sock连接 mysql -uroot -p123456 ...

2469
来自专栏F_Alex

SpringCloud-容错处理Hystrix熔断器(五)

3643
来自专栏Hadoop实操

如何使用HAProxy实现HiveServer2服务的LDAP和Kerberos认证负载均衡

温馨提示:要看高清无码套图,请使用手机打开并单击图片放大查看。 Fayson的github:https://github.com/fayson/cdhproje...

5439
来自专栏日常分享

持久化ORM框架——Hibernate与mybatis

  最初SUN公司推出了JavaEE服务器端组件模型(EJB),但是由于EJB配置复杂,且适用范围较小,于是很快就被淘汰了。与EJB的失败伴随而来的是另外一个框...

1103
来自专栏散尽浮华

jenkins配置记录(2)--代码发布流程

在我们的日常运维工作中,使用jenkins来完成业务代码发版上线是至关重要的一环。 前面已经提到在jenkins上添加用户权限的操作,今天重点说下如何在jenk...

6509
来自专栏运维小白

启动zabbix 报错

启动zabbix,提示报错 [root@hf-01 ~]# systemctl start zabbix-server Job for zabbix-serve...

34111
来自专栏AhDung

【处理手记】VS2010SP1安装不上Visual Studio 2010 SP1 SDK的解决办法

想写个VS插件,需要安装VS的SDK,VS2010SP1对应的SDK自然是Visual Studio 2010 SP1 SDK,下载页面:

2823
来自专栏Netkiller

跟我学 systemd

跟我学 systemd 摘要 我的系列文档 Netkiller Architect 手札Netkiller Developer 手札Netkiller PHP ...

38112
来自专栏杂烩

一个综合的分布式项目之功能代码 原

    看过第一篇博客的应该都知道流程,虽然并不是一模一样,但大体是一样的,现在来确认具体方案。

3012

扫码关注云+社区

领取腾讯云代金券