2013-03-20 87 views
1

(請注意,這不是第一次運行中唯一的問題,這種情況每次)生成SSRS 2008年從遠程PC C#R2報告比從本地PC慢

我想知道是否有人遇到以下情況。

我們創建了一個c#應用程序,可以從SSRS實例生成報告。

當我在SSRS實例所在的服務器上運行此應用程序時,報告生成時間爲+ - 6秒。

當我從遠程盒子運行完全相同的應用程序(同一個nework,只是不同的pc到SSRS實例),同一個報告需要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); 

其中 ServerReportMicrosoft.Reporting.WinFormsC:\Program Files (x86)\Microsoft Visual Studio 10.0\ReportViewer\Microsoft.ReportViewer.WinForms.dll(但也嘗試了網頁版),其餘被聲明爲

Warning[] warnings; 
string[] streamids; 
string mimeType; 
string encoding; 
string extension; 
List<ReportParameter> reportParams 

和reportSetup.ConnectionString是http://<server name>/ReportServer的形式(這裏的服務器名稱是實際的名稱,但我也嘗試過使用IP)。

我定時了上述每個步驟,anf發現罪魁禍首是在它設置參數的行上。所以我將參數值存儲在實際報告中的默認值中,並刪除了該步驟。然後渲染花費的時間比以前更長。

進一步說我也試圖改變從網絡報告服務配置管理器服務帳戶的本地帳戶,並在配置文件在C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer

最初發現的身份驗證設置(rsreportserver.config)發揮各地身份驗證設置爲

<Authentication> 
    <AuthenticationTypes> 
     <RSWindowsNegotiate/> 
     <RSWindowsNTLM/> 
    </AuthenticationTypes> 
    <RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel> 
    <RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario> 
    <EnableAuthPersistence>true</EnableAuthPersistence> 
</Authentication> 

我刪除行<RSWindowsNegotiate/>當我從Authentication Types in Reporting Services

閱讀

RSWindowsNegotiate

RSWindowsNegotiate指示報表服務器處理指定協商身份驗證 請求。協商首先嚐試Kerberos 身份驗證,但如果Active Directory 無法爲客戶端請求授予票證給報表服務器,則會首先嚐試進行身份驗證,但會回退到NTLM。 如果票證不可用,協商將只能回退到NTLM。 如果第一次嘗試導致錯誤而不是丟失票證, 報表服務器不會再次嘗試。

但這沒有幫助。

有沒有人有任何想法如何糾正代碼或SSRS安裝?我希望應用程序在SSRS實例的服務器上運行。

回答

0

您可能已經不幸地從睡眠中喚醒了應用程序。出於某種原因,在閒置時間到期後將ssrs重新聯機會使您在啓動時和加載環境的過程中受到懲罰。一旦應用程序重新聯機,它將以可預期的方式處理請求。

如果你們都可以從出現問題的景象中喚醒,並通過創建一個小時任務來輪詢資源來提高系統的響應速度。

$ WC =新物體system.net.webClient $用戶名= 'ReportAdmin' $密碼=「ReportAdmin:

  1. 與以下內容到一個腳本文件夾中創建一個PowerShell文件「 $名氣=新物體System.Management.Automation.PSCredential -ArgumentList @($的用戶名,(的ConvertTo-SecureString的-STRING $密碼-AsPlainText -Force))

    $wc.Credentials = $cred 
    $src = $wc.DownloadString(「http://<SSRSSERVERNAME>/SSRS/Pages/Folder.aspx」) 
    
  • 創建與此內容在腳本文件夾中的批處理文件:

  • 的powershell -command 「& 'C:\\ SRSWakeup.ps1'」

    1. 創建每小時運行一次並保持ssrs活力的工作。您可以通過保存和導入此內容到Windows任務管理器做到這一點:(它會調用.CMD調用電源外殼命令,以保持SSRS活着

      <?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> 
      
    +0

    非常感謝你的努力。 ,但作爲第一行讀取**(請注意,這不是第一次運行唯一的問題,這種情況每次都會發生)** – 2013-03-21 06:54:03