Reducing memory usage on SBS servers december 4
http://blog.switchsystems.co.uk/2014/01/reducing-memory-usage-on-sbs-servers/
Lately we’ve been having some very sluggish performance out-of-the-box from some SBS servers, so i’ve been tweaking some configurations to make the servers perform a bit better. Things like:
- Limiting store.exe (Exchange Information Store) memory usage
- Limiting Sharepoint database memory usage
- Limiting WSUS database memory usage
- Making Remote Web Workspace “Connect to computer” work when 0 memory is available
Follow the steps below to tune your memory usage – and be warned, if you do things incorrectly then you can actually decrease the performance of your server!
Exchange and store.exe
You probably know that store.exe will normally just consume all available memory until the system decies that something else uses it, then it tries to relinquish that allocated memory. In practice we’ve found that this comes at a performance hit for other programs, so here’s how to limit the amount of memory store.exe utilises:
Overview: Use ADSIedit.msc to update msExchESEParamCacheSizeMin and msExchESEParamCacheSizeMax with page sizes.
- Run adsiedit.msc
- Connect to: Select a well known Naming Context : [Configuration]
- Expand the following:
- Configuration\Services\Microsoft Exchange\ (First Organization) \Administrative Groups\ (Exchange Administrative Group) \Servers\ (Server Name)
- Right click on CN=Information Store and click properties
- Update the values of msExchESEParamCacheSizeMin and msExchESEParamCacheSizeMax with values from the following table:
Target Cache Size
in GBmsExchESEParamCacheSize
for 2010+ (32KB pages)msExchESEParamCacheSize
for 2007 (8KB pages)1 32768 131072 2 65536 262144 3 98304 393216 4 131072 524288 6 196608 786432 8 262144 1048576 10 327680 1310720 12 393216 1572864 14 458752 1835008 16 524288 2097152 18 589824 2359296 20 655360 2621440 - Restart the Information Store service for the changes to take affect.
Sharepoint MSSQL database
The obvious use-case for most businesses is to just disable the service, as we don’t know anyone who runs SBS and actually uses Sharepoint, but if you do, you can limit it’s memory usage via the SQL Management Studio.
- Run the SQL Server Management Studio program (should be in Programs -> Microsoft SQL Server 2008 [R2]) from an ELEVATED ADMINISTRATOR session (right click on the shortcut and do ‘run as administrator’)
- Connect to: [SERVERNAME]\Sharepoint , using Windows Authentication
- Right click on the SQL server at the top of the tree view and select properties
- Goto the Memory section and then type in a value for “Maximum server memory (in MB)”
It’s a good idea to first check how much memory it’s currently using via the task manager! - Click OK
- Restart the SQL Service
WSUS Database
We’re going to do exactly the same thing for the WSUS database. It’s actually on it’s own “windows internal database” and not MSSQL Server, and it won’t allow TCP connections by default – this means we have to use a named pipe of \\.\pipe\mssql$microsoft##ssee\sql\query to connect to it.
- Run the SQL Server Management Studio program (should be in Programs -> Microsoft SQL Server 2008 [R2]) from an ELEVATED ADMINISTRATOR session (right click on the shortcut and do ‘run as administrator’)
- Connect to: \\.\pipe\mssql$microsoft##ssee\sql\query , using Windows Authentication
- Right click on the SQL server at the top of the tree view and select properties
- Goto the Memory section and then type in a value for “Maximum server memory (in MB)”
It’s a good idea to first check how much memory it’s currently using via the task manager! - Click OK
- Restart the SQL Service
Configuring Remote Web Workspace
Since the .net 4.5.1 framework update, there may be problems launching .net processes out of IIS – this is due to some memory checking that now happens which checks that you have at least 5% free memory. The following error is logged in the event log:
Exception type: InsufficientMemoryException Exception message: Memory gates checking failed because the free memory (xxxx bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
This can be fixed by performing the following:
- Open web.config file located at: “%ProgramFiles%\Windows Small Business Server\Bin\WebApp\RemoteAccess”.
- Search in Web.config for “<serviceHostingEnvironment aspNetCompatibilityEnabled=”true” />”, change this line to “<serviceHostingEnvironment aspNetCompatibilityEnabled=”true” minFreeMemoryPercentageToActivateService=”0″/>
- Save changes and close the file.
- Run IISRESET from an elevated Command Prompt window
Links and Source Articles:
[MS Technet] Exchange 2010 store.exe service takes high memory utilization.
Limit Exchange 2010 / 2007 Store.exe Memory Usage on a Windows Small Business Server 2011 / 2008
SBS 2011 Exchange Memory Usage Limits with side note for Exchange 2007
Troubleshooting “An unexpected error occurred” message when using Remote Web Access to connect to computers