英文:
How to limit google app engine instances to just one?
问题
我正在使用Go语言,使用通道和锁来在不同的线程/协程之间进行通信似乎是一种很好的做法,而不是使用数据存储。然而,如果有多个实例在运行,似乎无法在两个实例之间进行通信。是否有办法使其不打开第二个实例,即使有高流量?
英文:
I'm using go language and it seems good practice to communicate between different threads/routines by channels and locks instead of datastore. However, it appears that it's not possible between two instances if there's more than one instance running. Is there a way to make it not open a second one, even if there's high traffic?
答案1
得分: 9
要回答标题中的问题:
转到应用程序仪表板,在左侧您会找到一个“应用程序设置”链接。在管理界面中,您会找到两个滑块,将第一个滑块拖到最左边,将第二个滑块(“最小挂起延迟”)拖到允许的最大值(右边)。最后但并非最不重要的是,优化您的请求响应时间。
即使您执行了上述操作,也不能保证GAE不会启动第二个实例。
英文:
To answer the question in the title:
Go to app dashboard, on left you will find a Application settings
link. In the admin UI you will find two sliders, drag the first one at the very left and the second (Min pending Latency
) to the max allowed value (right). And last but not least, optimize your request response time.
Even if you do the above there's no guarantee that GAE will not fire up a second instance.
答案2
得分: 0
我不认为这是绝对正确的方法.. 你必须从设计的第一天开始考虑可扩展性问题.. 正如Christopher所说,我会选择使用memcache!
英文:
I don't think it is absolutely the right approach .. You have to think about scalability issues from the first day of your design .. As christopher said I would go with memcache!
答案3
得分: 0
如果您想要精细控制实例的生成和关闭,您应该使用Backends。
英文:
You should use Backends if you want fine to control the spawning and shutdown of instances.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论