Muokkaa

Jaa


Configure available memory for report server applications

Applies to: SQL Server 2016 (13.x) Reporting Services and later  Power BI Report Server

For content related to previous versions of SQL Server Reporting Services (SSRS), see What is SQL Server Reporting Services?

Important

The information in this article applies only to features related to paginated reports (RDLs) within Power BI Report Server. Power BI (PBIX) reports and their scheduled refresh activities within Power BI Report Server are not affected by these settings. For help with scheduled refresh memory, see Troubleshoot scheduled refresh in Power BI Report Server.

Although Reporting Services can use all available memory, you can override default behavior. You can override the behavior by configuring an upper limit on the total amount of memory resources that are allocated to Reporting 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 article 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 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:

  • The web portal, a Web front-end application for the report server.

  • 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's 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. 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. Requests that are directed to the background processing application are given a lower priority than requests directed to the Report Server Web service. 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 aren't accepted. The report server swaps in-memory data files to disk.

If memory constraints become severe and there's no memory available to handle new requests, the report server returns an HTTP 503 server unavailable error. This result happens while current requests are completing. In some cases, the application domains might be recycled to immediately reduce memory pressure.

Although you can't 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 quickly. This result 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 configuration allows more requests to complete. To do allow more requests to complete, you should lower the value for MemorySafetyMargin to make the low memory pressure zone smaller relative to the other zones. Doing so causes responses for medium and high memory pressure to occur earlier.

Configuration settings for memory management

Configuration settings that control memory allocation for the report server include WorkingSetMaximum, WorkingSetMinimum, MemorySafetyMargin, and MemoryThreshold.

  • 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. If you're hosting multiple applications on the same computer, this memory can be useful. You can determine that the report server is using a disproportionate amount of system resources relative to other applications on the same computer.

  • MemorySafetyMargin and MemoryThreshold set the boundaries for low, medium, and high levels of memory pressure. For each state, Reporting 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 doesn't 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:

Screenshot of the configuration settings for memory state.

The following table describes WorkingSetMaximum, WorkingSetMinimum, MemorySafetyMargin, and MemoryThreshold settings. 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.

By default, the report server sets WorkingSetMaximum to the amount of available memory on the computer. This value is detected when the service starts.

This setting doesn't appear in the RSReportServer.config file unless you add it manually. If you want the report server to use less memory, you can modify the RSReportServer.config file and add the element and value. Valid values range from 0 to maximum integer. This value is expressed in kilobytes.

When the value for WorkingSetMaximum is reached, the report server doesn't accept new requests. Requests that are currently in progress are allowed to complete. New requests are accepted only when memory use falls below the value specified through WorkingSetMaximum.

If existing requests continue to consume more memory after the WorkingSetMaximum value is reached, all report server application domains will be recycled. For more information, see Application Domains for Report Server Applications.
WorkingSetMinimum Specifies a lower limit for resource consumption; the report server doesn't release memory if overall memory use is below this limit.

By default, the value is calculated at service startup. The calculation is that the initial memory allocation request is for 60 percent of WorkingSetMaximum.

This setting doesn't appear in the RSReportServer.config file unless you add it manually. If you want to customize this value, you must add the WorkingSetMinimum element to the RSReportServer.config file. Valid values range from 0 to maximum integer. This value is expressed in kilobytes.
MemoryThreshold 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. The default value is 90. This value should be greater than the value set for MemorySafetyMargin.
MemorySafetyMargin 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 can't be used for report server operations. The default value is 80.

Note

MemoryLimit and MaximumMemoryLimit settings are obsolete in SQL Server 2008 (10.0.x) and later versions. 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. If you want to add WorkingSetMaximum or WorkingSetMinimum, you must type the elements and values in the RSReportServer.config file. Both values are integers that express kilobytes of RAM you're allocating to the server applications. The following example specifies that total memory allocation for the report server applications can't exceed 4 gigabytes. If the default value for WorkingSetMinimum (60% of WorkingSetMaximum) is acceptable, you can omit it and specify just WorkingSetMaximum in the RSReportServer.config file. This example includes WorkingSetMinimum to show how it would appear if you wanted to add it:

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

About ASP.NET memory configuration settings

Although the 2016 and later Report Server Web service and web portal are HTML5 applications, previous versions are ASP.NET applications, neither application responds to memory configuration settings that you specify in the processModel section of machine.config for ASP.NET applications that run in IIS 5.0 and higher compatibility mode. Reporting Services reads memory configuration settings from the RSReportServer.config file only.