简体   繁体   中英

Sql Server Reporting Services take long time to initialize configuration files before showing first report

I design GUIs for clients on window based servers. These systems are on very powerful Dell power edge servers. Inside the GUI, the client is able to open a web-browser that automatically opens the report selected. Clients access the GUI remotely, and log off in-between visits.

The first time a user logs in and tries to access a report, it takes as long as 45 seconds to open the report to view data. Every report after that loads in less than 5 seconds. I have done some research and found that the Sql Server needs to pull all the report server configuration files before it can show the first report, which takes a long time.

The config files are stored only for 12 hours by default, and the max you can set this is a couple days, I believe, inside the report services config file. This still requires the 45 second load time every other day or so.

I have tried pulling the configuration files as soon as a user remotes into the server, but that did not seem to work.

The server is running 24/7 and only turns off during a power outage. Is there a way to keep the report server configuration files on a system service or some way to never have to load the files again?

According to this article

The reason behind is that we have to wait for the application pool to spin up. During each start up, the SSRS 2005 web service reads and decrypts the rsreportserver.config file, it has to physically open up a socket connection between the two servers since the connection pool is empty, log into the database instance, etc. Also the web service has to make RPC calls into the Windows Service to get the encryption keys. There is an idle timeout value which forces the application to shut down after 20 minutes by default. We can tweak this timeout setting to have the application always up and running.

Solution SSRS 2005

First start Internet Information Services Manager from Control Panel -> Administrative Tools. Navigate to your server instance on the left side pane and expand it. You will find the Application Pools. Right click on it and choose the Properties option from the menu.

Choose the Performance tab in the Application Pool Properties window and you will see that the default setting Idle Timeout is 20 minutes.

There are two ways to disable the idle timeout:

  1. uncheck the checkbox in front of the setting or
  2. set it to 0.

Solution SSRS 2008

For SQL Server 2008 you can make a modification to the "RecycleTime" parameter in your report server config file. It will be located in the following folder:

drive:\\ Program Files\\Microsoft SQL Server\\MSRS10.MSSQLRS\\Reporting Services\\ReportServer\\rsreportserver.config

the value is in minutes.

Another possible solution

Here is a possible workaround solution. It rests on the scheduler and execution of a PowerShell script, which stops and starts the SSRS service (which has the same effect as the application domain restart) and after the restart it makes a request to the report manager URL which forces the reporting services to load all the configurations etc. Then all the subsequent request to SSRS are immediate.

Stop-Service "SQL Server Reporting Services (MSSQLSERVER)"
Start-Service "SQL Server Reporting Services (MSSQLSERVER)"
$wc = New-Object system.net.webClient
$cred = [System.Net.CredentialCache]::DefaultNetworkCredentials
$wc.Credentials = $cred
$src = $wc.DownloadString("http://localhost/Reports/Pages/Folder.aspx")

You can create a scheduled task using the Scheduled Tasks GUI or execute the below command to create the scheduled task from within a command prompt. The command prompt needs to be running with elevated administrative privileges.

schtasks /create /tn "SSRS Recycle" /ru UserName /rl highest /np /sc daily /sd 08/01/2011 /st 02:00 /tr "powershell.exe -noprofile -executionpolicy RemoteSigned -file c:scriptsSSRSRecycle.ps1"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM