在运行 Web 测试时参数化负载测试?
我目前使用 WebTest 来测试系统。用户可以投票,然后无法重新登录以更改其投票。
WebTest 使用 CSV 文件中的用户名列表,并且所有帐户都有一个用于测试目的的默认密码。
由于我不想看到网站对大量并发用户同时登录的反应,我想知道如何参数化负载测试。
有想法吗?解决方案?
I currently using a WebTest to test a system. The user can vote and then can't log back in to change his vote.
The WebTest use a list of username from a CSV file and all the account have a default password for testing purposes.
Since I wan't to see how the website will react with a lot of concurrent user login in at the same time, I wonder how to parametrize the Load Test.
Ideas? Solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我测试了一个解决方案,该解决方案在四个小时内将有多达数十万用户登录。
我们将负载测试转换为编码的 Web 测试,以便调用特定的数据库过程,该过程将为我们提供列表中的下一个登录信息。
我们在此过程中将索引存储到表中,并在每次发出新登录时将其上移一个。
这个存储过程非常简单,但使用数据库并发保护来确保给出的用户与临时表中存储的完全一致。
理想情况下,您不希望在负载测试代码中放置线程阻塞调用(数据库或文件 IO),因为许多虚拟用户共享同一线程。但实际上,这对于我们调用的简单存储过程来说效果很好。
I tested a solution that would have up to a couple hundred thousand users logging in over a four hour period.
We converted our load test to a coded webtest in order to call a specific database procedure that would give us the next login from the list.
We stored an index into the table in this procedure and moved it up one each time a new login was given out.
This stored procedure was very simple, but uses the database concurrency protection to make sure the users were given out exactly as stored in our temp table.
Ideally you do not want to put a thread blocking call (database or file IO) in your load test code as many virtual users share the same thread. In practice however, this worked fine for the simple stored procedure we were calling.