Cache.EffectivePrivateBytesLimit shrinks as box gets bigger?

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi...

We've been trying to migrate our asp.net apps off older, underpowered
hardware to newer, bigger boxes but when we do, we see our databases start to
melt.

When I started to look into it, I found that the older boxes all had bigger
EffectivePrivateBytesLimit values than the newer boxes, which seems very
counter-intuitive to me. And it seemed to me that a much smaller Cache would
be pushing more requests back to the databases.

The old boxes have 2gb physical ram and 3gb pagefile space set aside. The
newer boxes start at 3gb physical ram and 4gb pagefile space and go up from
there.

We're not setting any of the machine.config values or IIS Admin settings
that would curb the cache size on any of the boxes. And we have only one
worker process on all of them. All boxes are running Windows 2003 SP2 and
ASP.Net 2.0.

On the smaller boxes, EffectivePrivateBytesLimit = ~60% of physical ram
(1.2gb). On the bigger boxes, EffectivePrivateBytesLimit = 800mb.

I found this thread: http://forums.asp.net/p/962451/1199949.aspx

Neither of the msdn articles mentioned in it are at those locations anymore,
but the rules of thumb in the response indicate that the bigger boxes *think*
they have <= 2gb of page file.

Is there some kind of overflow/signed condition in Windows 2003 or ASP.Net
2.0 where adding too much gig and/or page file ends up having a negative
effect because the system can't tell?

Thanks
Mark
 
Hi Mark,

As for the EffectivePrivateBytes property, it does be a value indicate the
virtual memory available for cache useage. And this is determined by
several things:

** the ASP.NET process's memory limit(for IIS6 win2k3, it is set via IIS
application pool's memory limit)

** the privateBytesLimit attribute of <cache> element in ASP.NET web.config

If none of the above is set, runtime will automaticalaly calculate one for
you. However, the calculation algorithym is internal implemented and may
vary from server's hardware condition.

Here is a good blog article written by an senior developer which
introducing some history about ASP.NET cache and its memory limit
configuration:

#Some history on the ASP.NET cache memory limits
http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-c
ache-memory-limits.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
 
Hi Steven...

Thanks for the link; it had all the same information that was in the other
link I posted originally. The problem is that those forumulas don't seem to
be working in our case.

As I said, we haven't set any of the configuration parameters to directly
control the cache size and the machine with 2gb of physical ram/3gb page file
is getting more cache space while the machines starting at 3gb phys/4gb page
file are getting a much lower cap.

The fact that the newer, bigger machines are getting
EffectivePrivateBytesLimit coming out at *exactly* 800mb implies that the
MIN() formula was inappropriately applied in their case, hence my question
about the calculation having some overflow boundary where too much space gets
interpreted as too little. They have at least 4gb of pagefile, which should
have applied the formula MIN(60% phys ram, 1800mb). Instead it applied the
smaller case MIN(60% phys ram, 800mb).

The smaller machine EffectivePrivateBytesLimit comes out at 60% of physical
ram (1.2gb of 2) which implies that it recognized the pagefile as > 2gb,
according to the formulas.

Thanks
Mark
 
Thanks for your reply Mark,

Yes, as you didn't explicitly set those memory limit value, then the
runtime will help caclulated one for you. So far I haven't any information
about how to number is calculated, per the document it will rely on
hardware condition also. BTW, on the server machine that has more physical
memory, are there also many other applications running on it? Maybe some
other applications occupy some certain memory or may cause more memory
fragment than the smaller box.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?TWFyaw==?= <[email protected]>
References: <[email protected]>
Subject: RE: Cache.EffectivePrivateBytesLimit shrinks as box gets bigger?
Date: Wed, 30 Apr 2008 07:13:00 -0700
 
Hi Steven...

Both of the links mentioned in this thread did lay out some rules used to
calculate the memory limit when none of the parameters are explicitly set.
My question comes from the fact that these rules don't seem to be followed on
the machines where I noticed this.

The bigger boxes are only for running the web server and at the time all
have 95% of their physical ram unused.

Since the rules mention that the calculation thresholds are based on the
page file size, I have tried playing with that on the bigger boxes but it
didn't seem to help. The rules in the articles said that the calculation was
MIN(60% phys ram, 800MB) when the page file was <= 2gb
MIN(60% phys ram, 1800MB) when the page file was > 2gb.

The smaller box has the page file set a hair under 3gb. The bigger boxes
had it at > 4gb. To see if there was an overflow condition, I lowered the
big boxes to about 3gb page file but the EffectivePrivateBytesLimit didn't
change.

The only other variables I can think of is that the older box is running
2003 Web Edition and is old enough to have all that "hyperthreading" garbage.
I think it only has one real cpu but it's counting the fpu etc when task
manager says it has several cpus.

The newer boxes are running 2003 R2 standard edition and have dual dual or
quad dual cores. Maybe the EffectivePrivateBytesLimit also has a limiting
factor based on number of actual cpus? Or maybe R2 does things differently
than the old Web Edition?

Thanks
Mark
 
Thanks for your reply Mark,

I'll do some further research on this and update you as soon as possible.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?TWFyaw==?= <[email protected]>
References: <[email protected]>
<[email protected]>
Subject: RE: Cache.EffectivePrivateBytesLimit shrinks as box gets bigger?
Date: Fri, 2 May 2008 06:57:03 -0700
 
Hi Mark,

Here is some further comments from the blog entry's engineer:

========================
The cache privateBytesLimit has nothing to do with the pagefile. By
default it is bounded above by 800MB on x86, unless you're using /3GB, in
which case it is bounded above by 1800MB.
========================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Content-Transfer-Encoding: 7bit
From: (e-mail address removed) (Steven Cheng [MSFT])
Organization: Microsoft
Date: Tue, 06 May 2008 08:53:24 GMT
Subject: RE: Cache.EffectivePrivateBytesLimit shrinks as box gets bigger?
 
Hi Steven...

Thank you for asking, but that's exactly the problem I'm asking about.
*IT'S NOT WORKING THAT WAY!*

Our smaller x86 with 2gb of ram is showing a EffectivePrivateBytesLimit of
1.2gb (60% ram) while our newer x86 boxes with 3+gb are showing it capped at
800mb.

Thanks
Mark


Steven Cheng said:
Hi Mark,

Here is some further comments from the blog entry's engineer:

========================
The cache privateBytesLimit has nothing to do with the pagefile. By
default it is bounded above by 800MB on x86, unless you're using /3GB, in
which case it is bounded above by 1800MB.
========================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Content-Transfer-Encoding: 7bit
From: (e-mail address removed) (Steven Cheng [MSFT])
Organization: Microsoft
Date: Tue, 06 May 2008 08:53:24 GMT
Subject: RE: Cache.EffectivePrivateBytesLimit shrinks as box gets bigger?
Thanks for your reply Mark,

I'll do some further research on this and update you as soon as possible.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti f
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Mark,

Thanks for your reply.

The dev engineer also think the behavior is not expected according to the
calculation formula. Also, due to the support limitation, it's abit hard
for me to continue involve them directly into newsgroup issue. Since the
problem is environmenet specific which may require further troubleshooting
on the target server, I would suggest you consider contacting CSS for
incident based support which can help perform some more thorough and
detailed troubleshooting:

Microsoft Customer Support Services (CSS) at
ttp://msdn.microsoft.com/subscriptions/support/default.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
From: =?Utf-8?B?TWFyaw==?= <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Subject: RE: Cache.EffectivePrivateBytesLimit shrinks as box gets bigger?
Date: Mon, 12 May 2008 07:31:03 -0700
 
Hi Steven...

Thank you for responding. You are right; this is a very
environment-specific issue, not a general coding question. I'll check with
my management if we want to open a case for this.

Thanks
Mark
 
Thanks for your understanding Mark.

If you got any new results later, also welcome to share us here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

--------------------
From: =?Utf-8?B?TWFyaw==?= <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
 
Back
Top