Slow load times for Workspaces

Slow load times for Workspaces

book

Article ID: KB0082706

calendar_today

Updated On:

Products Versions
Spotfire Data Science 6.x

Description

Slow load times for Workspaces

Resolution

Current versions of TIBCO Spotfire Data Science query all registered data sources to verify availability.  Having several offline data sources can result in delayed load time for the Workspaces page.  A patch is available to eliminate the data source availability check, thereby reducing Workspace load times to a minimal.  Make sure that you create a safe copy of the workspace_presenter.rb anddata_source_connection.rb files prior to editing.

File path for workspace_presenter.rb is dependent on your current version of TIBCO Spotfire Data Science.

For TIBCO Spotfire Data Science 5.x: $CHORUS_HOME/releases/<5.x_chorus_version>/app/presenters/workspace_presenter.rb

For TIBCO Spotfire Data Science 6.x: $CHORUS_HOME/releases/<6.x_chorus_version>/components/api/app/presenters/api/workspace_presenter.rb

As user chorus, comment the existing datasets_count line and replace with the following in workspace_presenter.rb:

# :datasets_count => model.dataset_count(current_user),
:datasets_count => 0,


File path for data_source_connection.rb is dependent on your current version of Alpine.

For TIBCO Spotfire Data Science 5.x: $CHORUS_HOME/releases/<5.x_chorus_version>/app/services/data_source_connection.rb

For TIBCO Spotfire Data Science 6.x: $CHORUS_HOME/releases/<6.x_chorus_version>/components/core/app/services/data_source_connection.rb


As user chorus, search for the db_options function in data_source_connection.rb:

def db_options
  options = {
      :user => @account.db_username,
      :password => @account.db_password,
      :login_timeout => ChorusConfig.instance.database_login_timeout
  }
  options:merge!({ :logger => @options[:logger], :sql_log_level => :debug }) if @options[:logger]
  options
end
and replace with:
def db_options
  timeout = ChorusConfig.instance.database_login_timeout
  options = {
      :user => @account.db_username,
      :password => @account.db_password,
      :command_timeout => timeout,
      :connect_timeout => timeout,
      :login_timeout => timeout,
      :pool_timeout => timeout,
      :read_timeout => timeout,
      :timeout => timeout
  }
  options.merge!({ :logger => @options[:logger], :sql_log_level => :debug }) if @options[:logger]
  options
end


As user chorus, edit $CHORUS_HOME/shared/chorus.properties to either modify or add this key:

# Database connection login timeout, in seconds
database_login_timeout = 3

As user chorus, restart chorus:
chorus_control.sh restart
This patch always returns 0 as the dataset_count, which will result in incorrect information when viewing the Workspace card on the dashboard.

 

Issue/Introduction

Slow load times for Workspaces