C# 从远程pc生成SSRS 2008 R2报告的速度比从本地pc慢

C# 从远程pc生成SSRS 2008 R2报告的速度比从本地pc慢,c#,ssrs-2008,C#,Ssrs 2008,(请注意,这不是仅首次运行的问题,每次都会发生) 我想知道是否有人遇到过以下情况 我们已经创建了一个c#应用程序,它从SSRS实例生成报告 当我在SSRS实例所在的服务器上运行此应用程序时,报告将在+-6秒内生成 当我从远程设备运行完全相同的应用程序时(相同的网络,只是SSRS实例的不同pc),相同的报告需要+-18秒 使用的代码类似于 ServerReport report = new ServerReport(); report.ReportServerUrl = new System.Ur

(请注意,这不是仅首次运行的问题,每次都会发生)

我想知道是否有人遇到过以下情况

我们已经创建了一个c#应用程序,它从SSRS实例生成报告

当我在SSRS实例所在的服务器上运行此应用程序时,报告将在+-6秒内生成

当我从远程设备运行完全相同的应用程序时(相同的网络,只是SSRS实例的不同pc),相同的报告需要+-18秒

使用的代码类似于

ServerReport report = new ServerReport();
report.ReportServerUrl = new System.Uri(reportSetup.ConnectionString);
report.ReportServerCredentials.NetworkCredentials = System.Net.CredentialCache.DefaultCredentials;
report.ReportPath = reportName;
report.SetParameters(reportParams);
byte[] bytes = report.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);
在哪里
ServerReport
来自
Microsoft.Reporting.WinForms
来自
C:\Program Files(x86)\Microsoft Visual Studio 10.0\ReportViewer\Microsoft.ReportViewer.WinForms.dll
(但也尝试了web版本),其余声明为

Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;
List<ReportParameter> reportParams
我从中读取时删除了行

rswindows协商

RSWindowsConfertive指示报表服务器处理身份验证 指定协商的请求。协商尝试Kerberos 首先进行身份验证,但如果使用Active Directory,则返回NTLM 无法将客户端请求的票证授予报表服务器。 只有在票证不可用时,协商才会退回到NTLM。 如果第一次尝试导致错误而不是票据丢失, 报表服务器不会进行第二次尝试

但这没有帮助


有没有人对如何更正代码或SSRS安装有任何想法?我希望应用程序位于SSRS实例的Seperate服务器上。

您可能不幸将应用程序从睡眠中唤醒。出于某种原因,在空闲时间结束后使SSR重新联机将惩罚您启动和加载环境的进程。一旦应用程序重新上线,它将以预期的方式处理请求

如果您可以通过创建每小时一次的任务来轮询资源,使唤醒不再是一个问题,并使系统更具响应性

  • 将包含以下内容的PowerShell文件创建到脚本文件夹中:

    $wc=新对象system.net.webClient $username='ReportAdmin' $password='ReportAdmin' $cred=New Object System.Management.Automation.PSCredential-ArgumentList@($username,(ConvertTo SecureString-String$password-AsPlainText-Force))

    $wc.Credentials=$cred
    $src=$wc.DownloadString(“http:///SSRS/Pages/Folder.aspx”)
    
  • 在脚本文件夹中创建包含以下内容的批处理文件:

  • powershell-命令“&C:\\SRSWakeup.ps1”

  • 创建一个每小时运行并保持SSR活动的作业。您可以通过保存此内容并将其导入windows任务管理器来实现这一点:(它将调用.cmd来调用powershell命令以保持SSR的活动状态

     <?xml version="1.0" encoding="UTF-16"?> <Task version="1.2"
      xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">  
     <RegistrationInfo>
          <Date>2012-10-29T17:57:58.8640417</Date>
          <Author>SERVER\AdminAccount</Author>
         <Description>Wakes up Reporting services when the service shuts down</Description>   </RegistrationInfo>   <Triggers>
          <CalendarTrigger>
           <Repetition>
              <Interval>PT1H</Interval>
              <StopAtDurationEnd>false</StopAtDurationEnd>
            </Repetition>
            <StartBoundary>2012-11-01T21:06:52.4488088</StartBoundary>
            <Enabled>true</Enabled>
            <ScheduleByDay>
              <DaysInterval>1</DaysInterval>
            </ScheduleByDay>
        </CalendarTrigger>   </Triggers>   <Principals>
          <Principal id="Author">
            <UserId>SERVER\AdminUser</UserId>
            <LogonType>Password</LogonType>
            <RunLevel>LeastPrivilege</RunLevel>
          </Principal>   </Principals>   <Settings>
          <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
          <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
          <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
          <AllowHardTerminate>true</AllowHardTerminate>
          <StartWhenAvailable>true</StartWhenAvailable>
          <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
          <IdleSettings>
            <StopOnIdleEnd>true</StopOnIdleEnd>
            <RestartOnIdle>false</RestartOnIdle>
          </IdleSettings>
         <AllowStartOnDemand>true</AllowStartOnDemand>
          <Enabled>true</Enabled>
          <Hidden>false</Hidden>
          <RunOnlyIfIdle>false</RunOnlyIfIdle>
          <WakeToRun>false</WakeToRun>
          <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
          <Priority>7</Priority>   </Settings>   <Actions Context="Author">
          <Exec>
            <Command>C:\<ScriptFolder\wakeup.cmd</Command>
          </Exec>   </Actions> </Task>
    
    
    2012-10-29T17:57:58.8640417
    服务器\管理员帐户
    在服务关闭时唤醒Reporting services
    PT1H
    假的
    2012-11-01T21:06:52.4488088
    真的
    1.
    服务器\管理员用户
    密码
    租赁权
    无知的新
    假的
    假的
    真的
    真的
    假的
    真的
    假的
    真的
    真的
    假的
    假的
    假的
    P3D
    7.
    
    C:\非常感谢您的努力,但正如第一行所示(请注意,这不是只针对首次运行的问题,每次都会发生)
    $wc.Credentials = $cred
    $src = $wc.DownloadString(“http://<SSRSSERVERNAME>/SSRS/Pages/Folder.aspx”)
    
     <?xml version="1.0" encoding="UTF-16"?> <Task version="1.2"
      xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">  
     <RegistrationInfo>
          <Date>2012-10-29T17:57:58.8640417</Date>
          <Author>SERVER\AdminAccount</Author>
         <Description>Wakes up Reporting services when the service shuts down</Description>   </RegistrationInfo>   <Triggers>
          <CalendarTrigger>
           <Repetition>
              <Interval>PT1H</Interval>
              <StopAtDurationEnd>false</StopAtDurationEnd>
            </Repetition>
            <StartBoundary>2012-11-01T21:06:52.4488088</StartBoundary>
            <Enabled>true</Enabled>
            <ScheduleByDay>
              <DaysInterval>1</DaysInterval>
            </ScheduleByDay>
        </CalendarTrigger>   </Triggers>   <Principals>
          <Principal id="Author">
            <UserId>SERVER\AdminUser</UserId>
            <LogonType>Password</LogonType>
            <RunLevel>LeastPrivilege</RunLevel>
          </Principal>   </Principals>   <Settings>
          <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
          <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
          <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
          <AllowHardTerminate>true</AllowHardTerminate>
          <StartWhenAvailable>true</StartWhenAvailable>
          <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
          <IdleSettings>
            <StopOnIdleEnd>true</StopOnIdleEnd>
            <RestartOnIdle>false</RestartOnIdle>
          </IdleSettings>
         <AllowStartOnDemand>true</AllowStartOnDemand>
          <Enabled>true</Enabled>
          <Hidden>false</Hidden>
          <RunOnlyIfIdle>false</RunOnlyIfIdle>
          <WakeToRun>false</WakeToRun>
          <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
          <Priority>7</Priority>   </Settings>   <Actions Context="Author">
          <Exec>
            <Command>C:\<ScriptFolder\wakeup.cmd</Command>
          </Exec>   </Actions> </Task>