The optimal keep alive setting for the Node SDK are follows:

var pubnub = new PubNub({
    subscribeKey: "mySubscribeKey",
    publishKey: "myPublishKey",
    secretKey: "secretKey",
    ssl: true,
    keepAlive: true,
    keepAliveSettings: {
        keepAlive: true,
        keepAliveMsecs: 5 * 1000 * 60, // 300,000 ms
        timeout: 5 * 1000 * 60
    }
});


This will enable your server application to reuse the TCP socket for optimal network performance and efficiency.