容量规划决定系统是否能够处理负载

发布于 2024-09-18 10:45:24 字数 211 浏览 5 评论 0原文

假设一个基于 Java EE 的电子商务网站运行良好,具有预期的响应时间和吞吐量。该网站正在经历重大的 UI 更改,预计将带来 3 倍的流量。

如何确定现有环境是否可以处理预计的网络流量?

如果我有现有系统的系统利用率(CPU、内存利用率)、吞吐量、响应时间,有没有办法使用一些经验公式来找出它,而无需实际对系统进行负载测试。 (目标是确定在设计阶段本身是否可以满足 SLA)

Lets say a Java EE based e-commerce web site is performing well giving expected response time and throughput. The web site is undergoing major ui changes and it is expected to bring 3 times more traffic.

How do I find out whether the projected web traffic could be handled by the existing environment?

Is there a way to find it out using some empirical formula without actually load testing the system if I have the system utilization (CPU, memory utilization), throughput, response time of the existing system. (The goal is to determine whether the SLAs could be met in the design stage itself)

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

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

发布评论

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

评论(2

木緿 2024-09-25 10:45:24

不,这没有公式,只是有太多相互依赖的因素。获得真实数字的唯一方法是通过实证测试。如果你做不到这一点,你唯一的选择就是寻求硬件容量过剩,并进行有根据的猜测,如下所示:

  • 新的 UI 是否会影响 CPU 使用率?
  • 渲染和传输页面需要更长的时间吗?估计并发量的增加。
  • 更多流量是否也意味着更多数据?如果是,这对性能有何影响?
  • 是否存在任何可能导致并发性意外增加的瓶颈?
  • 并发性的增加如何影响内存使用?
  • 内存使用如何影响文件系统缓存、数据库缓存、JPA 缓存等。
  • 性能 IO 受限吗?还有多少闲置产能可用?
  • 性能受CPU限制吗?还有多少闲置产能可用?
  • 您的内存还有多少剩余容量?

No there is no formula for this, there are just too many interdepend factors for this. The only way to get realistic numbers is by empirical tests. If you can't do this, you're only option is to go for overcapacity in hardware and do an educated guess that would go something like this:

  • Does the new UI impact CPU usage?
  • Does it take longer to render and transfer a page? Estimate the increase in concurrency.
  • Does more traffic also mean more data? If yes, how does this impact performance?
  • Are there any bottlenecks that could lead to an unexpected increase in concurrency?
  • How does the increased concurrency impact memory usage?
  • How does memory usage impact file system cache, database cache, JPA cache, etc.
  • Is performance IO bound? And how much spare capacity is available?
  • Is performance CPU bound? And how much spare capacity is available?
  • How much spare capacity in memory do you have?
如果没有你 2024-09-25 10:45:24

我部分不同意之前的答案。
当然,任何容量规划都涉及创建具有一组(潜在危险)假设的模型。

尽管如此,对以下方面有良好的历史了解:

  • 事务负载(例如 Apache 日志上的 Web 命中)

  • CPU 和内存利用率

负载性能分析,以便通过分析统计技术确定“服务需求”(粗略地说,用于处理单个请求的资源量)。
然后可以将相同的参数输入到排队网络模型中,以估计预期响应时间和吞吐量(其行为在资源饱和程度较高时可能变得高度非线性)。

尽管刚才说了:
- 这不是一个简单的公式

  • 您需要假设新 UI 的效果是 3 倍的负载生成,除此之外(请求的服务需求相同,效率相同)

  • 您正在冒遇到非建模可能瓶颈(例如饱和连接池、网络带宽等)问题的风险,这是容量规划的一般问题。

测试是唯一安全的选择,不幸的是,这种选择往往不可用。

I partly disagree with the previous answer.
For sure any capacity planning involves the creation of a model with a set of (potentially dangerous) assumptions.

Nontheless, having a good historical perspective of:

  • transactional load (e.g. web hits on Apache logs)

  • CPU and memory utilization

load-performance analyses can be built to determine the "Service Demand" (roughly speaking the amount of resources used to process a single request) through analytical statistical techniques.
The same parameter can then be fed into queuing network models to estimate expected response time and throughput (whose behaviour can become highly non-linear at high levels of resource saturation).

Despite what just said:
- it's no easy formula

  • you need to assume that the new UI's effect is 3X load generation and nothing else (same Service demand for a request, same efficiency)

  • you're taking the risk of experiencing issues with the non-modelled possible bottlenecks (e.g. saturated connection pools, network bandwidth, ...) which is a general problem of capacity planning.

Testing is the only safe option, unfortunately too often an option that is not available.

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