如何防止AppEngine memcache刷新 [英] How do I prevent AppEngine memcache flushes

查看:90
本文介绍了如何防止AppEngine memcache刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在使用AppEngine的内存缓存来存储会话信息(会话令牌)并缓存一些HTML数据。我们整体的内存缓存使用率大多数时间都在1 MB以下。



在几分钟后我们如何防止缓存刷新(今天早上我们有一个40分钟后只有25 KB)。昨天(2013-10-15 21:30 UTC - 2013-10-15 21:45)我们有2到7秒钟的时间刷新(低于20 KB的数据)?

解决方案

使用默认的空闲memcache,应用程序memcache数据与其他AppEngine应用程序一起存储,所以如果其他应用程序导致可用内存填满,那么您的数据是与他们一样可能过期(请参阅 https://developers.google.com/应用服务引擎/文档/ adminconsole /记忆快取)。因此,您的应用程序不应该指望缓存的值始终可用。



然而,您可以将应用程序配置为使用专用的内存缓存(在管理控制台中的应用程序设置下)。这为您的应用程序专用内存专用,但每GB每小时0.12美元。

We are currently using AppEngine's memcache to store session information (session tokens) and to cache some HTML data. Our overall memcache usage is below 1 MB most of the time.

How do we prevent the cache to flush after a few minutes (this morning we had a after 40 minutes with only 25 KB). Yesterday (2013-10-15 21:30 UTC - 2013-10-15 21:45) we had flushes sometime within 2 to 7 seconds (with below 20 KB of data)?

解决方案

With the default free memcache your apps memcache data is stored along with that of other AppEngine apps, and so if the other apps cause the available memory to fill up then your data is just as likely to be expired as theirs is (see https://developers.google.com/appengine/docs/adminconsole/memcache). Therefore your application should not expect a cached value to always be available.

You can however configure your app to use Dedicated memcache (in the admin console, under Application Settings). This dedicates specific memory for your apps use only but comes at a cost of $0.12 per GB per hour.

这篇关于如何防止AppEngine memcache刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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