You've uploaded a couple millions points to your
@qdrant_engine collection: search latency spikes for a few minutes and then goes back to normal.
Many people assume it's a bug, and they change vendor, but it's actually Qdrant doing you a huge favour by running optimizations for you in the background.
I explored how to tune optimizers in this article:
qdrant.tech/articles/tuning-…
But if you want a TL;DR:
- optimizers compete for resources with your queries, as both search and optimizations run on CPU
- in general, optimized collections can give you up to 100x faster search than unoptimized ones (on a sufficiently large collection), so don't turn optimizers off completely
- continuous indexing (even during upload) pays in the long run: it makes the upload slower, but allows for faster recovery of query latency once the upload done. Turn off indexing while uploading if you can tolerate a longer waiting time for you search latency to recover but want faster uploads.
- using only one segment per collection speeds up search once everything is optimized, but takes a very long time to reach a steady state. Keep Qdrant's defaults here for optimal lantecy/optimization trade-off
- serialise optimizations (allocating only one thread to optimizers) if you want smooth query times: if you can tolerate spikes and want faster recovery, leave Qdrant defaults
- be careful with deletions: if you delete more points than the vacuum optimizer threshold, it will kick in and slow down your queries. Set a high vacuum threshold (if your storage has enough room) to avoid it
Next time your queries have higher latency than usual, take a look at in-progress optimizations and, if you see room for improvement, make sure to optimize the optimizers!👩🚀🤗