如何为网站设置负载/压力测试?

发布于 2024-08-13 04:55:27 字数 1432 浏览 14 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

初相遇 2024-08-20 04:55:27

查看 JMeter。我发现开始使用有点棘手,但是一旦设置好测试,运行起来就很容易了。他们在此处提供了有关如何设置分布式测试的教程。

Check out JMeter. I found it a little tricky to get started with but once you have your tests setup it's easy to run. They have a tutorial on how to setup distributed testing here.

苏辞 2024-08-20 04:55:27

一般来说,负载测试将运行具有各种用户负载的常见场景。

例如,您可以设置一个测试,其中每秒有 50 个用户登录,持续 10 分钟,另一个测试的数量从 5 个用户/秒开始,扩展到每秒 1000 个用户,或者任何对您有意义的数字您的网站。

编辑:
这个想法是测试您的实际应用程序在所有层使用时的行为方式。
如果您要进行负载测试,绝对要投资(时间和/或金钱)在一个好的工具上。

Generally speaking load tests will run through common scenarios with various user loads.

So for example, you might set up a test wherein 50 users login every second for 10 minutes and another where the number starts at 5 users/second and scales up to 1000 / second or whatever numbers make sense for your your site.

edit:
The idea is to test how your actual application behaves when in use across all tiers.
If you are going to be load testing, definitely invest (time and or $) in a good tool.

折戟 2024-08-20 04:55:27

以下是可帮助您开始使用此工具的工具列表。您想要先阅读它是对的,压力测试可能会变得复杂。

http://www.softwareqatest.com/qatweb1.html

Here's a listing of tools that will help get you started with this. You're right to want to read up on it first, stress testing can get complicated.

http://www.softwareqatest.com/qatweb1.html

南街九尾狐 2024-08-20 04:55:27

正如您从这个问题的答案中看到的,有很多程序可用于负载测试。根据我的经验,我发现 Siege 是我个人的最爱。它很简单,提供了进行负载测试所需的大部分选项。下面是一个示例用法:

seige -c 10 -t 1M http://www.google.com

这将在 1 分钟内向 google.com 发送 10 个并发请求。如果您想测试多个页面,您还可以提供一个包含 url 列表的文件。

请注意,当您想要测试单个或一组 URL 时,像 seige 这样的工具是合适的。如果您想测试更复杂的流程(例如用户登录、提交条目、注销),那么您将需要使用类似 selenium 的东西。

As you can see by the answers to this question, there are lots of programs available for load testing. In my experience I have found Siege to be my personal favorite. Its simple, provides most of the options needed to do load testing. Here is an example usage:

seige -c 10 -t 1M http://www.google.com

This will send 10 concurrent requests to google.com for 1 minute. If you want to test more than one page you can also provide a file which contains a list of urls.

Note that a tool like seige is appropriate when you have a single or set of urls that you would like to test. If you want to test more complicated flows (e.g. user logs in, submits entry, logs out) then you will want to use something like selenium.

披肩女神 2024-08-20 04:55:27

对于现有站点或替代站点,第 1 步是收集和分析。统计数据。

如果超出中心限制,则首次建模预测就没有意义。 (无论如何,他们都会以严格的方式提出)

并且在所有情况下,您都应该与来自国家奥委会的人员合作。原因太明显了,这里支持英雄方法的帖子对你的公司不利;尤其是当你边走边学的时候。并不是说你不能成为英雄,但众所周知,国家奥委会对决策会议上落下的绩效数据非常好斗。

Step number 1 for an existing site or a replacement for the same is to gather and analyze. Statistics.

No point in first modeling predictions if they are outside the central limit. (They will come out in a rigorous approach anyway)

And in all cases, you should be working in concert with someone from the NOC. Reasons are too obvious and the thread here that supports a hero approach is not good for your company; especially as you will be learning as you go. Not to say that you can't be a hero, but NOC's are notoriously belligerent to performance numbers that are dropped in their lap in a decision making meeting.

夏花。依旧 2024-08-20 04:55:27

首先,获取一个网络压力工具,例如 Neoload

对许多用户活动进行建模,并使您的测试偏向于预测的用户模式,然后根据您认为合适的情况扩大负载。对数据库运行查询并测量响应时间不会告诉您任何有关用户体验的信息。相反,通过对用户活动进行建模,您可以准确地衡量您的服务器/系统在实际负载下的响应方式,因为这就是您将生成的负载。

用户活动建模可能会变得相当复杂,但是像 Neoload 这样的优秀压力工具可以让您对访问服务器的任何机器的确切行为进行精确建模。理想情况下,您将像平常一样构建网络流量,因此如果您有负载平衡器,请确保使用负载平衡器。

First, get a web-stressing tool like Neoload.

Model a number of user activities and bias your test to correspond to predicted user patterns, then scale load up as you see fit. Running queries against the database and measuring response time tells you nothing about user experience. Rather, by modeling user activities, you can gauge exactly how your server/system will respond under real load, as that's what you'll be generating.

User activity modeling can get pretty complex, but good stress tools like Neoload let you closely model the exact behavior of any machine hitting your server. Ideally, you would craft network traffic just as you would normally, so make sure to hit your load balancer if you've got one.

舂唻埖巳落 2024-08-20 04:55:27

我发现 Visual Studio 测试版更容易测试(尽管它不是免费的)。您可以将浏览会话记录为单个测试,这样您就可以轻松地从网络服务器和数据库中读取性能统计数据。

您应该采取的第一步是查看 IIS 日志以了解那里发生了什么。 Log Parser 2 是我使用的工具 应该得到IIS 登录到数据库。

查询该信息将使您了解峰值负载。

下一步是制定一个或两个测试目标。您是否需要确保网站能够处理单个页面上的峰值负载或每秒两个 X 请求?

您是否打算增加站点的客户,在这种情况下,采用当前的 IIS 日志负载和论坛 web 测试,可以模拟该范围的页面请求,但为预期的并发用户加载。

如果您打算更改站点上的功能,您可以进行基线负载测试并比较对站点进行任何更改后的性能。

负载测试的真正目标是证明应用程序和硬件能够处理业务认为可接受的目标负载,并且仍然在合理的时间内返回页面。

I found Visual Studio Test edition easier to test with (though it is not free). You can record a browsing session as a single test and it will allow you to read the perfmon stats from both your webserver and database easily enough.

The first step you should take is to look at your IIS logs to find out what is going on there. Log Parser 2 is the tool I would use should get the IIS logs into a database.

Querying that will give you an idea of peak load.

Next step is to formulate a goal or two for the testing. Do you need to make sure the website is able to handle spike loads on a single page or two of X requests per second?

Are you intending on increasing the customers of the site, in which case take the current IIS log load and forumlate webtests that can simulate that range of page requests, but load for the expected concurrent users.

If you are intending to change functionality on the site, you can do a baseline loadtest and compare the performance after any changes to the site.

The real goal in load testing is to prove that the application and hardware are able to handle a target load that the business finds acceptable and still returns pages within a reasonable time.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文