-
Notifications
You must be signed in to change notification settings - Fork 69
Add support for Redis unix sockets #64
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
Conversation
Signed CLA. Rebuild |
Change looks pretty straight-forward. I'd like to see mutual exclusion on |
I'll test this (and your other PR on redis output) tomorrow. Thank you for your work :) |
👍 Sounds good on the mutual exclusion - PR updated. |
Rebuild. Travis seemed to have a networking issue. |
I restarted the failed redis job. (3/4 passed, 1 failed due to network issues) |
This is probably mergeable! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to reduce a minor breaking change subtlety in treating the default parameters I think we should keep the default value for host in the setting itself but make :path override it if set (and log a warn).
lib/logstash/inputs/redis.rb
Outdated
# The hostname of your Redis server | ||
# This defaults to 127.0.0.1 if not specified. | ||
# This and :path are mutually exclusive. Will raise an ArgumentError if both are specified. | ||
config :host, :validate => :string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can keep this default here, and simple have the :path
option overwrite host/port like described in line 34
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If :path
is set we can just log a warn saying that path is set, so we're ignoring host/port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jsvd for the feedback. Ironically, that was actually the original logic of how this PR was constructed (see commit: 7c29668) Looks like I forgot to remove the comment on L34 in the subsequent commits 😆 .
@jordansissel - thoughts? I can see merits for both logic paths:
- Mutually exclusive
- No ambiguity about which connection is being used
- Defaults are no longer set at init, which does make the code more complex
- Override
- Could potentially lead to confusion (especially if someone doesn't know what unix sockets are). Documentation can help assay this issue, but it's not as explicit as a mutex.
- Defaults are set at init, making the code cleaner.
Frankly, I'm fine with either logic path - just let me know which pattern matches Logstash plugins best and I'll update the PR.
@brennentsmith thank you for the contribution, this is great! |
@jsvd - logic updated as requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds support for unix sockets on connecting to redis. Can result in a 50% increase in performance (https://redis.io/topics/benchmarks) and provides a touch of local ACL’s (permissions on the local file descriptor).
We use Redis heavily at Speedtest.net as a local pre-buffer for logstash, and using unix sockets helps reduce the local overhead.
Corresponding
logstash-output-redis
PR: logstash-plugins/logstash-output-redis#57