Weighttp对Jetty做压力测试,长连接和短连接测试

本文通过weighttp对Jetty进行压力测试,发现在对动态网页进行短连接访问时出现request failed的情况。经过排查,发现原因是Jetty在特定情况下未正确设置content-length或Transfer-Encoding,导致weighttp解析错误。解决方案是在Jetty服务器返回的消息头中强制添加Transfer-Encoding: chunked字段。
摘要由CSDN通过智能技术生成

用weighttp对jetty做压力测试

1、对静态网页数据(可以确定数据长度)的访问测试,包括长连接和短连接,正常

2、对动态网页,servet的长连接访问,正常

3、对动态网页、servlet的短连接访问,request failed

示例:

1、静态页面

[root@server1 ~]# weighttp -n 1  -k http://192.168.30.13:8080
weighttp - a lightweight and simple webserver benchmarking tool

Request (94):
==========
GET / HTTP/1.1
Host: 192.168.30.13:8080
User-Agent: weighttp/0.3
Connection: keep-alive

==========
host: '192.168.30.13', port: 8080
starting benchmark...
spawning thread #1: 1 concurrent requests, 1 total requests
progress: 100% done

finished in 0 sec, 38 millisec and 626 microsec, 25 req/s, 56 kbyte/s
requests: 1 total, 1 started, 1 done, 1 succeeded, 0 failed, 0 errored
status codes: 1 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 2237 bytes total, 203 bytes http, 2034 bytes data

2、数据

[root@server1 ~]# weighttp -n 1  -k http://192.168.30.13:8080/d.txt
weighttp - a lightweight and simple webserver benchmarking tool

Request (99):
==========
GET /d.txt HTTP/1.1
Host: 192.168.30.13:8080
User-Agent: weighttp/0.3
Connection: keep-alive

==========
host: '192.168.30.13', port: 8080
starting benchmark...
spawning thread #1: 1 concurrent requests, 1 total requests
pr
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值