Make Redis timeout configurable via environment variable #71
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.
I suspect that we're occasionally seeing Redis timeouts due to messages in our Ceryx logs like the following which are associated with HTTP 500 responses from Ceryx:
The line it's referring to is:
Currently the Redis timeout is hard-coded to 100ms here: https://github.com/sourcelair/ceryx/blob/master/ceryx/nginx/lualib/ceryx/redis.lua#L16
I suspect that we're occasionally seeing new connections hit this limit, so I would like to try increasing it, but unfortunately it isn't currently configurable via Ceryx. This PR adds a new environment variable called
CERYX_REDIS_TIMEOUT
which can be used to configure this timeout in units of milliseconds. I applied this setting to the Ceryx API as well, although the units had to be converted to seconds in that case because that's what the Python Redis client expects.