diff --git a/IPython/frontend/html/notebook/handlers.py b/IPython/frontend/html/notebook/handlers.py
index 9a37c43..304f05c 100644
--- a/IPython/frontend/html/notebook/handlers.py
+++ b/IPython/frontend/html/notebook/handlers.py
@@ -481,6 +481,8 @@ class IOPubHandler(AuthenticatedZMQStreamHandler):
if self._kernel_alive:
self._kernel_alive = False
self.hb_stream.send(b'ping')
+ # flush stream to force immediate socket send
+ self.hb_stream.flush()
else:
try:
callback()
diff --git a/IPython/parallel/controller/heartmonitor.py b/IPython/parallel/controller/heartmonitor.py
index 02b4897..a27536b 100755
--- a/IPython/parallel/controller/heartmonitor.py
+++ b/IPython/parallel/controller/heartmonitor.py
@@ -64,7 +64,7 @@ class HeartMonitor(LoggingConfigurable):
pongstream: an XREP stream
period: the period of the heartbeat in milliseconds"""
- period = Integer(1000, config=True,
+ period = Integer(3000, config=True,
help='The frequency at which the Hub pings the engines for heartbeats '
'(in ms)',
)
@@ -124,6 +124,8 @@ class HeartMonitor(LoggingConfigurable):
# print self.on_probation, self.hearts
# self.log.debug("heartbeat::beat %.3f, %i beating hearts", self.lifetime, len(self.hearts))
self.pingstream.send(asbytes(str(self.lifetime)))
+ # flush stream to force immediate socket send
+ self.pingstream.flush()
def handle_new_heart(self, heart):
if self._new_handlers: