Our customers have hundreds of projects per application server.
Every project has its own metadata descriptor (~1MB in memory , ~1sec to load from DB). The metadata is used to validate every request to the server in various aspects (permissions, valid fields, field values etc...) We are heavily dependent upon this metadata.
To save time querying the DB, we decided to implement cache mechanism (using EHCache) to store the project's metadata. And we would like to tune the cache properly.
I was wondering, what are the techniques for tuning the cache properties (total size, number of objects, evacuation strategies ...)
For example, should objects that haven't been accessed for a period of time be released to save memory? How to choose eviction strategy (e.g. LRU, MRU)?
We do have an experienced load testing team and lots of data from customers (number of projects, average metadata size, etc...) so building load testing environment shouldn't be a problem. I am just unsure what exactly should I look for?
Please share your cache tuning experience.
Thanks