Age | Commit message (Collapse) | Author |
|
* Use the correct key prefix
* Clear old cache keys
TODO:
At some point we could remove clearing old cache keys.
|
|
|
|
|
|
|
|
|
|
This commit adds a number of _html columns and, with the exception of Note,
starts updating them whenever the content of their partner fields changes.
Note has a collision with the note_html attr_accessor; that will be fixed later
A background worker for clearing these cache columns is also introduced - use
`rake cache:clear` to set it off. You can clear the database or Redis caches
separately by running `rake cache:clear:db` or `rake cache:clear:redis`,
respectively.
|
|
|
|
|
|
|
|
We did a small experiment to see how a full scan of the Redis keys on
gitlab.com speeds up as we increase the batch size. The values on the
right are time in seconds for a full scan (no delete operations).
count: 10); 284.500529021
count: 100); 86.21216934
count: 1_000); 60.931676195
count: 10_000); 60.96355610
count: 100_000); 62.378172541
It looks like 1,000 is a good number.
|
|
|
|
This allows 'rake cache:clear' to delete millions of keys without
choking. It requires Redis 2.8.0 or newer but we needed that already
anyway.
|
|
|
|
|
|
|