{"issue":{"state":"open","created_at":"2011-12-02T20:30:28Z","updated_at":"2011-12-05T16:22:29Z","comments":5,"user":{"gravatar_id":"9a755176a85626be390098c493730227","id":17121,"url":"https://api.github.com/users/olek","login":"olek","avatar_url":"https://secure.gravatar.com/avatar/9a755176a85626be390098c493730227?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Default value for timeout is 5 microseconds, and that is one very aggressive timeout.\r\n\r\nOur 'redis-centric' apps were throwing unusual errors EAGAIN (Resource temporarily unavailable - Timeout reading from the socket) from time to time.\r\n\r\nProblem was fairly easy to reproduce with apache benchmark (ab) hitting our sinatra app ten thousand times\r\n\r\nAfter some research, I narrowed down the problem to the too short of the timeout (5 microsecond), and experimented with increased timeouts. At 50 microseconds, it was much less likely to happen, but still happened once or twice for every 100k requests. 100 microseconds seems to be the shortest possible timeout that does not cause any issues in our environment (Slicehost servers).\r\n\r\nI think, that default value for timeout should be changed out to a safer, larger value of 100 microseconds. After all, 0.1ms is still a fairly short timeout. Larger value will provide even more safety margin (1ms, anybody?), but 0.1ms seems to be a bare minimum.","assignee":null,"id":2432675,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":160,"labels":[],"title":"too short default timeout value (0.005ms)","html_url":"https://github.com/ezmobius/redis-rb/issues/160","closed_at":null,"url":"https://api.github.com/repos/ezmobius/redis-rb/issues/160","milestone":null},"action":"created","comment":{"created_at":"2011-12-05T16:22:29Z","updated_at":"2011-12-05T16:22:29Z","user":{"gravatar_id":"9a755176a85626be390098c493730227","id":17121,"url":"https://api.github.com/users/olek","login":"olek","avatar_url":"https://secure.gravatar.com/avatar/9a755176a85626be390098c493730227?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Finally, some interesting discovery.\r\n\r\nProblem is happening only with hiredis driver, as soon as I utilize either 'ruby' driver or 'synchrony', there are no 'timeouts', even if I set 'timeout' setting to extremely low value of 0.01s (this setting causes hiredis driver to fail 5% - 90% of 100 requests).","id":3019084,"url":"https://api.github.com/repos/ezmobius/redis-rb/issues/comments/3019084"}}