python appengine内存缓存优化
我正在 google appengine django nonrel 上开发一个 api,它将满足很多请求。我想缓存重复的请求。 估计会对 api 产生一些非常频繁的查询,我希望能够即时找出这些查询是什么,以便我可以预先缓存它们。有没有办法获取最频繁的内存缓存键?
I am developing an api on google appengine django nonrel that will serve a lot of requests. I would like to cache repeated requests.
It is estimated that there will be some really frequent queries to the api, and I would like to be able to find out what these queries are on the fly so that I may pre-cache them. Is there a way of getting the most frequent memcache keys?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
缓存所有可能频繁出现的内容,并让 Memcache 的 LRU 策略逐出那些访问频率不够高、无法保证保留在缓存中的项目。
Cache everything that might be frequent, and let Memcache's LRU policy evict items that aren't accessed frequently enough to warrant remaining in the cache.
假设您指的是“最频繁的数据存储区查询”,则 appstats 为可能是你需要的。
Presuming you mean "the most frequent datastore queries", appstats is probably what you need.