开发者

Random memcache calls take extra-ordinarily long

开发者 https://www.devze.com 2023-04-07 06:23 出处:网络
Please see this appstats log, randomly some memcache calls take extraordinarily longer than others.These are all get calls for memcached counters so there is absolutely nothing different about the cal

Please see this appstats log, randomly some memcache calls take extraordinarily longer than others. These are all get calls for memcached counters so there is absolutely nothing different about the calls that are takin开发者_运维问答g longer than others. Any explanation?

Random memcache calls take extra-ordinarily long


Memcache like all GAE service is done using a remote procedure call and the response time is not generated. If the machine/network is busy it might lag.

The real question here is way are you calling memcache 20 times in a single request?
There are two ways go work around it:

  1. Use the get_multi to retreive all the values at once (if possible)
  2. Use the async memcache, start retrving the values but don't wait for them use them when they are all ready.
0

精彩评论

暂无评论...
验证码 换一张
取 消