Configuring Available Memory for SQL Server Reporting Services

If you need to configure the amount of memory available to an instance of SSRS you have to get your hands dirty and edit the RsReportServer.config file. The RsReportServer.config file stores settings that are used by Report Manager, the Report Server Web service, and background processing.

The location of the rsconfile file is generally:

\Program Files\Microsoft SQL Server\MSRS1111.MSSQLSERVER\Reporting Services\ReportServer

Within the RsReportServer.config file, configuration settings that control memory allocation for the report server include WorkingSetMaximum, WorkingSetMinimum, MemorySafetyMargin, and MemoryThreshold. If you were to open the file you will see that the WorkingSetMinimum and WorkingSetMaximum are not present by default.


	<Service>
		<IsSchedulingService>True</IsSchedulingService>
		<IsNotificationService>True</IsNotificationService>
		<IsEventService>True</IsEventService>
		<PollingInterval>10</PollingInterval>
		<WindowsServiceUseFileShareStorage>False</WindowsServiceUseFileShareStorage>
		<MemorySafetyMargin>80</MemorySafetyMargin>
		<MemoryThreshold>90</MemoryThreshold>
		<RecycleTime>720</RecycleTime>
		<MaxAppDomainUnloadTime>30</MaxAppDomainUnloadTime>
		<MaxQueueThreads>0</MaxQueueThreads>

This is because you have to enter them yourself, as 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.


	<Service>
		<IsSchedulingService>True</IsSchedulingService>
		<IsNotificationService>True</IsNotificationService>
		<IsEventService>True</IsEventService>
		<PollingInterval>10</PollingInterval>
		<WindowsServiceUseFileShareStorage>False</WindowsServiceUseFileShareStorage>
		<MemorySafetyMargin>80</MemorySafetyMargin>
		<MemoryThreshold>90</MemoryThreshold>
		<RecycleTime>720</RecycleTime>
		<WorkingSetMaximum>786432</WorkingSetMaximum>
		<WorkingSetMinimum>524288</WorkingSetMinimum>
		<MaxAppDomainUnloadTime>30</MaxAppDomainUnloadTime>
		<MaxQueueThreads>0</MaxQueueThreads>

The values that these two take are in KB. Once you have made your change save the file. Once you have saved, the service will restart and the changes will take place.

What is odd about this is that the two configs that are present by default in the file,  MemorySafetyMargin and MemoryThreshold, are percentages based on the two that we have added. Whether this means that they are ineffective until we add these two, or whether they specify in percentage the total amount of memory available to the server I don’t know. However, MSDN states that:

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 cannot be used for report server operations. The default value is 80.

So it seems that these are not active until the other values are entered, which I find a bit strange, unless I am reading the article wrong.

Summary

We have reporting services deployed across multiple environments in various configurations. Rarely has memory pressure ever been an issue, however when SSRS shares a server with several other features (as it is in one of our test environments) we can see those suffer from memory pressures as SSRS has taken a considerable amount of memory for itself and has not yet relinquished it. By changing this other features have not suffered from memory pressure. I was quite lucky in that i started rather arbitrarily with the settings above (well, I subtracted what our DB Engine instance required, what our other services required and what the OS required, and anything left over I gave to SSRS) and we have yet to have issues with SSRS memory pressure. I’m sure that for most people it will be a more iterative process.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s