views:

595

answers:

5

I'm currently using session variables as a cache to cut down the calls to the database.

I'm wondering at about how many concurrent users does this stop working at? 1,000, 10,000 ....100,000??? Also will iis start flaking out at a certain load? And are there any alternatives?

I know it depends on how much data I'm storing per user, but I want to hear from other peoples experiences.

I do have it setup so that when the code tries to access a timed out session that it reloads from the database.

I'm currently using iis6 but I could easily use iis7 if it handles sessions better.

Edit: Yes I'm using application variables for non user specific data.

+1  A: 

If you have more than 124,889 users, your server will begin to be unresponsive.

Edit: if your data does not change and can be re-used, try caching it in an application scoped variable, i.e. reference data.

Jobo
Do you have a reference where you got this number?
Donny V.
Surely you could squeeze 124,900 out of the damned thing!
rp
He's yankin' yer noddle, Donny. Use session variables just like you would single malt scotch: only when you need them; using them sparingly when you do need them; and always clean up after yourself.
rp
124,900 might be pushing it.
Jobo
+2  A: 

If this is of any concern to you, use a State Server or the SQL Storage options for the session. For almost all applications it will not prove to be a problem though.

DavGarcia
I don't know if my host offers this?
Donny V.
If you get to the scale where sessions don't work for you, you won't be looking for a shared host
John Sheehan
Most of the hosts I have used in the past have a state server running on the server, it is just a windows service. The port number to connect to can vary, so might ask. It might be a moot point though since if you have 1,000 concurrent users shared hosting might not cut it.
DavGarcia
+1  A: 

You should probably be looking at Memcached if you're getting to this point.

Diodeus
A: 

It's very unlikely that session variable capacity will ever be the limiting resource for your server. Any particular reason you're asking?

le dorfier
I have a 350,000 record database to start with. I'm expecting it to triple or quadruple within the first year that it goes up. So I want to be prepared and make sure the site scales from the get go.
Donny V.
A: 

How about using the Cache instead, it allows automatic cache invalidation.

Cache invalidation can be done both based on a timeout and due to it being "kicked out" due to ressources.

You can use the Cache on a per-user-basis by giving each item a user specific key.

veggerby