一个 GAE 实例中有多少用户?
我在 Google App Engine 上使用 Python 2.5 运行时。不用说,我有点担心新的成本,所以我想更好地了解我将经历什么样的交通量。
如果 10 个用户同时访问 myapplication.appspot.com 上的应用程序,会产生 10 个实例吗? 如果不是,一个实例中有多少用户?甚至是这样测量的吗?
我已经查看了 http://code.google.com/appengine/docs /adminconsole/instances.html 但我只是想确保我的解释是正确的。
I'm using the Python 2.5 runtime on Google App Engine. Needless to say I'm a bit worried about the new costs so I want to get a better idea of what kind of traffic volume I will experience.
If 10 users simultaneously access my application at myapplication.appspot.com, will that spawn 10 instances?
If no, how many users in an instance? Is it even measured that way?
I've already looked at http://code.google.com/appengine/docs/adminconsole/instances.html but I just wanted to make sure that my interpretation is correct.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 HTTP 的角度来看,“用户”是一个相当无意义的术语。重要的是在给定的时间间隔内您可以处理多少请求。这主要取决于您的应用程序处理给定请求所需的时间。显然,如果您需要 200 毫秒来处理一个请求,那么一个实例每秒最多可以处理 5 个请求。
当 App Engine 处理请求时,会将其添加到队列中。只要实例可以执行工作,它就会从队列中取出最旧的项目并服务该请求。如果请求在队列中等待的时间(“待处理延迟”)超过您在管理控制台中设置的阈值,调度程序将启动另一个实例并开始向其发送请求。
显然,这已经被大大简化了,但可以让您大致了解调度程序的工作原理。
"Users" is a fairly meaningless term from an HTTP point of view. What's important is how many requests you can serve in a given time interval. This depends primarily on how long your app takes to serve a given request. Obviously, if it takes 200 milliseconds for you to serve a request, then one instance can serve at most 5 requests per second.
When a request is handled by App Engine, it is added to a queue. Any time an instance is available to do work, it takes the oldest item from the queue and serves that request. If the time that a request has been waiting in the queue ('pending latency') is more than the threshold you set in your admin console, the scheduler will start up another instance and start sending requests to it.
This is grossly simplified, obviously, but gives you a broad idea how the scheduler works.
首先,不。
每个用户一个实例是不合理的并且不会发生。
那么您会问我的应用程序如何扩展到更多实例?取决于负载。
如果每秒有很多请求,那么您将(自动)获得另一个实例,以便分配负载。
这就是 App Engine 背后的核心理念。
First, no.
An instance per user is unreasonable and doesn't happen.
So you're asking how does my app scale to more instances? Depends on the load.
If you have much much requests per second then you'll get (automatically) another instance so the load is distributed.
That's the core idea behind App Engine.