Commerce Server General - Using WeakReference to improve performance

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > July 2005 > Using WeakReference to improve performance





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Using WeakReference to improve performance
TechMate

2005-07-22, 5:50 pm

I read articles on how to improve performance of Commerce sites and came
across using WeakReference objects on Caches.

If I have datasets that are collectively result of multiple related catalogs
and I cache them once I populated the dataset. The cache works fine, but now
if I am implement the WeakReference wrapper around these cache objects how
will I do it. I am confused whether I should wrap it around the entire Cache
object that may hold datasets for different categories or should I wrap the
Collective Dataset and then add it to the Cache. What is the right way of
wrapping the cache objects.

Anyone who has done this, please explain.
Vinayak Tadas[MSFT]

2005-07-27, 5:52 pm

Have you tried using the ASP.Net caching features which allow you to cache
objects and also specify the time duration the objects should be kept in
the cache.
When the item is removed from the cache you get an event where you can
decide what to do with that object.
I would suggest you investigate the ASP.net caching features to build you
caching model instead of using weak references.


Thanks
Vinayak Tadas
Microsoft
http://blogs.msdn.com/vinayakt

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Get Secure! For more info visit http://www.microsoft.com/security. Please
reply to the newsgroups only


--------------------
Thread-Topic: Using WeakReference to improve performance
thread-index: AcWPAHhTpJOt2SAwTFiQHq/GWMX75g==
X-WBNR-Posting-Host: 68.21.210.2
From: "=?Utf-8?B?VGVjaE1hdGU=?=" <TechMate@discussions.microsoft.com>
Subject: Using WeakReference to improve performance
Date: Fri, 22 Jul 2005 14:01:03 -0700
Lines: 12
Message-ID: <5D9C369C-DFE8-4A8F-91C2-914A7D3E7C5D@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.general
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.general:3067
X-Tomcat-NG: microsoft.public.commerceserver.general

I read articles on how to improve performance of Commerce sites and came
across using WeakReference objects on Caches.

If I have datasets that are collectively result of multiple related
catalogs
and I cache them once I populated the dataset. The cache works fine, but
now
if I am implement the WeakReference wrapper around these cache objects how
will I do it. I am confused whether I should wrap it around the entire
Cache
object that may hold datasets for different categories or should I wrap the
Collective Dataset and then add it to the Cache. What is the right way of
wrapping the cache objects.

Anyone who has done this, please explain.

TechMate

2005-07-27, 5:52 pm

Vinayak -

I have implemented ASP.NET caching (where i have 30 minute sliding
expiration for my cache objects) in my commerce site but then I read this
article
http://msdn.microsoft.com/library/d...hapt05.asp?_r=1

I thought WeakReferencing would be a good idea because there is a possiblity
of the cache growing really large. For example , I have 178 categories and
and average of 800-1000 products in each category.

So in order to make sure server resources are not completely used up by this
one site, I thought it might be a good idea to have WeakReference wrapper
around these cache objects which will then instruct the GC internally to
release them when there is memory pressure on the server.

Let me know your thoughts on this.

""Vinayak Tadas[MSFT]"" wrote:

> Have you tried using the ASP.Net caching features which allow you to cache
> objects and also specify the time duration the objects should be kept in
> the cache.
> When the item is removed from the cache you get an event where you can
> decide what to do with that object.
> I would suggest you investigate the ASP.net caching features to build you
> caching model instead of using weak references.
>
>
> Thanks
> Vinayak Tadas
> Microsoft
> http://blogs.msdn.com/vinayakt
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> You assume all risk for your use. © 2002 Microsoft Corporation. All rights
> reserved.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> Get Secure! For more info visit http://www.microsoft.com/security. Please
> reply to the newsgroups only
>
>
> --------------------
> Thread-Topic: Using WeakReference to improve performance
> thread-index: AcWPAHhTpJOt2SAwTFiQHq/GWMX75g==
> X-WBNR-Posting-Host: 68.21.210.2
> From: "=?Utf-8?B?VGVjaE1hdGU=?=" <TechMate@discussions.microsoft.com>
> Subject: Using WeakReference to improve performance
> Date: Fri, 22 Jul 2005 14:01:03 -0700
> Lines: 12
> Message-ID: <5D9C369C-DFE8-4A8F-91C2-914A7D3E7C5D@microsoft.com>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="Utf-8"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Content-Class: urn:content-classes:message
> Importance: normal
> Priority: normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> Newsgroups: microsoft.public.commerceserver.general
> NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.general:3067
> X-Tomcat-NG: microsoft.public.commerceserver.general
>
> I read articles on how to improve performance of Commerce sites and came
> across using WeakReference objects on Caches.
>
> If I have datasets that are collectively result of multiple related
> catalogs
> and I cache them once I populated the dataset. The cache works fine, but
> now
> if I am implement the WeakReference wrapper around these cache objects how
> will I do it. I am confused whether I should wrap it around the entire
> Cache
> object that may hold datasets for different categories or should I wrap the
> Collective Dataset and then add it to the Cache. What is the right way of
> wrapping the cache objects.
>
> Anyone who has done this, please explain

Colin Bowern

2005-07-29, 5:55 pm

The ASP.NET HttpRuntime/HttpContext cache will automatically purge objects
when the private memory allocation grows beyond a limit it can handle. It
will remove the least accessed items as well to ensure that performance is
still considered.

http://msdn.microsoft.com/msdnmag/i...ce/default.aspx

You'll probably want to break up the data set into each individual component
that is queried. So if you are querying three different catalogs you should
cache three different datasets and perhaps a combined data set with a
dependency on the three different datasets that are used to make up the
result. Then you could use a custom database cache dependency that
invalidates the object when the catalog changes. Check out the following:

http://www.eggheadcafe.com/articles/20030716.asp

Cheers,
Colin



"TechMate" <TechMate@discussions.microsoft.com> wrote in message
news:D29DBEEF-5322-4B83-9D4F-F3655BBF89B2@microsoft.com...[vbcol=seagreen]
> Vinayak -
>
> I have implemented ASP.NET caching (where i have 30 minute sliding
> expiration for my cache objects) in my commerce site but then I read this
> article
> http://msdn.microsoft.com/library/d...hapt05.asp?_r=1
>
> I thought WeakReferencing would be a good idea because there is a
> possiblity
> of the cache growing really large. For example , I have 178 categories and
> and average of 800-1000 products in each category.
>
> So in order to make sure server resources are not completely used up by
> this
> one site, I thought it might be a good idea to have WeakReference wrapper
> around these cache objects which will then instruct the GC internally to
> release them when there is memory pressure on the server.
>
> Let me know your thoughts on this.
>
> ""Vinayak Tadas[MSFT]"" wrote:
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com