简体   繁体   English

SQL Server Reporting Services在显示第一个报告之前需要花费很长时间初始化配置文件

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

I design GUIs for clients on window based servers. 我为基于窗口的服务器上的客户端设计GUI。 These systems are on very powerful Dell power edge servers. 这些系统位于功能非常强大的Dell Power Edge服务器上。 Inside the GUI, the client is able to open a web-browser that automatically opens the report selected. 客户端可以在GUI中打开一个网络浏览器,该浏览器会自动打开所选的报告。 Clients access the GUI remotely, and log off in-between visits. 客户端远程访问GUI,并在两次访问之间注销。

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. 用户首次登录并尝试访问报告时,打开报告以查看数据最多需要45秒钟。 Every report after that loads in less than 5 seconds. 之后的每个报告将在不到5秒的时间内加载。 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. 我进行了一些研究,发现Sql Server需要先拉出所有报表服务器配置文件,才能显示第一个报表,这需要很长时间。

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. 默认情况下,配置文件仅存储12个小时,我认为可以在Report Services配置文件中最多设置几天。 This still requires the 45 second load time every other day or so. 仍然每隔两天左右需要45秒的加载时间。

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. 服务器正在24/7全天候运行,并且仅在断电期间关闭。 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. 在每次启动期间,SSRS 2005 Web服务读取并解密rsreportserver.config文件,由于连接池为空,它必须物理地打开两台服务器之间的套接字连接,并登录到数据库实例,等等。服务必须对Windows服务进行RPC调用才能获取加密密钥。 There is an idle timeout value which forces the application to shut down after 20 minutes by default. 有一个空闲超时值,默认情况下会强制应用程序在20分钟后关闭。 We can tweak this timeout setting to have the application always up and running. 我们可以调整此超时设置以使应用程序始终运行。

Solution SSRS 2005 解决方案SSRS 2005

First start Internet Information Services Manager from Control Panel -> Administrative Tools. 首先从控制面板->管理工具启动Internet Information Services管理器。 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. 在“应用程序池属性”窗口中选择“性能”选项卡,您将看到默认设置“空闲超时”为20分钟。

There are two ways to disable the idle timeout: 有两种方法可以禁用空闲超时:

  1. uncheck the checkbox in front of the setting or 取消选中设置前面的复选框,或者
  2. set it to 0. 将其设置为0。

Solution SSRS 2008 解决方案SSRS 2008

For SQL Server 2008 you can make a modification to the "RecycleTime" parameter in your report server config file. 对于SQL Server 2008,可以在报表服务器配置文件中修改“ RecycleTime”参数。 It will be located in the following folder: 它将位于以下文件夹中:

drive:\\ Program Files\\Microsoft SQL Server\\MSRS10.MSSQLRS\\Reporting Services\\ReportServer\\rsreportserver.config 驱动器:\\ 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. 它取决于调度程序并执行PowerShell脚本,该脚本将停止并启动SSRS服务(与重新启动应用程序域具有相同的作用),并且在重新启动后,它将向报告管理器URL发出请求,该请求将报告服务强制发送至加载所有配置等。然后立即向SSRS发送所有后续请求。

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. 您可以使用“计划任务” GUI创建计划任务,或执行以下命令从命令提示符下创建计划任务。 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"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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