title: Most Efficient Websocket Ping Interval on Mobile Devices
body: <p>My aim is to minimize the battery/energy cost of maintaining a long-lived Websocket connection on an iPhone (but this applies to any mobile device), by allowing the cellular/wifi radios in the device to be powered down for as often/long as possible, while by finding the minimum ping frequency that still maintains the connection integrity.</p>
  
  <p>Ignoring for a moment the fact that the "ping" lets us know whether the application on the server is alive or dead...</p>
  
  <p>If TCP keepalive has a default 2 hour window, does this imply that "The Internet" won't kill our Websocket connection for some comparable period of time? </p>
  
  <p>In the case even 30 second pings are pretty resource wasteful. </p>
  
  <p>Does anyone have experience with tuning the pings to minimum frequency?</p>