user4661780
user4661780

Reputation:

Points about sessions in ASP.NET

Suppose we have a website with 100k active users.

If we want to save email, name, last name and gender of users in sessions, how much space is allocated to all the sessions?

Are the sessions affecting server RAM, server bandwidth or something else?

Please give me a little information about session functionality and effect of session overload on the server.

Upvotes: 6

Views: 201

Answers (3)

Loko
Loko

Reputation: 6679

NOTE:

This answer was posted when the OP asked about php and asp.net


Are the sessions affecting server RAM, server bandwidth or something else?

Sessions are affecting server RAM

Please give me a little information about session functionality and effect of session overload on the server.

If the effect of sessions overload the server, the server will run slow because of the usage of the RAM.

Most of the settings of sessions can be changed in the php.ini file

If you want to know more about session functionality, you should check out the pages about sessions on php.net or even the wiki.

There is too much information about sessions to actually post in an answer.

Upvotes: 0

Marcus Höglund
Marcus Höglund

Reputation: 16856

I would recommend you to store such data in the client when you have 100k users. Your pages will be larger and require more bandwidth but you will allocate less memory on the server. If you talking about a ASP-application check this article http://www.codeproject.com/Articles/416137/Understanding-Session-Management-Techniques-in-ASP

Upvotes: 0

Mathew Thompson
Mathew Thompson

Reputation: 56449

The session themselves will consume the server RAM if your mode is set to InProc, which is limited only by the amount of RAM available to the worker process.

Considering your high demand, you want to be really careful what you're putting in the session, only when it's absolutely necessary. Don't put things in session and leave them there for use in a page or two, just go back to the database and get them, otherwise your session size will creep up drastically.

Based on what you're storing, it's only 5kb or even less, so based on 100k users, that would be:

5kb * 100,000 = 488.28MB

So you see, even though you're only storing a couple of details, at that level of usage the memory usage is quite significant.

For such high demand and usage, I would consider using a dedicated state server (StateServer mode) which allows you to manage it separately and allocate the resources to that server as required.

The other option is using SQL Server session (SQLServer mode) which is limited only by the size that is available to the database. So we're talking hard disk space here and not RAM. To be honest though, if you're going to the database to retrieve your session information, then why not just go to the database and retrieve the information you need anyway?

Upvotes: 3

Related Questions