Jmeter - 逐渐增加的压力测试

上一篇 / 下一篇  2011-08-23 13:46:11 / 个人分类:性能测试

今天上午七点起床,本来是准备给客户跑一遍之前的stress case的,结果,客户突然提出要这样的case:
“250个user,过几秒钟,再增加250个user...直到跑完1000个user为止”
(汗,沟通何其不利啊,我们之前发了将近两个礼拜的report,客户原来完全没看过?)

说来很简单,但因为是突然的,而且我完全没有准备,也折腾了很久,开始觉得应该这么做:
1. 用多个thread group跑,每个thread group 250/10,然后两两thread group之间插入一个group,设置一个只一次的controller,再加上一个TEST ACTION (不用timer的原因是,不知道为什么,我设置多久,间隔的永远只有2s,看起来是不起作用的,估计timer只可以对一个thread group的sample起作用,无法起到我想要的那种作用)

2. 但是#1这样有个问题啊,变成250个请求发完才发下面250个。。。这样不对的,我们应该只是想逐渐增加压力而已,所以改成了在thread group中设置schedule下面的start up delay,注意,如果设置了这个值,那么start time是不起作用的了,但是也请注意,end time还是起作用的,如果end time还保持了过去,那么悲剧的就是,当前这个thread group只会run 第一个请求(一个thread group中有7个请求),开始被折腾的焦头烂额啊。。死活想不通,后来无意中发现了,汗

3. 如果要实现#1那种也不用那么麻烦了,其实也可以用这个schedule下面的start up delay,不过记得test plan中要选run thread groups consecutively,就可以了


不过我还有个疑问,这样跑的case,最后出来的聚合报告中的吞吐量,总的时间上去了,是否影响到了呢,目前还不清楚,jmeter帮助中是这么说的(如下),但它是说in the same thread,我现在是不同的thread,不知道是什么情况呢。。。
JMeter takes into account the total time over which the requests have been generated. If other samplers and timers are in the same thread, these will increase the total time, and therefore reduce the throughput value”

anyway,总归算记录下今天的新发现了,呵呵,虽然工作还在继续。。。(演示给客户看的时候居然又报错了,之前internal 跑的时候就全pass,汗)

TAG: Jmeter JMeter jmeter JMETER stress

 

评分:0

我来说两句

Open Toolbar