Ticket #118 (new defect)

Opened 2 months ago

Last modified 2 weeks ago

Add ability to change Heartbeat interval

Reported by: yakischloba Assigned to:
Priority: major Milestone: EventMachine "Framework"
Keywords: Cc:


igrigorik reported that connections were not timing out within a reasonable variance of the comm_inactivity_timeout he was setting. Investigating this found that Heartbeat() is only called on the Descriptors every 2 seconds by a hard coded default. This was originally done for performance reasons, however 2 seconds seems very conservative and it should not cause significant performance degradation to lower it a bit, depending on the load.

Just need to implement a simple getter & setter for the HeartbeatInterval? value. Some testing should also be done to see if '2' is really an optimal default value, or if it can be lowered.

Change History

03/22/09 22:53:56 changed by yakischloba

Turns out the reactor is only using time() and so has only time resolution for the heartbeat to 1 second. Since gettimeofday() is used anyway in RunTimers?, we might want to look into just changing the loop to use it instead of time(). No reason to take the time twice per loop and might as well be an accurate time.

05/06/09 18:23:45 changed by yakischloba

loop time changed here http://github.com/eventmachine/eventmachine/commit/91d5dc38887c5ec501439f794583c7f2f3cbdea4

Another patch to come for changing the interval.