KNOWLEDGE BASE

Live Database Connection Not Closing


Published: 30 Jun 2017
Last Modified Date: 16 Oct 2018

Issue

When closing a published workbook with a live connection to a database the connection remains open on the database side, causing performance issues for the database.

Environment

tabadmin set vizqlserver.protocolcachesize 100
 
tabadmin set vizqlserver.protocolcachesize 100

Tableau Server 

Resolution

Change the protocolcachelifetime_in_minutes to a value lower than 120 minutes (the default), using tabadmin. For example, to set it to 60 minutes: 
  1. On the computer running Tableau Server, open a command prompt as an administrator. 
  2. Navigate to the Tableau Server bin folder, and enter the following command: 

Versions 2018.1 and older using TabAdmin

tabadmin stop
tabadmin set vizqlserver.protocolcachelifetime_in_minutes 30
tabadmin config
tabadmin start

 

Versions 2018.2 and newer using TSM

tsm stop
tsm configuration set -k vizqlserver.protocolcachelifetime_in_minutes -v 30
tsm pending-changes apply
tsm start

It might also be useful to adjust the size of the protocol cache pool, so that there is more opportunity for the connection to close when a new database connection request protocol comes in. This can also be done using tabadmin. For example, it could be set to a pool size of 100: 

Versions 2018.1 and older using TabAdmin

tabadmin set vizqlserver.protocolcachesize 100

Versions 2018.2 and newer using TSM

tsm configuration set –k vizqlserver.protocolcachesize -v 100

 
 
 

Cause

Tableau Server keeps connections open in order to speed workbook load.

 

Additional Information

Tableau Server keeps a database connection cache, also called a protocol cache. The default size is 200. The size can be configured with protocolcachesize

All connections in the cache have a time-since-last-used value. When a protocol is used, its timer is reset. 
When the protocolcachelifetime_in_minutes limit is reached - the time since the connection was last used is greater than the protocol cache lifetime - the connection is marked as eligible to be closed. 

On Tableau Server 10.5 and older versions, we check for expired connections only when the protocol cache is accessed. Because of this, connections can linger on an idle server. 

Tableau Server 2018.1 and newer versions regularly check the protocol cache for expired connections. 

 

Did this article resolve the issue?