Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION

Enabling TCP Keep Alive Functionality In Qlik Sense

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
Andre_Sostizzo
Digital Support
Digital Support

Enabling TCP Keep Alive Functionality In Qlik Sense

Last Update:

Jul 17, 2024 5:34:01 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 3, 2018 2:42:49 AM

For Qlik Sense Enterprise for Business (Cloud), see Loading of an app is hanging when using Qlik Cloud.

Working in a Qlik Sense app after remaining inactive causes fails with the error: 

Connection to the Qlik Sense engine failed for unspecified reasons. Refresh your browser or contact our system administrator

The issue specifically affects external users who have been inactive until a network device's (Firewall, Router, etc.) idle timeout was reached. This is followed by a connection reset for the TCP WebSocket session.

Cause:

TCP WebSocket connection is terminated by the firewall because the firewall is not receiving any TCP traffic such as keep-alive packets from client browser (e.g. Firefox, older Chrome versions).  Specific web browsers have their own tcp keep-alive behavior. 

This issue may be found with less frequency with IE because it sends the TCP Websocket keep-alive more frequent than any other main stream browser. Here are the default intervals for the three main browsers latest releases as of September 2020:

Default TCP-Keep-Alive intervals:

General Information

This functionality is by default switched off not to affect any existing customers. Customers who do not experience any issues with web sockets terminated by the network due to inactive SHOULD NOT switch this feature ON since it will send unnecessary traffic on the network. See How are WebSockets used in QlikSense ? for more information.

How to configure?

  1. Stop the Qlik Sense Proxy Service
  2. Edit the file C:\Program Files\Qlik\Sense\Proxy\Proxy.exe.config This location may not be available if Qlik Sense was not installed in the default location.
  3. Add the configuration key:
    <add key="WebSocketPingInterval" value="0"/>   <!-- Interval in seconds for the web socket ping to the client (a value of "0" is disabling the ping)–>
    Where value is a suitable positive number depending on the inactive web socket timeout setting in the network. The effective interval that the Qlik Sense Proxy server will send keep-alive messages towards the client my oscillate between 2 x value and 1 x value, since it also takes into account backend inter-process socket activity. Eg: setting the value of WebSocketPingInterval to 30 may lead to keep-alive messages sent to the client every 30 or 60 seconds.

    Note: The Qlik Sense Proxy service may not send keep-alive packets if it detects activity on that client's Websocket tcp session.

    Recommended is 60-300 second range, shorter interval generates more load on Proxy CPU and network. It should be set as high as possible, meaning it's best to identify at which interval an intermediate proxy cuts the connection when it perceives it as idle, and then set the ping interval to a slightly smaller value.

    A too small number (e.g. less than 30) will load the proxy and the network and IS NOT recommended. Suitable numbers could be 60 to 300 (i.e. 1 minute to 5 minutes), but it all depends on the network configuration (if the network removes web sockets that have been inactive for more than 5 minutes then, of course, the value must be set something less than 5 minutes (i.e. less than 300)). If a lower value is required, it is recommended to investigate the components involved in the connection, such as third party proxies and network load balancers to configure them with less restrictive timeouts. 

    It is possible that the same WebSocketPingInterval value has different behaviors in each Qlik Sense Hub section due to third party network device. The value may keep the connection live in Dashboardbut, but still lose connection in Data Load Editor. You may test with a lower WebSocketPingInterval value until the proper value is found to keep connection in all sections. For example, when connectingCloudFlare as web application firewall, theWebSocketPingInterval value may need to set to 10 seconds otherwise "connection lost" may still be received in Data Load Editor even the rest of Qlik Sense Hub keeps connected.

  4. Restart the Qlik Sense Proxy Service.

Related content:

Labels (1)
Comments
RajanKasbe_Expo
Partner - Contributor
Partner - Contributor

After performing the step 1-4 mentioned above, how to validate the thing for which have performed those step. Or how to identify that NPrinting server is connecting to Qliksense server

Andre_Sostizzo
Digital Support
Digital Support

@RajanKasbe_Expo , are you performing this task to troubleshoot the connection setup on the NPrinting server? It is not clear how this post would assist with that task.

TCP Keep alive packets are sent to the server as long as you have an app open in Hub. These packets will show in a network capture. 

john_oll
Partner - Creator
Partner - Creator

@Andre_Sostizzo 
is there a similar feature for keep alive for Qlikview?
I found only the SocketTimeOutInSeconds Setting, which is not the same as a Ping interval.

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @john_oll !

No equivalent exists for QlikView, as QlikView does not have that specific need. Extending the timeouts is generally sufficient, as we do not use WebSockets that will disconnect on inactivity.

However, third party tools (browsers, firewalls, proxies,..) can interfere here and cut the connection.

 

All the best,
Sonja 

SaturnV
Partner - Contributor III
Partner - Contributor III

If you have a multinode environment. On which server should this be done?

We have 4 hosting nodes (where our customers are connected to the HUB), 2 Proxy nodes, 3 reload nodes (engine nodes which reload apps daily) and the central node. Is this necessary on all nodes or just some?

Thanks and regards
Julian

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @SaturnV 

This article is specifically aimed at the proxy service (hub connection), so any of the proxy nodes in your environment would need to have these changes made.

All the best,
Sonja 

SaturnV
Partner - Contributor III
Partner - Contributor III

Hey @Sonja_Bauernfeind,

I just changed the proxy config for our Proxy nodes and restartet the Services but it still disconnects after about 100s.
Shouldn't there now be visible Websocket requests which can be viewed in the browsers network traffic for the specific Qlik WS?

Best
Julian

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @SaturnV 

You would be seeing WebSocket traffic in your browser debug tools regardless of whether or not you've set this setting. Here is some general information on how to debug WebSocket traffic: Debugging WebSocket in Google Chrome.

Here's also one of ours: How to time a Qlik Sense WebSocket connection.

If your connection still times out, I'd recommend reviewing the relevant log files (not only Qlik Sense logs, but also your network components) to see where the connection is being terminated. Here is an article that walks through a few of the basics: Qlik Sense Enterprise Hub timeout.

Should you need more assistance, I'd recommend posting on our forums (Deployment and Management ) to get assistance from our larger community.

All the best,
Sonja 

 

 

federicotedesco
Partner - Contributor II
Partner - Contributor II

Hello everyone,

thanks for the article becasue we have found the cause of the lost connection.

In our architecture there is a network  appliance that block the web socket connection.

In proxy.config we have set the web ping interval to 50 second (may be necessary to set a value to 40/45).

You suggest:

A too small number (e.g. less than 30) will load the proxy and the network and IS NOT recommended. Suitable numbers could be 60 to 300

In this case, can we keep/decrease the value of web ping interval or is it prefer an increase the timeout side network appliance?

Regards

Federico

 

 

 

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @federicotedesco 

We would recommend increasing the timeout on your network appliance. If you are unable to do so, decreasing the interval of pings is of course a possibility, but we cannot advise it. If you choose to decrease the interval, make sure to monitor the performance of the systems.

All the best,
Sonja 

Version history
Last update:
‎2024-07-17 05:34 AM
Updated by: