Google App Engine - 内存缓存 - 热键警告
Google App Engine - Memcache - Hot key warning
我注意到有时我会收到以下标有红色的警告消息:
热键警告(内存缓存计算单元)/
您有大量负载集中在仅 4 个值
第一个key有56%的流量百分比,后面3个有6-7%。
我的问题是:这是一个主要问题吗?它对应用程序性能有什么影响? (如果memcache中的值消失了,它们将从datastore中加载)
我在 memcache 中有 108 个项目,总缓存大小为 286KiB
在内存缓存键空间中分配负载是内存缓存最佳实践
Distribute load across your memcache keyspace. Having a single or
small set of memcache items represent a disproportionate amount of
traffic will hinder your app from scaling. This applies to both
operations/sec and bandwidth. The problem can often be alleviated by
explicit sharding of your data. For example, a frequently updated
counter can be split among several keys, reading them back and summing
only when a total is needed. Likewise, a 500K piece of data that must
be read on every HTTP request can be split across multiple keys and
read back using a single batch API call. (Even better would be to
cache the value in instance memory.) For dedicated memcache, the peak
access rate on a single key should be 1-2 orders of magnitude less
than the per-GB rating.
https://cloud.google.com/appengine/docs/adminconsole/memcache
我注意到有时我会收到以下标有红色的警告消息:
热键警告(内存缓存计算单元)/ 您有大量负载集中在仅 4 个值
第一个key有56%的流量百分比,后面3个有6-7%。 我的问题是:这是一个主要问题吗?它对应用程序性能有什么影响? (如果memcache中的值消失了,它们将从datastore中加载)
我在 memcache 中有 108 个项目,总缓存大小为 286KiB
在内存缓存键空间中分配负载是内存缓存最佳实践
Distribute load across your memcache keyspace. Having a single or small set of memcache items represent a disproportionate amount of traffic will hinder your app from scaling. This applies to both operations/sec and bandwidth. The problem can often be alleviated by explicit sharding of your data. For example, a frequently updated counter can be split among several keys, reading them back and summing only when a total is needed. Likewise, a 500K piece of data that must be read on every HTTP request can be split across multiple keys and read back using a single batch API call. (Even better would be to cache the value in instance memory.) For dedicated memcache, the peak access rate on a single key should be 1-2 orders of magnitude less than the per-GB rating.
https://cloud.google.com/appengine/docs/adminconsole/memcache