Skip to content

Set Net::HTTP open_timeout and read_timeout#10

Open
pranas wants to merge 1 commit intokissmetrics:masterfrom
pranas:set_timeout
Open

Set Net::HTTP open_timeout and read_timeout#10
pranas wants to merge 1 commit intokissmetrics:masterfrom
pranas:set_timeout

Conversation

@pranas
Copy link

@pranas pranas commented Apr 24, 2014

We've been experiencing network issues when connecting to KissMetrics. Metrics are not important enough to bring the whole application down. This change let us to set Net::HTTP timeouts and kill requests taking too long.

This is how we solved our problem and I'd like to see the change in the official gem. A few things to discuss:

  1. We use timeout of 3 seconds, it might be too harsh default for some users?
  2. Maybe we should allow to customise both open_timeout and read_timeout separately? Or maybe we should put the whole Net::HTTP code in Timeout::Timeout block and set a single timeout instead of open_timeout and read_timeout

Let me know what you think and I'll update my PR accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant