Optimize indices_to_evict_check with a single batch
Background
indices_to_evict_check
runs on full records of zoekt_indices
. This can put too much stress on the database. The second issue could be that in a single run, all indices might not get processed and they will get re-enqueue after 10 minutes which will increase redundancy.
Proposal
Publish the event in the scheduling_service
without any indices_id. In the worker IndexToEvictEventWorker
add order(:id)
and limit(1000)
to process just one batch.