GAE:memcache:在多个应用程序实例中是相同的 [英] GAE: memcache: is it the same across multiple app instances

查看:123
本文介绍了GAE:memcache:在多个应用程序实例中是相同的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常基本的问题:在GAE中,如果我第一次从数据库检索数据时使用memcache存储某些数据,那么如果数据在缓存中保留了2天,请执行所述应用程序会查看它并从缓存中检索它?或者是每个应用程序实例的缓存是分开的?



我这样问是因为我已经看到,由于GAE产生单独的VM进程(而不是线程)对于应用程序需要的每个新实例,过去在所有实例(线程模型中)中保持一致的内容现在每个实例(进程)都是分段的:就像servelet应用程序上下文一样,它不会在同一应用程序的所有实例中传播。 / p>

因此,memcache是​​同一个应用程序的多个实例一致的吗?还是它创建每个实例/进程的缓存数据集?

解决方案

它是一致的; GAE memcache作为与您的实例分开的服务运行。


I have a pretty basic question: In GAE, if I use memcache to store some data once it was retrieved for the first time from the db, if then that data remains in the cache for like 2 days, do ALL instances of said application get to "see" it and retrieve it from cache? Or is the cache separate for each application instance?

I'm asking this because I've seen that due to the way that GAE spawns separate VM processes (not threads) for each new instance an application needs, stuff that used to be consistent across all instances (in the thread model) is now fragmented per instance (process): like the servelet application context which is NOT propagated across all instances of the same application.

So, again, is memcache consisten across multiple instances of the same application, or does it create per instance/process sets of cached data?

解决方案

It's consistent; GAE memcache runs as a service separate from your instances.

这篇关于GAE:memcache:在多个应用程序实例中是相同的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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