App Engine 高 CPU 警告 - 这真的是一个问题吗?

发布于 2024-10-21 14:00:26 字数 352 浏览 6 评论 0原文

我最近完成了我的应用程序并开始测试。我的一个 主要资源进行了14次RPC,我已尽一切努力减少CPU 时间,即将属性标记为未索引,但我真的不能 减少请求中发生的 GET、PUT 和查询的数量。

今天与请求相关的平均 CPU 时间是:

ms=381 cpu_ms=1192 api_cpu_ms=1122 cpm_usd=0.033597

这确实会波动并且可能会更少,但很少会下降 足以消除高 CPU 警告。

我注意到我的应用程序仍然可以很好地扩展,我有大约 15 个实例 测试时运行。

所以我的问题是,我应该担心高 CPU 警告还是 这是大多数人都会经历的事情吗?

I recently finished my app and have since began testing. One of my
main resources makes 14 RPCs, I have made every effort to decrease CPU
time, i.e., marking properties as unindexed, however I really cannot
reduce the number of GETs, PUTs and queries that occur in the request.

The average CPU times associated with the request today is:

ms=381 cpu_ms=1192 api_cpu_ms=1122 cpm_usd=0.033597

This does fluctuate and can be less, however it rarely falls low
enough to have the high CPU warnings removed.

I've noticed my app still scales fine, I have about 15 instances
running whilst testing.

So my question is, should I be concerned at the high CPU warnings or
is it something most people experience?

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

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

发布评论

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

评论(3

心是晴朗的。 2024-10-28 14:00:26

只要您的挂钟时间(这些计时中的第一次)平均少于 1000 毫秒,您的应用程序就会继续正常自动缩放,无论您的应用程序使用多少 CPU 毫秒。正如 systempuntoout 所解释的,高 CPU 警告是我们在每个 URL 上限制高 CPU 请求时遗留下来的,并且不再适用,除非作为优化指南。

As long as your wallclock time (the first time in those timings) averages less than 1000ms, your app will continue to autoscale just fine, regardless of how many CPU ms your app uses. As systempuntoout explains, the high CPU warnings are a holdover from when we limited high CPU requests on a per-url basis, and no longer apply except as a guide for optimisation.

春花秋月 2024-10-28 14:00:26

如果您的应用程序无法优化,但 CPU 使用情况适合您的日常预算,我认为您可以忽略此警告,无需担心。

几年前,特定时间内的高 CPU 请求数量是有限的,并且警告对于监视和纠正应用程序以使其保持在特定配额之上非常有用;然后该限制被删除,高 CPU 警告现在仅用于识别应检查优化的程序部分(如果可能)。

If your application can't be optimized but the CPU usage is fine for your daily budget, I think you could ignore this warning without any concern.

Years ago, the number of High CPU Requests in a specific time was limited and the warning was useful to monitor and correct the application to stay above that specific quota; that limit was then removed and the High CPU warning is now useful just to identify part of the program that should be checked for optimization (where possible).

小傻瓜 2024-10-28 14:00:26

在实践中,即使我在后台运行许多长时间运行的作业(例如,昂贵的映射缩减作业),我也从未遇到过没有足够的实例来处理用户请求的问题。当然,您的预算需要涵盖 CPU 费用,否则您的应用程序将无法运行。

但是,我记得在文档中读到,如果您的大多数请求需要很长时间,那么应用程序引擎可能不会启动额外的实例来处理请求。但是,如果您的大多数请求都能快速得到满足,那么少数长时间运行的作业应该不会造成任何问题。 (不幸的是,我目前找不到包含有关长时间运行请求的具体指导的文章/文档。)

In practice, I've never had an issue with not enough instances being spun up to handle user requests even if I am running many longer-running jobs in the background [e.g., an expensive mapreduce job]. Of course, your budget needs to cover your CPU expenses or your app won't be able to operate.

However, I remember reading in the docs that if the majority of your requests take a long time, then app engine might not spin up additional instances to handle requests. However, if the majority of your requests are served quickly, then a minority of long-running jobs shouldn't cause any problems. (Unfortunately, I can't find the article/docs with the specific guidance on longer running requests at the moment.)

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