Make Redis timeout configurable via environment variable#71
Merged
Conversation
parisk
approved these changes
Aug 26, 2019
Contributor
parisk
left a comment
There was a problem hiding this comment.
Great patch! Thanks for putting the time on this and also updating documentation accordingly.
Merging 🚀!
Contributor
Author
|
@parisk and thank you for the quick review and merge! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_TIMEOUTwhich 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.