Set timeAllowed solr parameter to avoid solr wasting cycles on timed-out queries #11267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #11268
I was monitoring the solr logs, and noticed that some queries were running for 30+ seconds! Especially odd since in most places in OL we set a timeout of 10s for solr requests. Turns out solr won't abandon a query after the client closes the connection. (And this makes some sense, since it allows the query to effectively finish in the bg, so next time that query is made, caches should hopefully have been populated and it won't time out.)
But for our use cases we generally don't need that. And apparently solr has a url param for this!
timeAllowed={ms}. This lets us forward along the timeout effectively, and solr will stop processing after ms have passed and instead return a partial result.Technical
/updatedone by solr-updater ; those use httpx directly.language:eng(although note sort order might not wind up being correct). But for now just timeout.Testing
I patched this out, and it seems to have helped make us more resilient. I'm seeing solr perf more persistently in the sub 10ms zone (see graph). It seems like this might have increased our throughput, and is preventing large/slow queries from causing solr congestion.
Screenshot
Stakeholders