|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Management - Bumping up Memory Use
From MS's documentation and the stats of our server it looks as though IIS by default only uses up to 50% of the system's memory.
We are running IIS 6 in IIS 5 Isolation Mode to help troubleshoot some problems with our site. While I'm confident the problem is in the code (I'm not the developer) it would be nice to see the server use more than half the available RAM since this is a dedicated machine. We've tried some suggestions found around the net but our stats consistently show that the max amount of RAM ever used is exactly 50%. Any ideas for how to make this happen in IIS 6 running in IIS 5 Isolation Mode? Thanks, Bryan |
|
#2
|
|||
|
|||
|
Isolation mode is really only to be used for debugging. Running a live site is not recommended. It might make more sense to post the problems you are having and see if someone here can help...?
|
|
#3
|
|||
|
|||
|
Well, I was hoping to deal with the errors in a separate post. I agree that there is some sort of memory leak in the code and we need to try and figure it out. At the same time, I would like to see IIS take more than 50% (2 Gigs) of available RAM if it wants it. Why have tons of RAM if you can only use half? Or is that a limitation specifically to Isolation Mode?
That being said, here's the errors from the event viewer: Error: File /LM/W3SVC/1652734982/Root/global.asa Line 37 Out of memory. Unable to allocate required memory.. Then ISAPI 'C:\WINDOWS\system32\inetsrv\asp.dll' reported itself as unhealthy for the following reason: 'ASP unhealthy due to an out of memory condition.'. The path to global.asa is a bit funky because they are re-using it for all of the 18 sites we run. Each site essentially runs the same code from what I'm told; I'm not the developer. Here's global.asa with line 37 in bold: Code:
<!-- #include Virtual="/console/common/dbconnect.asp" -->
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Application.Lock
' site specific properties
Application.Value("DSN") = "Provider=MSDASQL; Driver={SQL Server}; Server=XXXXXX; Database=XXXXX; UID=XX; Password=XXXXXX;"
Call Application_Inc
' CPDataSet Properties
Application.Value("ThrowError") = "False"
Application.Value("RecPerPage") = 15
Application.Value("RelatedModules") = "Media Manager, Publications::Our Daily Bread Articles, Products, FAQs"
Application.Value("RelatedSearchField") = "5th Tier Type"
Application.Value("PubComSSL") = "True"
Application.UnLock
End Sub
Sub Session_OnStart
Call Session_Inc
End Sub
Sub Session_OnStart
Const MaxCartItems = 50
Const CartAttributes = 6
ReDim arrProductCart(CartAttributes,MaxCartItems)
Session("ProductCart") = arrProductCart
Session("CartItem") = 0
End Sub
</SCRIPT>
|
|
#4
|
|||
|
|||
|
The idea of isolation mode is for debugging...debugging because you have problems...it is not a good idea to hand over all the memory to a potentially bad app
So they don't Isolation mode is fairly limited and I don't think you can change much of it's behaviour, but that is all for a reason. Now, for all the different sites you have, do you have a separate app pool for each one? Or are they trying to run under the same one? I'll give you a hint - in isolation mode you are running just the one, so if normally you aren't, then you are now. Is there is a Session_OnEnd in there somewhere too? Might help to post the entire global.asa if that is only an excerpt. |
|
#5
|
|||
|
|||
|
Oh, it might also be a good idea to edit your username and password out of your database connection string
![]() XXXXX will do fine ![]() |
|
#6
|
|||
|
|||
|
Thanks for the heads up ... I'm such an idiot. I usually have nothing to do with our site but got involved recently. So I'm not an IIS or ASP expert by any stretch although I do plenty of other types of administration and coding.
I believe when we ran the site normally in IIS 6 each site had it's own app pool. To be honest, I don't know how I would check that so I'm working from what I've inferred from others. We were getting a variety of errors all of which led us nowhere. So we went into Isolation Mode to debug and the site has been much more stable with the exception of the errors I've mentioned. That is the entire global.asa file, there is no On_End. EDIT: Just got confirmation; they were running in individual app pools before we moved to Isolation Mode. Also, I should note that these errors are not immediate. As you can imagine, a reset helps for 12 hours or so until we start seeing them crop up again. |
|
#7
|
|||
|
|||
|
My guess is you need to put some _OnEnd code in there to ensure clean up of variables (http://www.w3schools.com/ASP/asp_globalasa.asp has some good info), and perhaps tweak some the memory recycle settings for the AppPools in IIS. Quite simply, your sites are running out of memory, and that is basically because they aren't freeing any of it when they are finished. I guess you knew that though
In IIS Manager, if you right click on an AppPool, and select properties, you get the Recycling tab first up. You could try setting a lower threshold on the time to recycle (default is 1740 minutes - 29 hours!), and even set times to force recycling to occur, like the middle of the night. This may alleviate some of the issues you are having, but bear in mind it will only be masking your deeper issue. |
|
#8
|
|||
|
|||
|
Quote:
Thanks for your help and the useful guidance. Can I assume your suggestions require coming out of isolation mode? Also, any suggestions for pinning down where the deeper issue lies? Any way to figure out which objects are sticking around for long periods of time? Or maybe what files they're coming from? Our site is built by a 3rd party and they've essentially refused to deal with the issue because they can't reproduce it and "none of their other sites have the problem". They wanted to spend $15k+ on a new server. So I'm sort of on my own with untold thousands of lines of code. Again, thanks for your help, it's much appreciated. |
|
#9
|
|||
|
|||
|
Yep, you'll need to come out of isolation mode for that to work. If you have several sites running the same code you can probably tweak them slightly differently to see which settings yield the best results (you can do this because you said they are running under different app pools
).It's hard for me to comment on whether your server is configured optimally as I know nothing about its specs, nor how many users and hits your sites are getting. Does your servers event logs reveal anything interesting? |
|
#10
|
|||
|
|||
|
Well, our event logs reveal that we are running out of memory despite using only at most half
. I'll let you know if we get anything when we move out of isolation mode.As for the specs of the machine: we've kept a close eye on the resource use and the current machine aught to be able to handle the load. If we were getting errors and seeing a lack of resources available then I can see looking at a new machine. Or is that flawed logic somehow? |
|
#11
|
|||
|
|||
|
Just moved out of isolation mode and our original problems are back. In the event viewer we are seeing COM+ error. I tried debugging these before and got nowhere.
Each error starts like this: The run-time environment has detected an inconsistency in its internal state. This indicates a potential instability in the process that could be caused by the custom components running in the COM+ application, the components they make use of, or other factors. And has one of the following added: Error in D:\nt\com\complus\src\comsvcs\threads\stathread.cp p(272), hr = 80070057: CSTAThread: CoInitializeEx failed Error in d:\nt\com\complus\src\comsvcs\threads\stathread.cp p(285), hr = 80070008: CSTAThread: CoGetApartmentID failed Error in d:\nt\com\complus\src\comsvcs\threads\stathreadpoo l.cpp(1081), hr = 8000ffff: CSTAThreadPool: Unable to get bind thread. Error in d:\nt\com\complus\src\comsvcs\threads\activitywork queue.cpp(364), hr = 8000ffff: CActivityWorkQueue: Failed to bind queue. Error in d:\nt\com\complus\src\comsvcs\threads\staactivity. cpp(805), hr = 8000ffff: CSTAActivity: Failed to enqueue work. Any suggestions are most welcome. |
|
#12
|
|||
|
|||
|
Quote:
That is correct though - it only has half the memory allocated to it, and it is running out of what it has. Have a look in all the event logs (system, application, security, etc) and see if you find any common groupings. Also check the error reporting for each site is on - you can get some very detailed info out of IIS at times which can really narrow down what may be happening in IIS manager: Home Directory -> Configuration -> Debugging. Maybe also check what version of ASP.NET the site is running, against what it should be running. |
|
#13
|
|||
|
|||
|
These could be worth a read/look:
http://support.microsoft.com/kb/831135 http://support.microsoft.com/kb/556076 Second one looks quite promising for your situation. |
|
#14
|
|||
|
|||
|
Awesome, the second article is definitely recent; that didn't come up when I searched several weeks ago.
I bumped it up to a Mb last night and after an hour or so the errors appeared again in the Event log but the site seemed to be fine. I bumped it up again and we'll see if that helps after tonight's reboot. Thanks again. If you ever in West Michigan I owe you a few beers. |
|
#15
|
|||
|
|||
|
Quote:
Bit of a drive (and a swim) but OK If you don't mind, keep this thread updated - ie if it fixed the problem, then post post back in a week or so. You might find that this is one of those problems where you need to compromise on the solution, ie if the reg fix doesn't completely solve the problem on it's own, it may just need a scheduled reboot every couple of days, once a week, something like that. But let us know what worked as this is one of those problems others will have, but it has so far been difficult to find a complete solution that is backed with user experience. Cheers ![]() |