473,506 Members | 14,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.Net Caching Questions

All,

I am designing a system that will involve an IIS/ASP.Net application
server. The main purpose of the application server will be to load
large amounts of static data into memory and do fast lookups on it.
The total cache size at the time of first installation will be roughly
350MB, but may grow to as large as 10GB over the next five years.

My questions:

1. Can the ASP.Net cache utilize this much memory, assuming the
processor and OS are 64-bit?

2. If the cache size were 10GB, how much memory would the machine need
to prevent cache/application recycling (assume very little memory
usage in the app outside of the cache).

3. Since the loading of the static data would be expensive and time
consuming, would any other steps need to be taken to avoid application
restarts?

4. Is there any limit to how large a single object in the cache can be
(it's likely one dataset or hashtable in our system could approach
200MB).

5. Finally, is there another caching option that is more efficient/
usable/scalable/etc. than the one provided with ASP.Net?
Thanks for any insight.
Phil

May 28 '07 #1
6 1388
KJ
To answer #5, custom serialization (ala XmlSerializer) using SQL Server
would likely scale better than a massive cache, although speed of access and
serializability of your objects might be issues.

Regarding #4, my question to you is, if the dataset or hastable is going to
be 200MB, isn't that just an in-memory representation of a database table or
entire database (and why not just use tables)?
"Phil Sandler" <ps********@hotmail.comwrote in message
news:11*********************@p47g2000hsd.googlegro ups.com...
All,

I am designing a system that will involve an IIS/ASP.Net application
server. The main purpose of the application server will be to load
large amounts of static data into memory and do fast lookups on it.
The total cache size at the time of first installation will be roughly
350MB, but may grow to as large as 10GB over the next five years.

My questions:

1. Can the ASP.Net cache utilize this much memory, assuming the
processor and OS are 64-bit?

2. If the cache size were 10GB, how much memory would the machine need
to prevent cache/application recycling (assume very little memory
usage in the app outside of the cache).

3. Since the loading of the static data would be expensive and time
consuming, would any other steps need to be taken to avoid application
restarts?

4. Is there any limit to how large a single object in the cache can be
(it's likely one dataset or hashtable in our system could approach
200MB).

5. Finally, is there another caching option that is more efficient/
usable/scalable/etc. than the one provided with ASP.Net?
Thanks for any insight.
Phil

May 28 '07 #2
On May 28, 11:29 am, "KJ" <n_o_s_p_a...@Mail.comwrote:
To answer #5, custom serialization (ala XmlSerializer) using SQL Server
would likely scale better than a massive cache, although speed of access and
serializability of your objects might be issues.
Performance of the data lookup is the #1 priority of this particular
part of the system. So unless I'm misunderstanding your suggestion, I
don't think XML is the answer.
Regarding #4, my question to you is, if the dataset or hastable is going to
be 200MB, isn't that just an in-memory representation of a database table or
entire database (and why not just use tables)?
Yes, it's basically a modified representation of the static data in
the database. We are not simply using the database tables themselves
(I assume that's what you meant) because doing in-memory lookups are
much, much faster than going to the database for each one.
Thanks for your reply,

Phil
"Phil Sandler" <psandle...@hotmail.comwrote in message

news:11*********************@p47g2000hsd.googlegro ups.com...
All,
I am designing a system that will involve an IIS/ASP.Net application
server. The main purpose of the application server will be to load
large amounts of static data into memory and do fast lookups on it.
The total cache size at the time of first installation will be roughly
350MB, but may grow to as large as 10GB over the next five years.
My questions:
1. Can the ASP.Net cache utilize this much memory, assuming the
processor and OS are 64-bit?
2. If the cache size were 10GB, how much memory would the machine need
to prevent cache/application recycling (assume very little memory
usage in the app outside of the cache).
3. Since the loading of the static data would be expensive and time
consuming, would any other steps need to be taken to avoid application
restarts?
4. Is there any limit to how large a single object in the cache can be
(it's likely one dataset or hashtable in our system could approach
200MB).
5. Finally, is there another caching option that is more efficient/
usable/scalable/etc. than the one provided with ASP.Net?
Thanks for any insight.
Phil- Hide quoted text -

- Show quoted text -

May 28 '07 #3
KJ
A serialization option (other than XML) you might consider is binary
serialization (saving an object as a stream of bytes to some medium,
such as a varbinary SQL Server column). Check out the topic "basic
serialization" in msdn.

One thing I thought of: What if for some reason the aspnet or iis
process tanks and has to restart? What would happen to your
application (I imagine that such an application would require serious
ramp-up time to load all the data)? SQL Server is built to withstand
these kinds of events, and a properly designed and optimized SQL
database will perform comparably to using Cache.
On May 28, 1:19 pm, Phil Sandler <psandle...@hotmail.comwrote:
On May 28, 11:29 am, "KJ" <n_o_s_p_a...@Mail.comwrote:
To answer #5, custom serialization (ala XmlSerializer) using SQL Server
would likely scale better than a massive cache, although speed of access and
serializability of your objects might be issues.

Performance of the data lookup is the #1 priority of this particular
part of the system. So unless I'm misunderstanding your suggestion, I
don't think XML is the answer.
Regarding #4, my question to you is, if the dataset or hastable is going to
be200MB, isn't that just an in-memory representation of a database table or
entire database (and why not just use tables)?

Yes, it's basically a modified representation of the static data in
the database. We are not simply using the database tables themselves
(I assume that's what you meant) because doing in-memory lookups are
much, much faster than going to the database for each one.

Thanks for your reply,

Phil
"Phil Sandler" <psandle...@hotmail.comwrote in message
news:11*********************@p47g2000hsd.googlegro ups.com...
All,
I am designing a system that will involve an IIS/ASP.Net application
server. The main purpose of the application server will be to load
large amounts of static data into memory and do fast lookups on it.
The total cache size at the time of first installation will be roughly
350MB, but may grow to as large as 10GB over the next five years.
My questions:
1. Can the ASP.Net cache utilize this much memory, assuming the
processor and OS are 64-bit?
2. If the cache size were 10GB, how much memory would the machine need
to prevent cache/application recycling (assume very little memory
usage in the app outside of the cache).
3. Since the loading of the static data would be expensive and time
consuming, would any other steps need to be taken to avoid application
restarts?
4. Is there any limit to how large a single object in the cache can be
(it's likely one dataset or hashtable in our system could approach
>200MB).
5. Finally, is there another caching option that is more efficient/
usable/scalable/etc. than the one provided with ASP.Net?
Thanks for any insight.
Phil- Hide quoted text -
- Show quoted text -

May 29 '07 #4
On May 29, 9:20 am, KJ <n_o_s_p_a...@mail.comwrote:
A serialization option (other than XML) you might consider is binary
serialization (saving an object as a stream of bytes to some medium,
such as a varbinary SQL Server column). Check out the topic "basic
serialization" in msdn.
As stated, the lookups have to be as fast as possible, so the idea is
to have all the information in memory so that the lookups are
instant. Loading the information from a file or sql column will not
perform nearly as well.
One thing I thought of: What if for some reason the aspnet or iis
process tanks and has to restart? What would happen to your
application (I imagine that such an application would require serious
ramp-up time to load all the data)?
Yes, there would be ramp up time. This is an expected and acceptable
condition, so long as the application performs well when it's running.
SQL Server is built to withstand
these kinds of events, and a properly designed and optimized SQL
database will perform comparably to using Cache.
With all due respect, what are you basing this on? Have you ever
tested this? Lookup up information in cache is many, many times
faster than querying a database for it.

I appreciate your taking the time to respond, but I need to find
answers to my specific questions before I start looking at alternate
solutions.
Thanks,

Phil

May 29 '07 #5
KJ
Hi Phil,

I don't have specific testing results, and I have no trouble conceding to
your assertion about Cache vs. database speed.

I'm only trying to get across the general idea that a stored procedure
executing in roughly 5-20 MS is sufficient for 100% of the ASP.NET
applications I have or am likely to encounter. Sending HTML across the wire
is not expected to happen instantaneously, as the speed of the network,
number of hops, etc, is always a limiting factor.

Is yours a real-time-dependent application where the consequences of waiting
a few extra MS are potentially disastrous or extremely problematic? Unless
it can be proven that a massive aspnet process is safe, reliable, and
manageable at the O/S level, and doesn't introduce any resource-based
performance concerns of its own.... (Maybe other folks with more knowledge
about aspnet internals will chime in on this thread and provide specifics?)

Now, for curiosity's sake, could you tell us why this particular application
has to be so fast, or is that proprietary info (etc)?

-KJ

"Phil Sandler" <ps********@hotmail.comwrote in message
news:11*********************@o5g2000hsb.googlegrou ps.com...
On May 29, 9:20 am, KJ <n_o_s_p_a...@mail.comwrote:
>A serialization option (other than XML) you might consider is binary
serialization (saving an object as a stream of bytes to some medium,
such as a varbinary SQL Server column). Check out the topic "basic
serialization" in msdn.

As stated, the lookups have to be as fast as possible, so the idea is
to have all the information in memory so that the lookups are
instant. Loading the information from a file or sql column will not
perform nearly as well.
>One thing I thought of: What if for some reason the aspnet or iis
process tanks and has to restart? What would happen to your
application (I imagine that such an application would require serious
ramp-up time to load all the data)?

Yes, there would be ramp up time. This is an expected and acceptable
condition, so long as the application performs well when it's running.
>SQL Server is built to withstand
these kinds of events, and a properly designed and optimized SQL
database will perform comparably to using Cache.

With all due respect, what are you basing this on? Have you ever
tested this? Lookup up information in cache is many, many times
faster than querying a database for it.

I appreciate your taking the time to respond, but I need to find
answers to my specific questions before I start looking at alternate
solutions.
Thanks,

Phil

May 30 '07 #6
On May 29, 9:14 pm, "KJ" <n_o_s_p_a...@Mail.comwrote:
Hi Phil,

I don't have specific testing results, and I have no trouble conceding to
your assertion about Cache vs. database speed.

I'm only trying to get across the general idea that a stored procedure
executing in roughly 5-20 MS is sufficient for 100% of the ASP.NET
applications I have or am likely to encounter. Sending HTML across the wire
is not expected to happen instantaneously, as the speed of the network,
number of hops, etc, is always a limiting factor.

Is yours a real-time-dependent application where the consequences of waiting
a few extra MS are potentially disastrous or extremely problematic? Unless
it can be proven that a massive aspnet process is safe, reliable, and
manageable at the O/S level, and doesn't introduce any resource-based
performance concerns of its own.... (Maybe other folks with more knowledge
about aspnet internals will chime in on this thread and provide specifics?)

Now, for curiosity's sake, could you tell us why this particular application
has to be so fast, or is that proprietary info (etc)?
Essentially, this is not a website, it's an application server. The
purpose of the application server is to receive a request for
processing, and then process the request as fast as possible. I can't
get deep into the details of what the system does, but a big part of
what it has to do is lookup many (!) thousands of values as fast as
possible. When I say as fast as possible I mean: if each lookup takes
2ms instead of 1ms, it would make a huge difference in how we measure
the success of the system.

So the added overhead of loading the huge set of data up front is not
a problem, as long as the goal of making the system respond as quickly
as possible is met. Looking up thousands of values in a database,
even if the database is very, very fast, is significantly slower than
looking up the values in memory (at least from my admittedly
unscientific tests).

Your question of whether this method would be safe, reliable and
manageable is exactly what I need to get to. :)
Thanks,

Phil

May 30 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
9460
by: Behzad | last post by:
Hi all I'am ASP programmer and I have built a site that users can upload and download files.All things store in a DB and everytime someone enters a page,the application requery the Db and shows...
2
1242
by: Wee Bubba | last post by:
2 questions please: 1. At the moment I make a connection to a database whenever a user logs into my website. I run a few SQL's then store some commonly used dataTables in session objects for...
6
1741
by: spacehopper_man | last post by:
I'm considering ditching all use of Session state in favour of Application state. This is because - from what I can work out - it will be more memory efficient for me. I have three questions:...
2
1596
by: Nalaka | last post by:
Hi, I have the following requirement for caching a asp.net 2.0 page. Can some one please tell me if this is possible.... and a some direction would also be wonderful I have a ASP.net 2.0...
17
3221
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
1
1737
by: Kevin Burrowes | last post by:
I need to implement caching for a large enterprise application and we are planning to use the newest Caching Application Blocks. (Enterprise Library Jan. 2006) We want to cache Business Entities...
3
2932
by: Purti Malhotra | last post by:
Hi All, In our Web hosting environment we are using Virtual hosting i.e. multiple websites are on one server and multiple domains are pointing to a single website. Issue: We have two domains...
7
1596
by: ask ksa | last post by:
hi, is anybody familiar with production-ready distributed/clustered cache solution for .net ? Google helped me to found some (like ncache and scale-out-state-server), but they are over-priced ...
3
1962
by: Gary W. Smith | last post by:
I had a couple questions about data caching. We have a site that gets a huge amount of traffic to a few specific pages that have a lot of data on them (300k hits/hour during peak, about 6-10 data...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.