Skip to content

search: Limit concurrent searches relative to number of searcher replicas

Warren Gifford requested to merge search/limit into master

Created by: keegancsmith

This will prevent us starting a large number of goroutine which wait. It will also limit concurrency before we hit gitserver. Additionally the limit is not hardcoded, but rather is a multiple of the number of search replicas. However, this does remove our global rate limiter. The global rate limiter was more an artifact of implementation, than an intended implementation. So a per request rate limiter should be sufficient.

This is an attempt to fix https://github.com/sourcegraph/sourcegraph/issues/4101

Test plan: unit tests

Merge request reports

Loading