SCVMM high RAM usage and crashing

As standard SCVMM (system center virtual machine manager) will save all job logs for the last 90 day’s, now if you have a very active cluster or something like ProTips running that can be a lot of logs saved in your database. The main problem is that each time you open up a new admin console every single job is loaded from the SQL database, needless to say if you have a load of logs this can take a while, and use a vast amount of system memory.

Microsoft recommend that you don’t have more than 50,000 records, personally I like to keep it under 10,000. What you keep is up to you, but bare in mind more logs uses more RAM and in turn makes things slower. In my case there were over half a million, this used about 2GB of RAM for each admin console.

Fix1. (Slow Method)

Well if you noticed the problem early enough you can probably just get away with reducing the 90 days threshold. Fairly simple to do, just change the below registry key on the system center server:

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft System Center Virtual Machine Manager Server/Settings/SQL
TaskGC - Default 90 (90 Day's)

Now there is a few issues with this, the “clean up” is only performed every 20 hours, something that I am not sure if you can change.So if your database is anything like mine was with 500,000+ entries, this is going to take a while, if it finishes at all.
The easy way to do it is just keep restarting the SCVMM service, however this obviously effects any other users trying to get work done.  The better way is manually running the SQL stored procedure, see Fix2.

Fix2 (Clean Up)

You need to login to your SQL server and run the following command against your VirtualMangerDB.
This will only delete 50,000 records at a time, so be prepared to run the command a few times as required. Indeed it’s possible to increase the limit in the stored procedure, however  it seems more clean just to run it a few times.

DECLARE @CutoffDateTime datetime
SELECT @CutoffDateTime= '1/1/2011'
EXECUTE [VirtualManagerDB].[dbo].prc_TR_GarbageCollect @CutoffDateTime
DECLARE @CutoffDateTime datetimeSELECT @CutoffDateTime= '1/1/2011'EXECUTE [VirtualManagerDB].[dbo].prc_TR_GarbageCollect @CutoffDateTime

Technology enthusiastic with many ongoing online projects one of which is this personal blog PingBin. While also working full time within a data center designing and maintaining the network infrastructure.

Leave a reply:

Your email address will not be published.