一个 Amazon EC2 实例可以服务多少个用户?

发布于 2024-07-12 05:07:53 字数 287 浏览 6 评论 0原文

用途将是从 S3 上的数据提供动态内容。 你可以对“正常”做出任何你认为正常的定义。

小型、中型和大型实例又如何呢?

好的。 人们希望使用一些数据,因此这里:

Web 服务在启动时约为 100kb,并且使用 AJAX,因此不需要重新加载整个页面(如果有的话)。 当它加载页面时,它将向数据库 (S3) 发送 20 - 30 个请求以获取小块文本(如评论)。 一般用户会在页面上停留 10 分钟,偏移量大约为 100kb,通过请求则增加大约 400kb。 假设夜间和白天的点击量相同。

The use will be to serve dynamic content from data on S3. You can make up any definition of "normal" you think is normal.

What about small, medium, and large instances?

Ok. People want some data to work with, so here:

The webservice is about 100kb at start, and uses AJAX, so it doesnt have to reload the whole page much, if at all. When it loads the page, it will send between 20 - 30 requests to the database (S3) to get small chunks of text (like comments). The average user will stay on the page for 10 min, translating to about 100kb at offset, and about 400kb more through requests. Assume that hit volume is the same at night and day.

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

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

发布评论

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

评论(3

眼泪淡了忧伤 2024-07-19 05:07:53

取决于您提供内容的内容和方式,更不用说这些用户访问内容的频率、内容的大小和类型等。您提供的任何信息基本上都无法让我们以任何有意义的方式回答您的问题。

Depends on with what and how you're serving the content, not to mention how often those users will be accessing it, the size and type of the content, etc. There's essentially not one bit of information you've provided that allows us to answer your question in any sort of meaningful way.

旧城烟雨 2024-07-19 05:07:53

正如其他人所说,这可能需要在您的具体条件下进行测试。 幸运的是,如果您愿意设置服务器设置的测试版本,则可以生成模拟用户的实例。 创建一堆这样的测试实例,并在它们上运行 Apache 的 ab 基准测试工具,将它们引导到您的测试站点。 如果实例与您的测试站点位于同一可用区,则您无需支付带宽费用,只需按运行实例的小时数付费。 运行一个不到一个小时的测试,然后关闭测试实例,组织这个压力测试的成本非常低。

作为一个数据点,在我的小型实例(为数据库密集型 Drupal 站点提供服务)上本地运行 Apache ab 工具时,它报告了服务器每秒处理 45-60 个请求的能力。 我假设 ab 是一个合理的基准测试工具,我可能是错的,但这就是我所看到的。

作为建议,由于不太了解您的具体情况,我会将您的数据库移动到弹性块存储(EBS)卷。 S3 并不是真正用于托管数据库,它的延迟可能会降低您的性能。 如果您担心的话,可以轻松地将 EBS 卷快照到 S3 进行备份。

As others have said, this might require testing under your exact conditions. Fortunately, if you're willing to go as far as setting up a test version of your server setup, you can spawn instances that simulate users. Create a bunch of these test instances, and run Apache's ab benchmarking tool on them, directing them at your test site. If the instances are within the same availability zone as your test site, you won't be charged for bandwidth, just by the hour for the running instances. Run a test for under an hour, shutting down the test instances afterward, and it will cost you very little to organize this stress test.

As one data point, running the Apache ab tool locally on my small instance, which is serving up a database-heavy Drupal site, it reported the ability of the server to handle 45-60 requests per second. I'm assuming that ab is a reasonable tool for benchmarking, and I might be wrong there, but this is what I'm seeing.

As a suggestion, not knowing too much about your particular case, I'd move your database to an Elastic Block Store (EBS) volume. S3 is not really intended to host databases, and the latency it has might kill your performance. EBS volumes can easily be snapshotted to S3 for backup, if that's what you're worried about.

氛圍 2024-07-19 05:07:53

有人可能会说,如果设计得当,一个实例可以支持多少用户并不重要。 理想情况下,当您的实例饱和时,您可以启动一个新实例来管理流量。

显然,这使部署和设计变得非常复杂。

但除此之外,EC2 实例实际上是一个低端 Linux 机器(取决于您选择的型号)。

让我们重新表述一下这个问题,您想要支持多少用户?

One can argue that properly designed, it doesn't matter how many users an instance can support. Ideally, when your instance is saturated, you fire up a new instance to manage the traffic.

Obviously, this grossly complicates the deployment and design.

But beyond that, an EC2 instance a low end Linux box, effectively (depending on which model you choose).

Let's rephrase the question, how many users do you want to support?

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