问题描述:

Environment: multiple web (30), cache (8) servers and one dedicated database server.

To offload the database, a central Redis cache and local memory cache are in place.

  • Large common event data is cached and updated based on schedules
  • User specific data is cached separately when accessed

Problems arise when al large set of user specific data needs is updated due to an event.

There are about 200K of registered users and about 10K-20K come to the site (simultaneously) when the event occurs. With an average of 5 cache keys / user, that’s a total of 50K - 100K cache keys containing user specific data that needs to be updated.

Current solutions fail:

  1. Flushing the user cache overloads the database (30 webservers)
  2. Loading ALL the data into the cache takes a long time (only 10% is used)
  3. KEYS and SCAN can block the cache (not tried yet... is this a problem?)

What is the best practise in this situation?

相关阅读:
Top