- 模拟10000个用户
- 查看服务器负载 (top load everage 、uptime)
任意一条数据/cpu个数 > 5 超负荷,需要调优
LoaderRunner 填写提交的数据
insert --> new step --> submitData
Action()
{
// web_url("openMain","URL=http://localhost:1080/webtours/",LAST);
// 请求登录前参数
web_reg_save_param("session",
"LB= name=userSession value=",
"RB=>",
"Ord=1",
LAST);
// 自定义函数
web_custom_request("customerOpen",
"URL=http://localhost:1080/webtours/",
"Method=GET",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTML",
"Body=",
LAST);
// 登录请求
web_submit_data("web_submit_data",
"Action=http://localhost:1080/webtours/login.pl",
"Method=POST",
"TargetFrame=",
"Referer=",
ITEMDATA,
"Name=userSession", "Value={session}", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=login.x", "Value=-17", ENDITEM,
"Name=login.y", "Value=-179", ENDITEM,
"Name=login", "Value=Login", ENDITEM,
"Name=JSPFormSubmi", "Value=off", ENDITEM,
LAST);
return 0;
}
变量定义必须放在首行
参数定义可以在任意位置
要求: 事务平均响应时间是 0.005s
1/0.005 = 200
十个用户 2000