虚拟500个用户同时对数据库进行插入操作,每个用户循环插入30条数据。该怎么设计呢
本帖最后由 bustersword 于 2011-5-5 09:47 编辑我的脚本是单用户登陆系统并插入2张图片,然后注销,
然后我迭代插入的action15次。什么参数化,关联,搞好后,我就放到controller中了,虚拟500个用户,直接运行- -
然后结果就是数据库了只进入了1000多条数据,理论上应该有15000条数据的.......我感觉是时间太紧凑了,用户之间的操作,来不及响应?
我也设置thinktime的,难道没用么?
大大们给点帮助,谢谢了,第一次用loadrunner测试系统.....实在没办法老大突然叫测性能,我了个去,叫我一个开发的做测试,还好以前摸过loadrunner,不过也只是鸡毛蒜皮,实在没办法,求助大大们,帮帮忙
以上的 丢失 ,我通过改写脚本,不会出现这么大量的丢失了,是我脚本每写好的原因,现在的问题是我下面遇到的。。。请大家看接下去回答的部分,需要翻页,真不好意思 19楼往下 脚本在那台负载机上可以成功运行 看楼主的情况要么是连接超时,要么是写操作有错误,看日志就明了。 我想问,怎样的脚本在control中运行,才能合理,测出系统的性能 我的脚本是没问题的,少量用户执行,也行,就是500用户- -...... 看你的描述,我决得你现在是单用户执行了15次同样的操作
而不是每个用户执行一次操作后注销. 这个得一步步的来查原因,可能原因太多 明天去公司,把脚本给给位看看,还有什么执行结果,再研究研究 我又来了,今天我用50个用户跑了一遍,成功 导入1500条数据
Maximum Running Vusers:50
Total Throughput (bytes):633,007,167
Average Throughput (bytes/second):831,810
Total Hits:19,750
Average Hits per Second:25.953View HTTP Responses Summary
Transaction Summary
Transactions:Total Passed: 3,950Total Failed: 0Total Stopped: 0 Average Response Time
Transaction NameMinimumAverageMaximumStd. Deviation90 PercentPassFailStop
Action_Transaction5.43413.57322.1492.39716.44175000
inputend0.1061.8095.2021.3483.62275000
inputselect1.4454.4397.5421.1545.69275000
login2.5312.7323.1240.1562.9865000
loginout0.0010.0721.9710.2950.0265000
save10.1652.1815.5911.316475000
save20.1851.685.8050.9452.91475000
vuser_end_Transaction0.0010.0721.9710.2950.0265000
vuser_init_Transaction4.2124.6425.1990.2494.9235000
HTTP Responses Summary
HTTP ResponsesTotalPer second
HTTP_20018,95024.901
HTTP_3028001.051
save1与save2 就是保存数据的transaction
然后 我用100个用户跑的时候,又出问题了,只插入了2731条数据,其实应该插入3000条,又丢失了.....
cenario Name:Scenario1
Results in Session:d:\100users\res\res.lrr
Duration:15 minutes and 43 seconds.
Statistics Summary
Maximum Running Vusers:100
Total Throughput (bytes):1,266,942,752
Average Throughput (bytes/second):1,342,100
Total Hits:39,500
Average Hits per Second:41.843View HTTP Responses Summary
Transaction Summary
Transactions:Total Passed: 7,900Total Failed: 0Total Stopped: 0 Average Response Time
Transaction NameMinimumAverageMaximumStd. Deviation90 PercentPassFailStop
Action_Transaction7.85625.77747.0447.19735.1071,50000
inputend0.0044.0248.9742.166.7581,50000
inputselect2.6868.80514.4182.10411.0921,50000
login0.0731.7513.0940.6362.48210000
loginout0.0010.6572.2660.7852.05310000
save10.1763.25210.3042.286.4871,50000
save20.1312.9318.1422.2585.3991,50000
vuser_end_Transaction0.0020.6572.2660.7852.05310000
vuser_init_Transaction0.3161.9643.4090.6792.69110000
HTTP Responses Summary
HTTP ResponsesTotalPer second
HTTP_20037,90040.148
HTTP_3021,6001.695
Filters: (do not Include Think Time)
下面是个别Vuser的log,这两个用户有处理同一张图片,但是数据库里只记录了test71的数据
Start auto log messages stack.
vuser_init.c(53): Registering web_url("WebResource.axd") was successful
vuser_init.c(61): Registering web_url("logo_cn.png") was successful
vuser_init.c(69): web_concurrent_end was successful, 130304 body bytes, 800 header bytes
vuser_init.c(71): Notify: Transaction "login" started.
vuser_init.c(73): lr_think_time: 3.00 seconds.
vuser_init.c(75): Redirecting "http://192.169.10.12/impweb/index.aspx" (redirection depth=0)
vuser_init.c(75): To location "http://192.169.10.12/impweb/Main/Main.aspx"
vuser_init.c(75): web_submit_data("index.aspx") was successful, 1182 body bytes, 478 header bytes
vuser_init.c(92): Error: 登录用户名---> test1
End auto log messages stack.
Start auto log messages stack - Iteration 1.
Action.c(198): Registering web_reg_save_param was successful
Action.c(203): Registering web_reg_save_param was successful
Action.c(209): Registering web_reg_save_param was successful
Action.c(215): Registering web_reg_save_param was successful
Action.c(223): Redirecting "http://192.169.10.12/impweb/DataInput/DataIInputSelect.aspx" (redirection depth=0)
Action.c(223): To location "http://192.169.10.12/impweb/DataInput/DataInput_Model_1_Horizontal.aspx"
Action.c(223): web_submit_data("DataIInputSelect.aspx_5") was successful, 76050 body bytes, 509 header bytes
Action.c(244): Error: 组别---> 001
Action.c(245): Error: 第一张图片名 : 1001_a_001_001.jpg
Action.c(246): Error: 用户名: test1
Action.c(247): Error: 第一次录入剩余图片数: 1045
End auto log messages stack.
Start auto log messages stack - Iteration 1.
Action.c(315): web_convert_param was successful
Action.c(321): Resource "http://192.169.10.12/impweb/BusinessCardPicture/test0414/test0414/test0429/1001_a_001_001.jpg" is in the cache already and will not be downloaded again
Action.c(335): Registering web_reg_save_param was successful
Action.c(341): Registering web_reg_save_param was successful
Action.c(348): Registering web_reg_save_param was successful
Action.c(354): web_submit_data("DataInput_Model_1_Horizontal.aspx_2") was successful, 12792 body bytes, 223 header bytes
Action.c(383): Error: 第二张图片名 : 1356_b_001_001.jpg
Action.c(385): Error: 第二次录入图片剩余数: 1041
End auto log messages stack.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Start auto log messages stack.
vuser_init.c(53): Registering web_url("WebResource.axd") was successful
vuser_init.c(61): Registering web_url("logo_cn.png") was successful
vuser_init.c(69): web_concurrent_end was successful, 130304 body bytes, 800 header bytes
vuser_init.c(71): Notify: Transaction "login" started.
vuser_init.c(73): lr_think_time: 3.00 seconds.
vuser_init.c(75): Redirecting "http://192.169.10.12/impweb/index.aspx" (redirection depth=0)
vuser_init.c(75): To location "http://192.169.10.12/impweb/Main/Main.aspx"
vuser_init.c(75): web_submit_data("index.aspx") was successful, 1182 body bytes, 478 header bytes
vuser_init.c(92): Error: 登录用户名---> test71
End auto log messages stack.
Start auto log messages stack - Iteration 1.
Action.c(198): Registering web_reg_save_param was successful
Action.c(203): Registering web_reg_save_param was successful
Action.c(209): Registering web_reg_save_param was successful
Action.c(215): Registering web_reg_save_param was successful
Action.c(223): Redirecting "http://192.169.10.12/impweb/DataInput/DataIInputSelect.aspx" (redirection depth=0)
Action.c(223): To location "http://192.169.10.12/impweb/DataInput/DataInput_Model_1_Horizontal.aspx"
Action.c(223): web_submit_data("DataIInputSelect.aspx_5") was successful, 76055 body bytes, 509 header bytes
Action.c(244): Error: 组别---> 001
Action.c(245): Error: 第一张图片名 : 1001_a_001_001.jpg
Action.c(246): Error: 用户名: test71
Action.c(247): Error: 第一次录入剩余图片数: 1046
End auto log messages stack.
Start auto log messages stack - Iteration 1.
Action.c(315): web_convert_param was successful
Action.c(321): Resource "http://192.169.10.12/impweb/BusinessCardPicture/test0414/test0414/test0429/1001_a_001_001.jpg" is in the cache already and will not be downloaded again
Action.c(335): Registering web_reg_save_param was successful
Action.c(341): Registering web_reg_save_param was successful
Action.c(348): Registering web_reg_save_param was successful
Action.c(354): web_submit_data("DataInput_Model_1_Horizontal.aspx_2") was successful, 12792 body bytes, 223 header bytes
Action.c(383): Error: 第二张图片名 : 1002_b_001_001.jpg
Action.c(385): Error: 第二次录入图片剩余数: 1043
End auto log messages stack.
强悍。。。学习中! 求助.......................
为什么用户一多,就丢失数据了............ 看看中间件的配置,另外,loadrunner上没有报错吗?
你把测试场景重新设置一下看看,比如1s登陆2个vuser
我估计时中间件压力太大了,vuser少的时候还可以登陆,多的时候就shut down了,另外,把插入图片的脚本前设置下思考时间 明白了吗?帽子 我觉得thinktime是一种可能,还有可能是不是迭代次数太多了……?? 监控下应用服务器和数据库吧 如果500人全部执行成功,可能是你数据库接收速度跟不上吧 我今天又重新写了下脚本下面是执行的结果
50Vuser *15条数据
一次性加载50VUuser
Analysis SummaryPeriod: 04-05-2011 11:59:14 - 04-05-2011 12:01:54
Scenario Name:Scenario1
Results in Session:d:\res\res\res.lrr
Duration:2 minutes and 40 seconds.
Statistics Summary
Maximum Running Vusers:50
Total Throughput (bytes):86,699,121
Average Throughput (bytes/second):538,504
Total Hits:5,750
Average Hits per Second:35.714View HTTP Responses Summary
Transaction Summary
Transactions:Total Passed: 1,800Total Failed: 0Total Stopped: 0 Average Response Time
Transaction NameMinimumAverageMaximumStd. Deviation90 PercentPassFailStop
Action_Transaction3.7898.6813.4992.33411.4865000
login0.1131.3412.1310.6482.0625000
loginout0.0020.0030.0380.0050.0025000
outInput0.1080.1870.2570.0350.2375000
save10.1672.4816.211.4064.1685000
save20.1540.5524.9650.4320.95370000
SavePicSingle_Transaction0.1540.5534.9660.4320.95370000
startInput0.9025.1236.3991.0926.2655000
vuser_end_Transaction0.110.190.2620.0360.245000
vuser_init_Transaction0.1281.3672.2020.6512.0995000
file:///C:/Documents%20and%20Settings/Administrator/%E6%A1%8C%E9%9D%A2/15%E4%B9%9850%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/15%E4%B9%9850%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/dot_trans.gif
HTTP Responses Summary
HTTP ResponsesTotalPer second
HTTP_2005,65035.093
HTTP_3021000.621
file:///C:/Documents%20and%20Settings/Administrator/%E6%A1%8C%E9%9D%A2/15%E4%B9%9850%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/15%E4%B9%9850%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/dot_trans.gif
file:///C:/Documents%20and%20Settings/Administrator/%E6%A1%8C%E9%9D%A2/15%E4%B9%9850%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/15%E4%B9%9850%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/dot_trans.gif
Filters: (do not Include Think Time)
80Vuser*15条数据一次性加载80Vuser
Analysis SummaryPeriod: 04-05-2011 13:14:16 - 04-05-2011 13:18:32
Scenario Name:Scenario1
Results in Session:d:\res\res\res.lrr
Duration:4 minutes and 16 seconds.
Statistics Summary
Maximum Running Vusers:80
Total Throughput (bytes):138,615,393
Average Throughput (bytes/second):539,360
Total Hits:9,198
Average Hits per Second:35.79View HTTP Responses Summary
Transaction Summary
Transactions:Total Passed: 2,876Total Failed: 4Total Stopped: 0 Average Response Time
Transaction NameMinimumAverageMaximumStd. Deviation90 PercentPassFailStop
Action_Transaction7.77116.74436.3745.22722.5398000
login0.0691.1882.5390.6552.078000
loginout0.0010.0020.0060.0010.0028000
outInput0.0040.2130.8460.0890.2678000
save11.7324.73421.7453.1416.6228000
save20.151.78425.1362.323.1281,11820
SavePicSingle_Transaction0.151.78425.1362.323.1281,11820
startInput0.7968.56411.7962.48110.2538000
vuser_end_Transaction0.0060.2150.8480.0890.278000
vuser_init_Transaction0.2851.3682.5650.5732.1118000
file:///C:/Documents%20and%20Settings/Administrator/%E6%A1%8C%E9%9D%A2/15%E4%B9%9880%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/15%E4%B9%9880%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/dot_trans.gif
HTTP Responses Summary
HTTP ResponsesTotalPer second
HTTP_2009,03835.167
HTTP_3021600.623
file:///C:/Documents%20and%20Settings/Administrator/%E6%A1%8C%E9%9D%A2/15%E4%B9%9880%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/15%E4%B9%9880%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/dot_trans.gif
file:///C:/Documents%20and%20Settings/Administrator/%E6%A1%8C%E9%9D%A2/15%E4%B9%9880%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/15%E4%B9%9880%E7%94%A8%E6%88%B7-%E7%BB%93%E6%9E%9C%E5%88%86%E6%9E%90-2011-5-4/dot_trans.gif
Filters: (do not Include Think Time)