如何测试/模拟网站的并发连接?
我想测试当有 5000 个并发连接时我的网站(或某些页面或查询)的访问时间。我想在高流量网站上测试它。
是否可以模拟5000个并发连接?如果不是,人们如何测试这种情况?
I would like test access time for my website (or certain page, or query) when there are 5000 concurrent connections. I want to test it for a high traffic website.
Is it possible to simulate 5000 concurrent connections? If not, how do people test such situations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我们之前使用 httperf 来实现此目的。该工具还为您提供一些指标,例如吞吐量。 这里有一个网站,其中列出了一堆开源性能工具,其中大多数与网络性能测试。
We used httperf for this before. This tool also gives you some metrics like throughput. There is a website here which has a bunch of open source performance tools listed, most of them related to web performance testing.
最后我找到了一项允许测试的服务:
https://loader.io/
免责声明:我对这项服务没有任何了解。我将其发布在这里,也许对某人有帮助。
Finally I've found a service that allows to test:
https://loader.io/
Disclaimer: I have nothing with this service. I post it here, maybe it helps someone.
有一些负载测试包。 HP 有一个工具调用 LoadRunner,如果点击数据表,它有更多信息。还有一个名为 OpenSTA 的开源工具。我刚刚通过谷歌搜索发现了这一点,所以我不能告诉你太多关于它是如何工作的。
There are a few load testing packages out there. HP has a tool call LoadRunner, if you click on the datasheet, it has more information. There also is an open source tool call OpenSTA. I just found that with a google search, so I can't tell you much about how that one works.
你可以使用像 jmeter 这样的东西。我们用它来测试铅。它允许您模拟各种用户活动作为测试用例、运行并发连接、提交表单,甚至登录操作。
如果您需要做的事情很复杂,那么学习曲线可能会很陡峭,但那是因为它的功能非常丰富!
You could use something like jmeter. We use this for lead testing. It allows you to simulate all sorts of user activity as test cases, run concurrent connections, submit forms, even logged in actions.
The learning curve can be steep if what you need to do is complicated, but that's because it's so feature rich!
如果您尝试在服务器上进行测试,请使用
-c
是并发连接数-t
是每个并发连接的时间量If you're trying to test this on as server use
-c
is the number of concurrent connections-t
is the amount of time per concurrent connections