如何对我的 Web 应用程序进行容量规划并确定部署架构?
我在小型 AWS 实例(双核 AMD、2.60 GHz、1.7 GB RAM)上部署了一个 ASP.net Web 应用程序。我想在该服务器上针对 300 个并发用户执行负载测试,并且未来我想为我的应用程序设计 250,000 个注册用户的暂定容量规划和部署架构。
我是这个领域的新手,之前没有做过任何类型的负载测试。
我的用例和场景 申请如下:
场景 - 数据库中有 250, 000 个注册用户
并发 – 5% - 7% - 大约 17,500
每个用户都有一个书架和 假设每个用户都订阅了 10 本书。每本书约 25 MB 大小为 400 页
用例
用户登录
- 数据库认证&授权
查看带有书籍图像的书架
书架 (.swf) - 400 KB(为每个用户加载)
将加载 10 个图书图像(每个图像 20KB)(大约)
catalog.xml - 为用户分配 30 KB/用户
注意:大约 650KB 的数据下载到客户端 机器
浏览书籍:单击以下文件和书籍图像时:它的尺寸将 下载到客户端机器
- 一次
- Reader.swf - 950 KB(首次下载)
- 每本书大约 100 KB 的 XML 数据(点击时)
- Book.xml
- 注释.xml
- 目录.xml
- Usersettings.xml 40KB*4 = 每个用户 160 KB (.swf)
- 注意:大约 1200KB 的数据下载到客户端 机器
建议我如何继续吗?
非常感谢, 阿马尔
I have an ASP.net web application deployed on the small AWS instance (Dual Core AMD, 2.60 GHz, 1.7 GB RAM). I would like to perform load testing on this server for 300 concurrent users and for future, I want to design the tentative capacity planning and deployment architecture for 250,000 registered users for my application.
I am very new person in this area and have not done any kind of load testing before.
The Use-case and scenario of my
application will be as below:Scenario - 250, 000 registered users in database
Concurrency – 5% - 7% - approximately 17,500
Each user has a book shelf and
assuming each user is subscribed for
10 books. Each book is of around 25 MB
in size with 400 pagesUse cases
User Login
- Database authentication & authorization
View Book Shelf with book images
Book Shelf (.swf) - 400 KB (gets loaded for each user)
10 book images will be loaded (20KB per image)(approximately)
catalog.xml - 30 KB / user for allocated for the user
Note: Approximately 650KB of data is gets downloaded on to client
machineBrowse book : On clicking a book image following files & its sizes will
be downloaded to clients machine
- One time
- Reader.swf - 950 KB (first download)
- XML data’s of approximately 100 KB / per book (on click)
- Book.xml
- Annotation.xml
- Catalog.xml
- Usersettings.xml 40KB*4 = 160 KB per user (.swf)
- Note: Approximately 1200KB of data is gets downloaded on to client
machine
Could someone please suggest how can I proceed with this?
Very much thanks in advance,
Amar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此链接:http://support.microsoft.com/kb/231282,包含一些链接对您的网站进行压力测试的工具。
这显然是一个复杂的领域,因此您可能有 250 万注册用户(真的有那么多吗?),但是有多少是并发的,以及他们将使用网站的哪些区域。
所有这些事情(以及更多)都会影响系统的容量规划。
This link: http://support.microsoft.com/kb/231282, has links to some tools to stress test your website.
This is obviously a complicated area, so you may have 2.5 million registered users (really that many?), but how many are concurrent, and what areas of the website will they be using.
All of these things (and many more), will impact the capacity planning for your system.
完成第一个目标(测试 300 个用户)非常简单 - 选择负载测试工具、构建场景并进行测试。然后调整/优化并重复。
但我认为您更大的问题是如何对您的全部容量进行测试和规划 - 您说大约 18k 并发用户。首先,确保该数字(用户群的 7%)是峰值并发数,而不是平均值。您需要测试峰值。
因此,假设您正在规划一个负载平衡的多服务器集群来处理该负载,下一步是确定单个 Web/应用程序服务器的最大容量,而无需使用负载平衡器。这为您提供了一个可用来判断集群性能的基准。这是非常重要的一步,我们的许多客户都会跳过这一步,这对他们自己造成了损害。这很重要,因为在很多情况下,负载平衡系统不会随着集群中服务器的数量线性扩展。理想情况下,它应该和好的系统非常接近。您会惊讶地发现我们经常看到根本无法很好扩展的系统。我们甚至看到一些系统的集群容量实际上低于单个服务器单独处理的容量。
一旦建立了基准,您就可以初步估计所需的服务器总数,并可以构建集群。我建议接下来使用 2 个 Web/应用服务器进行测试。这将使您的容量几乎增加一倍。如果没有,那么您需要在进行更大规模的测试之前确定原因。可能的候选者是负载平衡器设置或数据库(如果单个数据库服务器为所有 Web/应用程序服务器提供服务)。有时,应用程序架构的一些更基本的东西会发挥作用。
当您对从 1 台服务器扩展到 2 台服务器的最佳性能感到满意时,您可以继续扩展到整个集群并测试最大容量。如果您没有看到预期的可扩展性,请准备好回溯 - 使用 3、4、5 个服务器等进行测试。
我希望这会有所帮助!祝你好运:>
Completing the first goal (test 300 users) is pretty straightforward - choose a load testing tool, build the scenarios and test. Then tune/optimize and repeat.
But I think your bigger question is how to approach testing and planning for your full capacity - which you say is ~18k concurrent users. First, make sure that number (7% of user base) is the peak concurrency, not average. You need to test the peak.
So assuming that you are planning a load-balanced multiple-server cluster to handle that load, the next step is to determine the maximum capacity of a single web/app server, without the load-balancer in place. This gives you a baseline that you can use to judge the performance of the cluster. This is a really important step and many of our clients skip this step, to their own detriment. It is important because there are many conditions under which a load-balanced system does not scale linearly with the number of servers in the cluster. Ideally it should and good systems get pretty close. You'd be surprised how frequently we see systems that don't scale well at all. We've even seen a few systems that actually have lower capacity as a cluster than a single server could handle on its own.
Once you have that baseline established, you can make a preliminary estimate about the total number of servers you'll need and you can build your cluster. I recommend next testing with 2 web/app servers. This should nearly double your capacity. If it doesn't then you need to determine why before moving on to larger tests. Likely candidates are the load balancer setup or the database (if a single database server is servicing all the web/app servers). Occasionally something more fundamental to the application architecture is at play.
When you are satisfied that scaling from 1 to 2 servers is performing optimally, then you can proceed to scale up to your full cluster and test maximum capacity. Be prepared to back-track if you don't see the scalability you expected - test with 3, 4, 5 servers, etc.
I hope that helps! Good luck :>