KNOWLEDGE BASE

Live Database Connection Not Closing


Published: 30 Jun 2017
Last Modified Date: 03 Jul 2017

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

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: 
    tabadmin set protocolcachelifetime_in_minutes 60 

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: 
tabadmin set protocolcachesize 100 

Cause

Tableau Server closes a cached idle database connection only when a new connection request is received. 

 

Additional Information

Every time Tableau Server gets a protocol (database connection request) for any data source it is put on a list of open protocol (dictated by "protocolcachesize"). The default size is 200.

The "protocolcachelifetime_in_minutes" dictates how long an idle connection remains at the top of the list before being moved to the bottom of the list. Note that the connection does not close once the "protocolcachelifetime_in_minutes" limit is reached, it is simply marked as being eligible to be closed when a new protocol comes in.

When a new protocol is received, Tableau Server checks to see if there are any cached protocols (for any data source) that have had no activity during the period of time set for "protocolcachelifetime_in_minutes," then Tableau Server will close an idle datasource connection in order to make room for the new protocol. 

If there are not many new database connection requests coming in, a connection that is not being used but is still on the list will remain open until a new connection request comes in, no matter how long that is.

Did this article resolve the issue?