Revisiting an old SSRS performance topic again…


Almost three years ago, I posted about why Reporting Services takes so long to respond to the first request if it has been sitting idle for a long time (like overnight).  The original post can be found at http://blogs.msdn.com/b/sqlblog/archive/2007/11/09/reporting-services-staaaarrrrrtttt-up.aspx.  For those of you who don’t want to read it, the core conclusion was that (at least on my hardware), SSRS was taking about 30 seconds to start up after the application domain had been recycled.  The post was in response to the question I was getting (and still get) about why SSRS takes so long to start up.  The answer (for those of you who don’t want to bother reading the old article), was that SSRS has to do a ton of work to load all of the required dependencies, plus read the configuration files and decrypt the data in the catalog database.

I recently set up a new installation of SSRS 2008 R2, so I thought I would do the same comparison.  I had figured to see similar results, so you can imagine my surprise when the numbers averaged about 15 seconds!!!  I attribute some of that to a better machine, but my primary machine is not too much better than my server machine was back in those days (quad-core vs. dual-core, but similar RAM and clock speeds).  In fact, some quick benchmarks confirmed my thoughts – the new machine is better at higher workloads, but at the relatively low level of work I am doing for these tests, they are about the same.

Here is the updated code:

 

    Sub Main(ByVal args() As String)
        Dim sr As New IO.StreamWriter(IO.Path.Combine(Environment.CurrentDirectory, "ReportingServicesMetrics.txt"))

        'let's loop through 5 times
        For i As Integer = 0 To 4
            Dim ts As DateTime
            Dim te As DateTime

            If args(0).ToUpper = "IIS" Then
                'let's reset IIS to make sure everything has to start from scratch
                sr.WriteLine("Doing an IISReset - Loop #" & (i + 1).ToString)
                Dim proc As New Diagnostics.Process
                proc.StartInfo.FileName = "iisreset"
                proc.Start()
                proc.WaitForExit()
                sr.WriteLine("IIS has been reset")

                'dummy web service
                sr.WriteLine("Getting ready to instantiate the dummy web service that just returns an empty DataSet")
                ts = Now()
                Dim dws As New DummyWebService.Service
                dws.ReturnBlankDataSet()
                sr.WriteLine("Instantiated the dummy web service")
                te = Now()
                sr.WriteLine("The dummy web service took " & te.Subtract(ts).TotalMilliseconds.ToString)
            End If

            If args(0).ToUpper = "SSRS" Then
                sr.WriteLine("Doing an SSRS restart - Loop #" & (i + 1).ToString)
                Dim srv As New System.ServiceProcess.ServiceController("SQL Server Reporting Services (R2)")
                srv.Stop()
                Do While srv.Status <> ServiceProcess.ServiceControllerStatus.Stopped
                    Console.WriteLine(srv.Status)
                    Threading.Thread.Sleep(5000)
                    srv.Refresh()
                Loop
                srv.Start()
                Do While srv.Status <> ServiceProcess.ServiceControllerStatus.Running
                    Console.WriteLine(srv.Status)
                    Threading.Thread.Sleep(5000)
                    srv.Refresh()
                Loop
                sr.WriteLine("SSRS has been reset")

                'RS
                sr.WriteLine("Getting ready to instantiate the RS web service")
                ts = Now()
                Dim rs As New RS2005.ReportingService2005
                Dim creds As New Net.NetworkCredential
                creds = Net.CredentialCache.DefaultCredentials
                rs.Credentials = creds
                rs.Url = "http://localhost/reportserver_r2/reportservice2005.asmx"
                rs.ListChildren("/", False)
                sr.WriteLine("Instantiated the RS web service")
                te = Now()
                sr.WriteLine("RS took " & te.Subtract(ts).TotalMilliseconds.ToString)
            End If

        Next
        sr.Close()
    End Sub

In summary, even though I would love to see some improvement in this area, my own testing shows that SSRS 2008 R2 starts up from a cold start in about half the time is took SSRS 2005.

Your mileage and results will vary depending on your hardware configuration, so don’t take my results to use in a proposal to your management.  If you do, I will disavow any knowledge of the above testing!!

Do your own testing, but please share your results.  I would love to hear if other people see similar startup improvements between the two versions.

Comments (3)

  1. Michael J Swart says:

    It's still disappointing that it's 15 seconds. It makes demos quite awkward unless I remember to warm up reporting services ahead of time.

    It's 2010! and the only reason 15 seconds seems acceptable is that it used to be 30 seconds!

    Is there a microsoft connect item that we can use to track this badness?

  2. Richard says:

    I agree – 15 seconds is still a long time. We generally set our AppPool to recycle at midnight, and schedule a script to run early in the morning to request the default page of the SSRS site. As long as nothing else recycles the AppPool during the day, that seems to keep the server responsive.

  3. Gireesh D A says:

    Simple setup to keep SSRS in warmed up state:

    To keep SSRS, in warmed up state, save the following script in text file and save as, say SSRSWarmup.vbs (this is vbscript).  And then set up a schedule in Windows to execute SSRSWarmup.vbs, every 1 hour or so, using command line "wscript C:SSRSWarmup.vbs".  You can set it up on either SSRS server or in any client PC, which has got access to SSRS report specified in URL (inside script).  SSRS is always in "warmed up" state!!!

    /***************************************************************************/

    Dim strURL, strFile

    Set webObj = CreateObject("MSXML2.ServerXMLHTTP")

    ' Replace below URL with the URL of any report in the reporting server

    strURL = "http://aubbhsqlrept01/Reports/Pages/Report.aspx?ItemPath=%2fRetail%2fCustomerDetailsReport&quot;

    webObj.Open "GET", strURL

    webObj.send

    /***************************************************************************/

Skip to main content