Answer the question
In order to leave comments, you need to log in
How to clean up stale data in a high load collection?
Hello. There are two shards, a collection with a load of about 600 add and update requests per second. There was a problem with cleaning up obsolete records. The first solution was to write a utility that would run during the minimum load and remove obsolete entries. But after launching the utility, the removal blocked the work (as expected) and at the same time worked for 12 hours, which is unacceptable. Then we introduced a TTL index, but this also led to a large number of queues and an increased load on the CPU. Advise on the best approach to deleting obsolete data on a heavily loaded system. Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Add 2 more shards, and periodically switch from one to another. While the second one is working, clear the first one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question