How to deal with an expiring item (due to TTL) in memcached on a high load website?

When you have peaks at 600 requests per second, then memcache, which flushes the item due to TTL expiration, has some pretty negative effects. Almost at the same time, 200 threads / processes find that the cache is empty and the database query fire to fill it again

What is the best practice for dealing with these situations?

ps what is the term for this situation? (gives me a chance to improve Google results on the topic)

+3
source share
2 answers

memcached , ( ), cron, . , TTL. : , (, , , ).

, memcached " ", : http://code.google.com/p/memcached/wiki/NewProgrammingTricks#Avoiding_stampeding_herd

, .

+6

, , , , .

, , :

  • , , , , . , ,

  • , TTL , . , , - - 10% , . , , , .

0

Source: https://habr.com/ru/post/1754807/


All Articles