Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More

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
twales
Contributor III
Contributor III

Hi,

Setting up 7th AMI Aug/2023 BYOL server Windows 2019 on AWS.

 I have installed 6 previous qlik ami's(2020-2022) all the same on AWS networks. As client managed cloud servers.

 Have never had a disconnection every 60 seconds.

 Set the client TO-300 as usual.  Even opened other ports 4747, etc. Tried both Chrome and FF. Still no change.

Set WS ping to 30s. Now working as expected, that is TO is 5 minutes.

Network appliances I use NAT and LB's are default to 350s by AWS, 6 mins.

This AMI also still had the incorrect postgres dir in the ps1's. Had to change all to 14.

This seems to be a Qlik problem as I've done this 6 servers all actively running  on the same AWS networks and this never happened before. Also not sure what I would do when AWS is defaulted to 350s already.  

Any ideas?

Thanks

 

 

 

 

 

willtech93
Partner - Contributor
Partner - Contributor

Hi all,

We had the problem with these kind of disconnections with some users and had to apply this functionaly in order to sessions lasting longer than five minutes, even with the Virtual Proxy settings at a higher time, this continued to happen. Any ideas of why this could be happening. Never had happened before and its just for some users.

 

Thanks.

 

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @willtech93 

If only specific users are affected, we recommend reviewing the Qlik Sense log files for additional information and investigating the differences in the setup these users have (different browsers, different network devices, VPNs used and so on). 

All the best,
Sonja 

sanrout
Contributor III
Contributor III

Hi @Andre_Sostizzo @Sonja_Bauernfeind,


<add key="WebSocketPingInterval" value="5"/>

 

We did add the above entry in proxy config file and interval was initially set at 90 seconds (considering the recommendation 60 to 300) and still the issue did appear and hence we tested with different values i.e. 60, 30, 15, 10 and lastly with 5 seconds. For all the cases we noticed the issue did not get solved.

 

We have used Wireshark to understand if Qlik Sense server is sending any tcp keep alive. To our surprise, it did not show any such tcp keep alive. However if we run from client side (my machine) I did notice such tcp keep alive. We do not understand why server/instance

Client side: wireshark shows tcp keep alive messages almost for 45 seconds

client side.png

Server side (AWS EC2 windows server 2016): we do not notice any tcp keep alive messages being sent

Server side.png is not sending such tcp keep alives ?

 

Windows server registry editor has the below settings for the tcp keep alive.

 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\: KeepAliveTime: 30000 KeepAliveInterval: 1000 TcpMaxDataRetransmissions: 10 These settings use the DWORD data type

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @sanrout 

This question would require direct investigation. I either recommend posting about your challenges in the appropriate forum (Deployment and Management), or investigating the possibility of contacting support.

All the best,
Sonja 

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