There are multiple modes in which session data can be stored in a ASP.net C# application. One of them is InProc mode. What is the limit of the maximum amount of data that can be held in the InProc mode? Is this a configurable limit?
Edit: I know this is probably un-cool and even sounds blasphemous but I am in a unique situation where I will probably need to store 10MB files in the session. Probably dozens of them at a time. Thus the question.
Whether or not this is a good question or a scary one depends on whether or not you are trying to plan capacity for numerous “skinny” sessions (fine) or planning to put a huge amount of data into session (bad).
IIS allows private memory control and virtual memory control. This is unlimited by default; if you do set a limit, it can be used to trigger app pool recycles. Recycling the app pool is probably not desirable, e.g. 1000 users are logged in, memory limit is reached, site restarts and session data is lost for everyone. Request throttling might be more appropriate.
Remember, “The amount of data storage reserved for a process is only limited by the amount of space that the operating system can get on the disk.” (reference) but as soon as you are paging to disk, performance will suffer badly. @RB’s comment about out of process “fat” sessions causing heavy network traffic is also apropos.
As a note, MemoryCache provides more granular size/expiration control. It’s very similar to what ASP.Net uses. Based on your comment about 10MB files, I would suggest looking at this option. It will run in process like session (and still be subject to the same memory limit as session), but you can control it to some degree.