2
votes

I have integrated a web application with Appfabric to be used for session management (using the session provider that ships with Appfabric). After some tests i realized that over time with usage(creation of several new sessions), the Region Count of the Cache keeps on increasing even when most of the sessions have expired.Infact after a period of no activity of around 2 hours , these were the statistics i got from the cache server.

Size : 0 ItemCount : 0 RegionCount : 391 RequestCount : 9979 MissCount : 2729 I searched this on the appfabric forums and this is what i found in one of the posts

"Regions' presence is not related to memory leakage as one region object doesn't occupy more than a few KBs of memory. System regions once created are not removed in a running cluster."

How correct is this statement ??

Also to my understanding(might be incorrect as well), the session state provider for appfabric creates a new region for each new session. If it is correct what would happen in case when i am having a few million sessions created over a period of days.Would it not be a problem. Is there a work around ?

One solution i can think of is specifying a region(along with Cachename) in the session provider configuration , but that would limit all my sessions to a single cache server(i guess)

1

1 Answers

0
votes

AppFabric Cache creates a maximum of 1024 system regions. Generally if you intend to use the cache for session state, i would specify the regions myself thus allowing some crazy max number of regions. Secondly ideally you want to use a series of servers for session state and have the named cache running as non-HA. My particular scenario is 3 servers all with 8GBs each of RAM and have a region for each session. please note that having a region for each sessions is not required and using the system regions is fine because the cache will manage where the values are stored(which server and region) and you simply do a get from the cache to read the session state value.