I have been given the task of improving the performance of the first report connection each day. Similar to this post.
We have a simple SSRS report that acts as a landing page. It has hyperlinks to subsequent reports.
I have tried:
- implementing the powershell restart script at 6:30am.
- configure report cache to refresh on a schedule every 10 min after restart
- Adding a subscription.
- scheduling a powershell script to export the report.
It seems the problem is that SSRS somehow treats these connections differently than if a real user opens the report through a web browser. Even though the report is run it doesn't appear to be handled in the same way as if a user is hitting it via the portal. And so.. the first user experiences a big delay.
Using the F12 debugging features in internet explorer, I managed to reproduce and capture what the browser is seeing. SSRS only took 4 seconds to produce and return the report, however in the browser it took 122 seconds from trying to open the URL to the screen being rendered. 2 minutes!!! No wonder users are complaining.
Looking at my SSRS log files ( Located in: C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\LogFiles) it appears that the SSRS appdomain is restarting or reloading.
The Log excerpt below shows
- The scheduled cache refresh at 08:00:19 & 08:10:19
- Followed by my report request about 8:15:01
- I don't get the report back until about 8:17:06
Logfile:
library!WindowsService_0!1bdf8!08/24/2017-08:10:19:: i INFO: Call to CleanBatch()
library!WindowsService_0!1bdf8!08/24/2017-08:10:20:: i INFO: Cleaned 0 batch records, 0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0 running jobs, etc etc
library!WindowsService_0!1bdf8!08/24/2017-08:10:20:: i INFO: Call to CleanBatch() ends
appdomainmanager!DefaultDomain!adb0!08/24/2017-08:15:01:: i INFO: Registering AppDomain: type='ReportServer'; id='3'; Name='ReportServer_MSSQLSERVER_0-1-131479929006508632'
appdomainmanager!DefaultDomain!adb0!08/24/2017-08:15:01:: i INFO: Creating a new AppDomainLifeCycleManagementEntry for AppDomain id '3'
appdomainmanager!DefaultDomain!adb0!08/24/2017-08:15:01:: i INFO: Appdomain STARTED: id='3'; name='ReportServer_MSSQLSERVER_0-1-131479929006508632'
appdomainmanager!ReportServer_0-1!adb0!08/24/2017-08:15:08:: i INFO: RS authentication mode is 4; effective ASP.NET authentication mode is Windows. vdir=/ReportServer.
appdomainmanager!DefaultDomain!adb0!08/24/2017-08:15:08:: i INFO: Appdomain:3 ReportServer_MSSQLSERVER_0-1-131479929006508632 initialized (#1).
appdomainmanager!DefaultDomain!adb0!08/24/2017-08:15:08:: i INFO: SetInitialized AppDomain id '3': initialized = 1
webserver!ReportServer_0-1!adb0!08/24/2017-08:16:51:: i INFO: Reporting Web Server started
library!ReportServer_0-1!adb0!08/24/2017-08:16:51:: i INFO: SQLDump flags: ReferencedMemory, AllThreads, SendToWatson
library!ReportServer_0-1!adb0!08/24/2017-08:16:51:: i INFO: MiniDump flags: DataSegs, UnloadedModules, ProcessThreadData
library!ReportServer_0-1!adb0!08/24/2017-08:16:51:: i INFO: Dump on: Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogExceptionMicrosoft.ReportingServices.
library!ReportServer_0-1!adb0!08/24/2017-08:16:51:: i INFO: Do not dump on: System.Threading.ThreadAbortExceptionSystem.Web.UI.ViewStateExceptionSystem.OutOfMemoryExceptionSystem.
library!ReportServer_0-1!adb0!08/24/2017-08:16:51:: i INFO: Minidump location: C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\Logfiles
runningjobs!ReportServer_0-1!adb0!08/24/2017-08:16:51:: i INFO: Running Requests Scavenger timer enabled: Next Event: 60 seconds. Cycle: 60 seconds
runningjobs!ReportServer_0-1!adb0!08/24/2017-08:16:51:: i INFO: Running Requests DB timer enabled: Next Event: 60 seconds. Cycle: 60 seconds
resourceutilities!ReportServer_0-1!adb0!08/24/2017-08:16:51:: i INFO: Reporting Services starting SKU: Developer
ui!ReportServer_0-1!adb0!08/24/2017-08:16:52:: i INFO: Installed SKU: Developer edition
ui!ReportServer_0-1!adb0!08/24/2017-08:16:52:: i INFO: Registering with Software Usage Metrics Product:SQL Server 2016, Role:Microsoft SQL Server Reporting Services, etc etc
library!ReportServer_0-1!adb0!08/24/2017-08:16:52:: i INFO: Call to GetItemTypeAction(/CIA). User: MYDOMAIN\prm.
library!ReportServer_0-1!adb0!08/24/2017-08:16:53:: i INFO: Catalog SQL Server Edition = Developer
crypto!ReportServer_0-1!adb0!08/24/2017-08:16:54:: i INFO: Initializing crypto as user: NT Service\ReportServer
crypto!ReportServer_0-1!adb0!08/24/2017-08:16:54:: i INFO: Exporting public key
crypto!ReportServer_0-1!adb0!08/24/2017-08:16:54:: i INFO: Importing existing encryption key
library!ReportServer_0-1!adb0!08/24/2017-08:17:02:: i INFO: Entering StreamRequestHandler.ExecuteCommand - Command = StyleSheet
library!ReportServer_0-1!adb0!08/24/2017-08:17:02:: i INFO: Exiting StreamRequestHandler.ExecuteCommand - Command = StyleSheet (success)
library!ReportServer_0-1!adb0!08/24/2017-08:17:06:: i INFO: Call to GetItemTypeAction(/CIA). User: MYDOMAIN\prm.
library!ReportServer_0-1!adb0!08/24/2017-08:17:06:: i INFO: RenderForNewSession('/CIA')
library!ReportServer_0-1!adb0!08/24/2017-08:17:07:: i INFO: Using folder C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\blahblahblah
As each of the various workarounds I have tried so far don't seem to work...
How can I force SSRS into doing this before a real user attempts to run the report?