Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement maximum search queue length #36

Open
clamprecht opened this issue Apr 18, 2012 · 2 comments
Open

Implement maximum search queue length #36

clamprecht opened this issue Apr 18, 2012 · 2 comments

Comments

@clamprecht
Copy link
Contributor

To avoid situations where an index gets overloaded with searches (sometimes a slow search can cause this), I implemented an option called "max_search_queue", which sets a limit of the number of threads waiting to acquire the search semaphore in TrafficLimitingSearcher. If this limit is reached, it just rejects the search and throws InterruptedException instead of melting down. I've been running this in production and it seems to work well.

If this sounds good, I'll clean this up into a nice pull request, but here's the main code change:

clamprecht@1e766e2

The option name I chose in the indexengine_config is "max_search_queue".

@santip
Copy link
Contributor

santip commented Apr 19, 2012

It sounds great. Another alternative could be to limit the amount of time a Thread should be waiting. Either way is better than the current state. Please clean it up and we'll merge it.

Thanks

@searchify
Copy link

Pull request submitted in issue #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants