Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve channel query queueing #3862
Sync Gateway's queries for a given channel are single-threaded - the general idea being that if multiple requests are querying for the same information concurrently, we want to execute that query once and serve the remaining requests from the cache. This approach can lead to problems when the query result exceed channel_cache_max_length - under high load this can lead to increased latency over time when the request frequency outruns query latency. This can be avoided by increasing channel_cache_max_length, but it's difficult to diagnose when a given channel is hitting this scenario.
The following enhancements will reduce the impact when this scenario is hit, as well as providing additional visibility.