mirror of
https://github.com/qdrant/qdrant.git
synced 2026-08-02 08:00:55 -05:00
* Move CPU count function to common, fix wrong CPU count in visited list * Change default number of rayon threads to 8 * Use CPU budget and CPU permits for optimizer tasks to limit utilization * Respect configured thread limits, use new sane defaults in config * Fix spelling issues * Fix test compilation error * Improve breaking if there is no CPU budget * Block optimizations until CPU budget, fix potentially getting stuck Our optimization worker now blocks until CPU budget is available to perform the task. Fix potential issue where optimization worker could get stuck. This would happen if no optimization task is started because there's no available CPU budget. This ensures the worker is woken up again to retry. * Utilize n-1 CPUs with optimization tasks * Better handle situations where CPU budget is drained * Dynamically scale rayon CPU count based on CPU size * Fix incorrect default for max_indexing_threads conversion * Respect max_indexing_threads for collection * Make max_indexing_threads optional, use none to set no limit * Update property documentation and comments * Property max_optimization_threads is per shard, not per collection * If we reached shard optimization limit, skip further checks * Add remaining TODOs * Fix spelling mistake * Align gRPC comment blocks * Fix compilation errors since last rebase * Make tests aware of CPU budget * Use new CPU budget calculation function everywhere * Make CPU budget configurable in settings, move static budget to common * Do not use static CPU budget, instance it and pass it through * Update CPU budget description * Move heuristic into defaults * Fix spelling issues * Move cpu_budget property to a better place * Move some things around * Minor review improvements * Use range match statement for CPU count heuristics * Systems with 1 or 2 CPUs do not keep cores unallocated by default * Fix compilation errors since last rebase * Update lib/segment/src/types.rs Co-authored-by: Luis Cossío <luis.cossio@qdrant.com> * Update lib/storage/src/content_manager/toc/transfer.rs Co-authored-by: Luis Cossío <luis.cossio@qdrant.com> * Rename cpu_budget to optimizer_cpu_budget * Update OpenAPI specification * Require at least half of the desired CPUs for optimizers This prevents running optimizations with just one CPU, which could be very slow. * Don't use wildcard in CPU heuristic match statements * Rename cpu_budget setting to optimizer_cpu_budget * Update CPU budget comments * Spell acquire correctly * Change if-else into match Co-authored-by: Luis Cossío <luis.cossio@qdrant.com> * Rename max_rayon_threads to num_rayon_threads, add explanation * Explain limit in update handler * Remove numbers for automatic selection of indexing threads * Inline max_workers variable * Remove CPU budget from ShardTransferConsensus trait, it is in collection * small allow(dead_code) => cfg(test) * Remove now obsolete lazy_static * Fix incorrect CPU calculation in CPU saturation test * Make waiting for CPU budget async, don't block current thread * Prevent deadlock on optimizer signal channel Do not block the optimization worker task anymore to wait for CPU budget to be available. That prevents our optimizer signal channel from being drained, blocking incoming updates because the cannot send another optimizer signal. Now, prevent blocking this task all together and retrigger the optimizers separately when CPU budget is available again. * Fix incorrect CPU calculation in optimization cancel test * Rename CPU budget wait function to notify * Detach API changes from CPU saturation internals This allows us to merge into a patch version of Qdrant. We can reintroduce the API changes in the upcoming minor release to make all of it fully functional. --------- Co-authored-by: Luis Cossío <luis.cossio@qdrant.com> Co-authored-by: Luis Cossío <luis.cossio@outlook.com>