Is there a way to keep track of a single (class) object in terms of cache?

I am trying to determine which implementation of a data structure is best for a web application. Basically, I will maintain one set of "State" classes for each unique user, and the state will be cached for some time when the user logs in, and after a period of no overclocking, the state is stored in the db. So in order to balance the load on db and iis memory I have to determine what is the best (expected) timeout for the cache.

My question is how to control a specific cache activity for one set of objects? I tried perfmon and it gives roughly% of the total memory, but has no idea about size or so (maybe even better, I could get a list of all cached objects, along with size and other performance data).

In the end, I expect the program to handle 100,000+ cached users, and each of them can make a request in about 10-60 seconds. Therefore, performance matters to me.

0


a source to share


1 answer


What exactly are you trying to measure here? If you just want to get the size of your State in-memory instances at any given time, you can use an application-level counter and add / substitute each time you create / remove a state instance. So you know your state size, you know how much government affairs you have. But if you already expect to get 100,000 users each asking at least once / minute, you can actually do the math.



0


a source







All Articles