GAE Go - “此请求导致您的应用程序启动新的进程...”。 [英] GAE Go - "This request caused a new process to be started for your application..."

查看:151
本文介绍了GAE Go - “此请求导致您的应用程序启动新的进程...”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在第二次遇到这个问题,我想知道是否有解决方案。我正在Google App Engine上运行一个应用程序,该应用程序依靠通过 HTTP JSON RPC 。看起来,GAE倾向于在日志中随机显示这样的消息:


此请求导致启动一个新进程对于您的应用程序而言,
因此导致您的应用程序代码首次被加载
此请求可能需要更长的时间,并且比您的应用程序的典型
请求使用更多的CPU。


然后重置存储在RAM中的所有变量而不发出警告。无论多次重新设置变量或将新代码上传到GAE,尽管增加应用程序版本号似乎解决了问题,但同样的过程反复发生。



如何获得关于此行为的更多信息,如何避免它,并防止Golang应用程序在Google App Engine上丢失数据?



编辑:



存储在RAM中的变量是小类的字符串,字节,布尔型和指针。没什么太复杂或很大的。

Google App Engine似乎在开始使用较重的秒钟后开始一个新的过程,这应该不够长时间应用程序因未被使用而被关闭。上传到GAE的应用程序,其变量集和创建新进程的时间间隔不到一分钟。 解决方案

您是否意识到GAE是一种基于负载自动管理实例的云托管解决方案?这是人们使用它的主要特征和原因。



当负载增加时,GAE会创建一个新实例,当然,这个实例的所有RAM变量都是空的。



解决方案是不要期望变量可用,或者在请求(会话,memcache,数据存储)结束时将它们存储到永久存储器中,并在它们不存在请求的开始。


I've encountered this problem for a second time now, and I'm wondering if there is any solution to this. I'm running an application on Google App Engine that relies on frequent communication with a website through HTTP JSON RPC. It appears that GAE has a tendency to randomly display a message like this in the logs:

"This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application."

And reset all variables stored in RAM without warning. The same process happens over and over no matter how many times I set the variables again or upload newer code to GAE, although incrementing the app version number seems to solve the problem.

How can I get more information on this behaviour, how to avoid it and prevent data loss of my Golang applications on Google App Engine?

EDIT:

The variables stored in RAM are small classes of strings, bytes, bools and pointers. Nothing too complicated or big.

Google App Engine seems to "start a new process" in matter of seconds of heavier use, which shouldn't be long enough time for the application to be shut down for not being used. The timespan between application being uploaded to GAE, having its variable set and a new process being created is less than a minute.

解决方案

Do you realize that GAE is a cloud hosting solution that automatically manages instances based on the load? This is it's main feature and reason people are using it.

When load increases, GAE creates a new instance, which , of course, has all RAM variables empty.

The solution is not to expect variables to be available or store them to permanent storage at the end of request (session, memcache, datastore) and load them if not present at the beginnig of request.

这篇关于GAE Go - “此请求导致您的应用程序启动新的进程...”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆