A DotNetNuke site I have been working on that has some decent traffic, was experiencing an occasional Out of Memory Error. During peak traffic times, IIS would crap out and throw the error. IISReset was neccessary sometimes to alleviate the issue...very frustrating.
Here is the error:
InnerException: Exception of type System.OutOfMemoryException was thrown.
Message: DotNetNuke.Services.Exceptions.PageLoadException: Exception of type System.OutOfMemoryException was thrown. ---> System.OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown. --- End of inner exception stack trace ---
Environment:
- DotNetNuke 3.1
- Windows 2003 Server
- All of the latest patches/service packs
- MS SQL Server 2000
- 1.6 Gb Database size
- Dual 3 Ghz Xeons with 2 Gb RAM Dell 2850
After digging into logs and looking around Host > Schedule, I noticed that the errors coincided with the DNN Search Indexer schedule, so I stopped it. This helped for a bit, but as the site continued to grow (over 500,000 pages), the error began reappearing.
I had tried a few other things to get rid of the issue without success. For example, under Host > Schedule I enabled DotNetNuke.Services.Cache.PurgeCache, DOTNETNUKE and was purging every 30 minutes. I thought surely this would be the answer, kicking myself for not enabling it earlier. However, to my disappointment, the error persisted. ARRRRRRRR!
I feel strongly that SQL Server should be on it's own server, but due to a server shuffle in our rack and decommisioning an older server to make room for 3 other servers, we have been using a single server for both IIS and SQL Server for this site. We are working through a few Remote Procedure Call errors with DNN 3.x and 4.0 and SQL Server 2005 (will discuss in later post) and were forced to use this setup. This error would surely go away when we move our production database to our Quad Itanium Processor server with 12 Gb RAM, but unfortunately this was not an option. So, I started digging through MSDN and found the Server Memory Options.
"Use max server memory to prevent SQL Server from using more than the specified amount of memory, thus leaving remaining memory available to start other applications quickly. SQL Server does not immediately allocate the memory specified in max server memory on startup. Memory usage is increased as needed by SQL Server until reaching the value specified in max server memory. SQL Server cannot exceed this memory usage unless the value of max server memory is raised." - MSDN
So, I decided to give it a try...This is what I did:
- Opened Enterprise Manager
- Expanded the server group
- Right-clicked the server
- Clicked Properties
- Clicked the Memory tab
- Under Dynamically configure SQL Server memory, lower the Maximum
This seems to have worked. MS SQL Server is such a pig. By putting it on a diet and setting max server memory, the error has disappeared. I decided to do some testing and was beating up the server pretty bad with several crawlers/spiders I have built and was hitting the site hard. The only error I experienced during my testing was an occasional deadlock victim error, which is expected with the number of transactions taking place on this database. I will live with a temporary error over an IIS crash anyday. Moving everything back to seperate servers for IIS and SQL Server should help greatly for a DNN site of this size. Let's just hope the DNN team can knock out a few crtitical issues with RPC and SQL Direct provider.