設定報表伺服器應用程式的可用記憶體Configure Available Memory for Report Server Applications

雖然 Reporting ServicesReporting Services 可以使用所有可用的記憶體,但是您可以透過針對配置給 Reporting ServicesReporting Services 伺服器應用程式的記憶體資源總數設定上限,覆寫預設行為。Although Reporting ServicesReporting Services can use all available memory, you can override default behavior by configuring an upper limit on the total amount of memory resources that are allocated to Reporting ServicesReporting Services server applications. 此外,您也可以設定臨界值,讓報表伺服器根據系統處於低度、中度或嚴重記憶體不足壓力的情況,變更其設定優先權和處理要求的方式。You can also set thresholds that cause the report server to change how it prioritizes and processes requests depending on whether it is under low, medium, or heavy memory pressure. 在低度記憶體不足壓力層級時,報表伺服器的回應方式為提供稍高優先權給互動式或視需要報表處理。At low levels of memory pressure, the report server responds by giving a slightly higher priority to interactive or on-demand report processing. 在高度記憶體不足壓力層級時,報表伺服器會運用有限的資源並使用多種技術來維持運作。At high levels of memory pressure, the report server uses multiple techniques to remain operational using the limited resources available to it.

本主題將描述您可以指定的組態設定,以及當記憶體不足壓力成為處理要求的因素時,伺服器如何回應。This topic describes the configuration settings that you can specify and how the server responds when memory pressure becomes a factor in processing requests.

記憶體管理原則Memory Management Policies

Reporting ServicesReporting Services 會透過調整配置給特定應用程式和處理要求類型的記憶體數量,回應系統資源條件約束。responds to system resource constraints by adjusting the amount of memory that is allocated to specific applications and types of processing requests. 在報表伺服器服務中執行而且受限於記憶體管理的應用程式包括:Applications that run in the Report Server service and that are subject to memory management include:

  • 報表管理員 (報表伺服器的 Web 前端應用程式)。Report Manager, a Web front-end application for the report server.

  • 報表伺服器 Web 服務 (用於互動式報表處理和視需要要求)。Report Server Web service, used for interactive report processing and on-demand requests.

  • 背景處理應用程式 (用於排程報表處理、訂閱傳遞和資料庫維護)。A background processing application, used for scheduled report processing, subscription delivery, and database maintenance.

記憶體管理原則會套用至整個報表伺服器服務,而不會套用至在此處理序內部執行的個別應用程式。Memory management policies apply to the Report Server service as a whole, and not to individual applications that run within the process.

如果系統沒有任何記憶體不足的壓力,每個伺服器應用程式都會在啟動時 (接收要求之前) 要求一些記憶體,以便在最後收到要求時提供最佳效能。If there is no memory pressure on the system, each server application requests some memory at startup, in advance of receiving requests, to deliver optimum performance when requests are eventually received. 隨著記憶體不足的壓力逐漸增加,報表伺服器會根據下表所描述的方式調整其處理模型。As memory pressure builds, the report server adjusts its process model as described in the following table.

記憶體不足的壓力Memory pressure 伺服器回應Server response
Low 目前的要求會繼續處理。Current requests continue to process. 新的要求幾乎一定都會被接受。New requests are almost always accepted. 導向至背景處理應用程式之要求所收到的優先權會比導向至報表伺服器 Web 服務的要求更低。Requests that are directed to the background processing application are given a lower priority than requests directed to the Report Server Web service.
Medium 目前的要求會繼續處理。Current requests continue to process. 新的要求可能會被接受。New requests might be accepted. 導向至背景處理應用程式之要求所收到的優先權會比導向至報表伺服器 Web 服務的要求更低。Requests that are directed to the background processing application are given a lower priority than requests directed to the Report Server Web service. 這三個伺服器應用程式的記憶體配置會縮減,而且針對背景處理進行相對大幅的縮減,以便提供更多可用的記憶體給 Web 服務要求。Memory allocations for all three server applications are reduced, with relatively larger reductions to background processing to make more memory available for Web service requests.
High 記憶體配置會進一步縮減。Memory allocation is further reduced. 要求更多記憶體的伺服器應用程式會被拒絕。Server applications that request more memory are denied. 目前要求的處理速度會減慢而且花費更多時間才能完成。Current requests are slowed down and take longer to complete. 新的要求不會被接受。New requests are not accepted. 報表伺服器會將記憶體中資料檔案交換至磁碟。The report server swaps in-memory data files to disk.

如果記憶體條件約束變得很嚴格而且沒有記憶體可用來處理新的要求,當目前的要求完成時,報表伺服器將會傳回 HTTP 503 伺服器無法使用的錯誤。If memory constraints become severe and there is no memory available to handle new requests, the report server will return an HTTP 503 server unavailable error while current requests are completing. 在某些情況下,系統可能會回收應用程式定義域,以便立即縮減記憶體不足的壓力。In some cases, the application domains might be recycled to immediately reduce memory pressure.

雖然您無法針對不同的記憶體不足壓力狀況自訂報表伺服器回應,但是可以指定組態設定,以便定義分隔高度、中度和低度記憶體不足壓力回應的界限。Although you cannot customize the report server responses to different memory pressure scenarios, you can specify configuration settings that define the boundaries that separate high, medium, and low memory pressure responses.

自訂記憶體管理設定的時機When to Customize Memory Management Settings

預設設定會針對低度、中度和高度記憶體不足的壓力指定不相等的範圍。The default settings specify unequal ranges for low, medium, and high memory pressure. 根據預設,低度記憶體不足壓力區域比中度和高度記憶體不足壓力的區域更大。By default, the low memory pressure zone is larger than the zones for medium and high memory pressure. 這種組態是針對平均分配或以累加方式成長或降低的處理負載最佳化。This configuration is optimum for processing loads that are evenly distributed or that grow or decline incrementally. 在此狀況中,區域之間的轉換是漸進式而且報表伺服器具有調整其回應的時間。In this scenario, the transition between zones is gradual and the report server has time to adjust its response.

如果負載模式包含尖峰,修改預設設定就會很有用。Modifying the default settings is useful if the load pattern includes spikes. 當處理負載中突然出現尖峰時,報表伺服器可能會非常快速地從沒有記憶體不足壓力移至記憶體配置失敗的狀況。When there are sudden spikes in the processing load, the report server might go from no memory pressure to memory allocation failures very quickly. 如果您有多個需要大量記憶體之報表的並行執行個體,而且這些執行個體都同時啟動,就可能會發生這種情況。This might occur if you have multiple concurrent instances of a memory-intensive report that start at the same time. 為了處理這種處理負載類型,您想讓報表伺服器盡快移至中度或高度記憶體不足壓力的回應,以便減緩處理的速度。To handle this type of processing load, you want the report server to move into a medium or high memory pressure response as soon as possible so that it can slow down processing. 這樣做允許更多要求完成。This allows more requests to complete. 若要這樣做,您應該降低 MemorySafetyMargin 的值,讓低度記憶體不足壓力區域比其他區域更小。To do this, you should lower the value for MemorySafetyMargin to make the low memory pressure zone smaller relative to the other zones. 不過,這樣做會導致中度和高度記憶體不足壓力的回應提早發生。Doing so will cause responses for medium and high memory pressure to occur earlier.

記憶體管理的組態設定Configuration Settings for Memory Management

可控制報表伺服器之記憶體配置的組態設定包括 WorkingSetMaximumWorkingSetMinimumMemorySafetyMarginMemoryThresholdConfiguration settings that control memory allocation for the report server include WorkingSetMaximum, WorkingSetMinimum, MemorySafetyMargin, and MemoryThreshold.

  • WorkingSetMaximumWorkingSetMinimum 會定義可用記憶體的範圍。WorkingSetMaximum and WorkingSetMinimum define the range of available memory. 您可以設定這些設定,以便針對報表伺服器應用程式設定可用記憶體的範圍。You can configure these settings to set a range of available memory for the report server applications. 如果您要在同一部電腦上主控多個應用程式,而且您判斷出報表伺服器所使用的系統資源數量相對於同一部電腦上的其他應用程式而言不成比例,這樣做可能會很有用。This can be useful if you are hosting multiple applications on the same computer and you determine that the report server is using a disproportionate amount of system resources relative to other applications on the same computer.

  • MemorySafetyMarginMemoryThreshold 會設定低度、中度和高度記憶體不足壓力層級的界限。MemorySafetyMargin and MemoryThreshold set the boundaries for low, medium, and high levels of memory pressure. 針對每種狀態, Reporting ServicesReporting Services 會採取矯正措施來確保報表處理和其他要求會以適當的方式處理 (相對於電腦上可用的記憶體數量而言)。For each state, Reporting ServicesReporting Services takes corrective action to ensure report processing and other requests are handled appropriately relative to the amount of memory that is available on the computer. 您可以指定組態設定,以便決定低度、高度和中度壓力層級之間的區別。You can specify configuration settings that determine the delineation between low, high, and medium pressure levels.

    雖然您可以變更組態設定,但是這樣做不會改善報表處理效能。Although you can change the configuration settings, doing so will not improve report processing performance. 只有當要求在完成之前即被卸除時,變更這些組態設定才有用。Changing the configuration settings is useful only if requests are getting dropped before they complete. 改善伺服器效能的最佳方式就是將報表伺服器或個別的報表伺服器應用程式部署在專用的電腦上。The best way to improve server performance is to deploy the report server or individual report server applications on dedicated computers.

下圖將顯示這些設定如何一起用來區別低度、中度和高度記憶體不足壓力層級:The following illustration shows how the settings are used together to distinguish between low, medium, and high levels of memory pressure:

記憶體狀態的組態設定Configuration settings for memory state

下表將描述 WorkingSetMaximumWorkingSetMinimumMemorySafetyMarginMemoryThreshold 設定。The following table describes WorkingSetMaximum, WorkingSetMinimum, MemorySafetyMargin, and MemoryThreshold settings. 組態設定指定於 RSReportServer.config 檔中。Configuration settings are specified in the RSReportServer.config file.

元素Element 描述Description
WorkingSetMaximum 指定一個記憶體臨界值,達到此臨界值後,沒有任何新的記憶體配置要求會授與報表伺服器應用程式。Specifies a memory threshold after which no new memory allocations requests are granted to report server applications.

根據預設,報表伺服器會將 WorkingSetMaximum 設定為電腦上的可用記憶體數量。By default, the report server sets WorkingSetMaximum to the amount of available memory on the computer. 這個值是在服務啟動時偵測的。This value is detected when the service starts.

除非您手動加入這項設定,否則它不會顯示在 RSReportServer.config 檔中。This setting does not appear in the RSReportServer.config file unless you add it manually. 如果您想讓報表伺服器使用更少記憶體,可以修改 RSReportServer.config 檔並加入此元素和值。If you want the report server to use less memory, you can modify the RSReportServer.config file and add the element and value. 有效值範圍是從 0 到最大整數。Valid values range from 0 to maximum integer. 這個值是以 KB 表示。This value is expressed in kilobytes.

達到 WorkingSetMaximum 的值之後,報表伺服器就不再接受新的要求。When the value for WorkingSetMaximum is reached, the report server does not accept new requests. 系統會允許目前正在進行中的要求完成。Requests that are currently in progress are allowed to complete. 只有當記憶體使用量降到 WorkingSetMaximum 所指定的值以下時,才會接受新要求。New requests are accepted only when memory use falls below the value specified through WorkingSetMaximum.

如果現有的要求在達到 WorkingSetMaximum 值之後仍繼續耗用其他記憶體,則系統會回收所有報表伺服器應用程式定義域。If existing requests continue to consume additional memory after the WorkingSetMaximum value has been reached, all report server application domains will be recycled. 如需詳細資訊,請參閱< Application Domains for Report Server Applications>。For more information, see Application Domains for Report Server Applications.
WorkingSetMinimum 指定資源耗用量的下限。如果整體記憶體使用量低於此限制,報表伺服器將不會釋放記憶體。Specifies a lower limit for resource consumption; the report server will not release memory if overall memory use is below this limit.

根據預設,此值是在服務啟動時計算的。By default, the value is calculated at service startup. 計算內容是初始記憶體配置要求代表 WorkingSetMaximum 的 60%。The calculation is that the initial memory allocation request is for 60 percent of WorkingSetMaximum.

除非您手動加入這項設定,否則它不會顯示在 RSReportServer.config 檔中。This setting does not appear in the RSReportServer.config file unless you add it manually. 如果您想要自訂此值,就必須將 WorkingSetMinimum 元素加入至 RSReportServer.config 檔。If you want to customize this value, you must add the WorkingSetMinimum element to the RSReportServer.config file. 有效值範圍是從 0 到最大整數。Valid values range from 0 to maximum integer. 這個值是以 KB 表示。This value is expressed in kilobytes..
MemoryThreshold 指定 WorkingSetMaximum 的百分比,以便定義高度與中度壓力狀況之間的界限。Specifies a percentage of WorkingSetMaximum that defines the boundary between high and medium pressure scenarios. 如果報表伺服器記憶體使用量達到此值,報表伺服器就會讓要求處理的速度變慢,並且變更配置給不同伺服器應用程式的記憶體數量。If report server memory use reaches this value, the report server slows down request processing and changes the amount of memory allocated to different server applications. 預設值是 90。The default value is 90. 此值應該大於針對 MemorySafetyMargin 所設定的值。This value should be greater than the value set for MemorySafetyMargin.
MemorySafetyMargin 指定 WorkingSetMaximum 的百分比,以便定義中度與低度壓力狀況之間的界限。Specifies a percentage of WorkingSetMaximum that defines the boundary between medium and low pressure scenarios. 這個值是保留給系統而且無法用於報表伺服器作業之可用記憶體的百分比。This value is the percentage of available memory that is reserved for the system and cannot be used for report server operations. 預設值是 80。The default value is 80.

注意

SQL Server 2008SQL Server 2008 和更新版本中,MemoryLimitMaximumMemoryLimit 設定已經過時。MemoryLimit and MaximumMemoryLimit settings are obsolete in SQL Server 2008SQL Server 2008 and later versions. 如果您已升級現有的安裝,或正在使用包含這些設定的 RSReportServer.config 檔,則報表伺服器就不會再讀取這些值。If you upgraded an existing installation or using an RSReportServer.config file that includes those settings, the report server no longer reads those values.

記憶體組態設定的範例Example of Memory Configuration Settings

下列範例將顯示使用自訂記憶體組態值之報表伺服器電腦的組態設定。The following example shows the configuration settings for a report server computer that uses custom memory configuration values. 如果您想要加入 WorkingSetMaximumWorkingSetMinimum,就必須在 RSReportServer.config 檔中輸入這些元素和值。If you want to add WorkingSetMaximum or WorkingSetMinimum, you must type the elements and values in the RSReportServer.config file. 這兩個值都是整數,它們代表您配置給伺服器應用程式之 RAM 的 KB 數。Both values are integers that express kilobytes of RAM you are allocating to the server applications. 下列範例會指定報表伺服器應用程式的總記憶體不得超過 4 GB。The following example specifies that total memory allocation for the report server applications cannot exceed 4 gigabytes. 如果 WorkingSetMinimum 的預設值 (WorkingSetMaximum 的 60%) 可接受,您就可以省略它並單獨在 RSReportServer.config 檔中指定 WorkingSetMaximumIf the default value for WorkingSetMinimum (60% of WorkingSetMaximum) is acceptable, you can omit it and specify just WorkingSetMaximum in the RSReportServer.config file. 這則範例包括 WorkingSetMinimum,以便說明其顯示方式 (如果您想要加入它的話):This example includes WorkingSetMinimum to show how it would appear if you wanted to add it:

      <MemorySafetyMargin>80</MemorySafetyMargin>  
      <MemoryThreshold>90</MemoryThreshold>  
      <WorkingSetMaximum>4000000</WorkingSetMaximum>  
      <WorkingSetMinimum>2400000</WorkingSetMinimum>  

關於 ASP.NET 記憶體組態設定About ASP.NET Memory Configuration Settings

雖然報表伺服器 Web 服務和報表管理員是 ASP.NETASP.NET 應用程式,但是這兩個應用程式都不會回應您針對以 IIS 5.0 相容性模式執行的 ASP.NETASP.NET 應用程式在 machine.config 之 processModel 區段中指定的記憶體組態設定。Although the Report Server Web service and Report Manager are ASP.NETASP.NET applications, neither application responds to memory configuration settings that you specify in the processModel section of machine.config for ASP.NETASP.NET applications that run in IIS 5.0 compatibility mode. Reporting ServicesReporting Services 只會從 RSReportServer.config 檔讀取記憶體組態設定。reads memory configuration settings from the RSReportServer.config file only.

另請參閱See Also

RSReportServer 組態檔 RSReportServer Configuration File
RSReportServer 組態檔 RSReportServer Configuration File
修改 Reporting Services 組態檔 (RSreportserver.config) Modify a Reporting Services Configuration File (RSreportserver.config)
Application Domains for Report Server ApplicationsApplication Domains for Report Server Applications