Limiting Exchange 2010 SP1 Database Cache

Some time ago, I blogged about on how to limit the amount of memory Exchange 2010 can allocate for database cache. After the introduction of Exchange 2010 Service Pack 1 this didn’t seem to work anymore, as many people reported.

After some investigation, it turns out you also need to set the msExchESEparamCacheSizeMin value for Exchange 2010 SP1’s cache manager to honor the minimum and maximum limits for allocating database cache memory.

To show you this, I’ll first show Exchange 2010 SP1 where I only set msExchESEparamCacheSizeMax. In this example, I’ll use a value of 1024 which corresponds to 32 MB (1024 * 32kb pages). I then turned on Performance Monitor and started monitoring the following MSExchange Database Cache\Information Store counters:

  • Database Cache Size, the current allocated database cache size;
  • Database Cache Size Min, the minimum database cache size;
  • Database Cache Size Max, the maximum database cache size.

After restarting the Information Store and putting on some load on the Exchange server, you will see that the allocated database cache (green line) rises above the configured maximum (blue line).

image

When you check the database cache minimum size (red line), you’ll see it contains a default value, which can be larger than the configured maximum. So apparently, Exchange 2010 SP1’s cache manager contains different logic compared to Exchange 2010 RTM when the (default) minimum value is larger than the configured maximum.

To get Exchange 2010 SP1 to honor the configured msExchESEparamCacheSizeMax value, we need to configure msExchESEparamCacheSizeMin as well. The location is identical, so consult the initial post on how to perform this step; where it reads msExchESEparamCacheSizeMax, use msExchESEparamCacheSizeMin as well.

When we configure a value of 256 for msExchESEparamCacheSizeMin (8 MB) we get the following result after restarting the information store:

image

As you can see, the reported database cache size now nicely flattens out around the 32MB line when under load. Notice that it may go over it a little bit once in a while, but that may have to do with allocating and releasing memory.

Now only one question remains: is this a fault in Exchange 2010 SP1 or expected behavior. At least, it’s different behavior when compared to earlier Exchange versions.

Note that the above information also applies to Small Business Server 2011 since SBS2011 includes Exchange 2010 SP1.

49 thoughts on “Limiting Exchange 2010 SP1 Database Cache

  1. Pingback: Limiting Exchange 2010 Database Cache « EighTwOne (821)

  2. Thank you very much for this article. I have just deployed Exchange in a single server scenario for a small office (less than 20 users) and was only using the 1 server for Active Directory and Exchange both. This helps me reserve some RAM for other tasks so they are not all taken up with by the Exchange store.

  3. Thanks a lot. Now it works fine with settings this second variable too.
    That store.exe is behaving very strange. After setting these variables (to a max of 4Gb) it is now not consuming more then 50Mb! Whilest, without the settings, it peaked quite immediat to 9GB.

    Microsoft can explain what they want, but a process that consumes all the memory available … it sounds more like a huge memory leak, than a well managed process thread.

    environment: SBS2011

    all my best,
    kristof

      • It may take longer, but for a lot of users in small office environments it is really -just- email, and a few milliseconds to allocate some RAM doesn’t matter at all as long as the rest of the system is responsive.

        I just “fixed” a situation at a small dentist’s office with a box that has 8 hyperthreading Xeon cores and 16GB of RAM and very little software running on the server: It just does a little bit of email with Exchange, spools a few printers, stores a few files, and does some SQL stuff for their patient database.

        The machine was actively swapping and being unpredictably slow. Simple single-page print jobs would hang for nearly a minute before proceeding. Patient lookups would take 10 or 15 seconds.

        There are only two users that ever really use Exchange there. And to serve these two users, Exchange (or rather, store.exe) was using 9GB of RAM for itself!

        Now, sure, that’s by design. But it’s a bad design for a system that does more than handle email.

        After limiting the database cache and restarting the requisite service, and doing nothing else at all, the system was immediately more responsive. Printing became nearly instantaneous, as did database queries. In other words, it began acting like a fast, lightly-loaded server ought to.

        “Directly influences end user experience,” indeed.

        Anyhow, many thanks for the information. It was invaluable in troubleshooting this system today.

  4. @mdrooij – MS and the Exchange team can say that all they want but I notice an extreme performance difference when Exchange is allowed to exhaust all available memory vs. when I throttle it with these parameters.

    Maybe this is more pertinent to SBS 2011 than a machine dedicated to Exchange – but in the end it doesn’t matter – Exchange store consuming all the memory really kills the performance of my box!

  5. I tried this min setting with value 256 on sbs 2011 exchange 2010 sp1. Store.exe does not go over 67MB. If i only have the max setting of 5GB it becomes 7GB in size, eating up all my RAM (same as without the max setting). Anyone solved this yet? I want the store.exe to be 5GB to have 2GB free space for other programs.

  6. I’m using SBS 2011 Standard as an AD/File server only for 25 users… no Exchange in use… what’s the minimum I can set these parameters to before exchange becomes unstable to save memory since it’s not used at all (disabling the services is not recommended apparently), Thanks

      • I know its stupid but originally plan was to use SBS 2011 essentials but then we hit the user limit… so SBS 2011 std seemed good… will likely use the sharepoint/wsus etc… we only have one physical server (this a remote office in the americas so very hard to purchase server equipment) … don’t want to virtualize (raw IO speed important to the engineering apps we use, local tech support doesn’t understand virtualization) and can’t afford a proper SAN….. so SBS 2011 STD seemed the way to go….

  7. Pingback: Limiting Exchange 2010 Database Cache « Thanh Long's Blog

  8. I still dont understand how to set the msExchESEparamCacheSizeMin variable. To limit the msExchESEparamCacheSizeMax setting to 12 gigs, it appears I’d triple the example you gave, or set it to 393216. Waht do I set the Min variable to on 2010 sp1?

  9. NOT works (sbs 2011). Same as ssstofffStof and David.

    Setting to 4Gb max, and 8 Mb min yields ~50Mb for store.exe and never exeeds it.

    Why?

  10. I’m finding that this has noi effect on 2010 SP1 Rollup 5. Dell tech support did some testing and found that it did not work for them with Rollup 4v2 or 5, which supports my results.

    With the changes in, with either 8 or 80 megs min, nd 12 gigs max, it never went above about 265 megs. I rolled out the changes and on a 32 gig 2011 SBS machine, it is now about 19.2 gigs for the IS, with about 700 megs free. Does anyone know how to make this work on a Rollup 5 machine?

    Can anyone contradict this and say it worked for them on a rollup 4v2 or 5 machine? There is a BES Express 5.03 machine on a diffferent server in this envorinment.I think the memory issue related to BES which was allegedly fixed in Ru3 is still not fixed…

    • I am experiencing something similar. I’m on 4v2 Rollup right now. I set the min at 2 GB and the max at 25 GB. It hasn’t gotten over 2.5 GB in 48 hours. So far, I haven’t noticed performance issues (350 + users), but I am thinking I am going to go back to clearing the values at this point to ensure performance for the information store.

      • Six questions: (1) single or multiple roles; (2) how much RAM, (3) have you tried more than one MIN setting; and (4) if so, what were the results? (5) Do you have a condition where the store size quickly runs up to the top of does it appear to be legit use or a memory leak? And (6) if it does max out, does it ever go back down significantly on its own?

        I have only 8 users but 3 with mailboxes from 6 to 12 gigs on an SBS 201i box with 32 gigs. So according to the chart for a multiple role box, it’ll try to take 20 gigs and I find that to be true but it never quite gets there, maxing out at about 19.3 gigs or so. I’m thinking I should try to limit the cache to so the rest of the system has a few gigs of memory to play with. So I then might have to set min and max the same.

  11. Pingback: Exchange 2010 High Memory Usage » Botha Thiart's IT Blog

  12. Pingback: 2011, a short Retrospective « EighTwOne (821)

  13. Pingback: Limit Memory Usage of store.exe – Microsoft Exchange | Windows Admin Notes

    • The issue I’m seeing on my SBS 2011 system is twofold: if I make any change to the min size, the store opens at around 65 megs and stays there. If I don’t change the settings, the cache will go to just under 20 gigs within 24 hours. Usually, it stays put for abourt 12 hours and then starts marching upwards until there is about 500 megs free on the 32 gig server, with an IS of about 19,300 megs.

      If I disble BES Express 5 (any version, doesn’t seem to matter but it’s at 5.0.3 MR1) Exchange behaves normally. So it seems to come down to (a) get rid of BES; or (b) have a broken server.

  14. having difficulty finding the performance counters
    “Performance Monitor and started monitoring the following MSExchange Database Cache\Information Store counters”
    i see MSExchange Database\Database Cache Size, but not the ones seen in the article

  15. Pingback: SBS 2011 – Is Store.exe High Memory Usage Normal? - Admins Goodies

  16. After one week of battling, it has finaly worked. I was recieving all kind of answers, some say my AD is not functioning well, some say I have done missmatch setting in AD. but the problem was simple, my mail sever is out of memory, so what is comsuming the memory? how to alocate a memeory size to the application consuming all the memory? until I felt on this thread and compare it to other thread now I vote it 100% solution to this problem. this http://technet.microsoft.com/en-us/library/bb691304%28v=exchg.80%29.aspx is very important concerning Max alocation size. Thank you all, my exchange server is runing like a jet plan.

  17. Hi This, method works for me for a short time then store.exe memory usage went up to 10Gb though I have set it to 7GB, any idea?

  18. I had been searching the net for a while and came across this post. I found it very informative and useful. My server is running much more efficiently now that I have better control over this. Thanks for a great post!

  19. Hi, in my side the memory comming hight several mounth after installation (SBS2011 std).
    Why at the begining I has any problem and soudenly I have this problem (store take one day to use all memory).
    After an update ? maybe ? I don’t like when there is non explication of this kind of event.
    Thanks in advance

  20. I have an Exchange 2010 box which normally consumes a full 20GB of RAM, and I find that this behavior chokes some other services I have running on the box and makes the whole thing go very sluggish.

    I’ve decided to restrict it to 16GB, so I’ve used 256 for msExchESEParamCacheSizeMin and 524288 for msExchESEParamCacheSizeMax. However after 3 full days it now only uses a bit more than 1GB RAM.

    Has anyone else seen this behaviour? Does anyone know what might be causing it?

    Thanks, Steve.

  21. Pingback: SBS 2011 Exchange Memory Usage Limits with side note for Exchange 2007 | Meridian's Blog

  22. Hi!

    This fix works exactly as it should. To check if it works for you, go to perfmon and add a counter MSExchange Database\Database Cache Size (MB) for Information Store instance. You pick an instance after selecting the aforementioned counter.
    If you limit it to 4 GB, it should max out at 4.000.001 (as is in my case) in perfmon.

  23. After applying this ‘fix’, my store.exe will not rise to the specified Max, as others have reported here. Is there a reason/solution for this?

    I have set a min of 256 (8MB) and a max of 65536 (2GB) for my Exchange 2010 on SBS 2011. Store.exe has not gone over 50MB. ???

    • After a few weeks of testing different settings on an Exchange 2010 SP2 box running on SBS 2011 Standard I found that it never rose much higher than the
      Database Cache Size Min and would only “Spike” towards the max…. With 32 Gigs of Ram I was getting warning that the services on the machine were out of memory. I reduced the min to 14gb and the Max to 16gb and the store has been happy at 14.5GB now for over a week.. Hope this helps….

  24. Pingback: IIS High use & Server Performance issues - Admins Goodies

  25. Pingback: New Store, new memory tuning techniques required | Thoughtsofanidlemind's Blog

  26. I have the same exact problem with SBS 2011 with 16 GB of memory, all memory is “eaten” by SBS exchange processes , reading this article is very helpful however, I can’t find the “msExchESEParamCacheSizeMax” or any of the other objects that need to be configured, can anybody help? screenshots?

  27. Pingback: Limiting Exchange Server 2007 and 2010 Database cache – Slow SBS 2011

  28. Pingback: Windows SBS 2011 DNS Role (service) failing & needing restarting

  29. Pingback: EighTwOne 2013 Annual Report | EighTwOne (821)

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