Yasser
Yasser

Reputation: 1808

Random memcache calls take extra-ordinarily long

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 taking longer than others. Any explanation?

enter image description here

Upvotes: 2

Views: 181

Answers (1)

Shay Erlichmen
Shay Erlichmen

Reputation: 31928

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.

Upvotes: 1

Related Questions