Java application cache sizing

When sizing a cache such as Ehcache, back-of-envelope calculations is what’s often done. While it may well give the right answer, the envelope never seems to be kept so when someone comes along needing to modify/tweak the caching behaviour of the application they are faced with an ehcache.xml config file full of various numbers with no indication of why they were chosen.

This is often the case with many config files, but I’ve seen that ehcache.xmls are particularly prone to this (not anything to do with Ehcache, more the people who maintain them).

So I think it’s good to do what we did in a recent project, and document the choices of various settings with comments, and the calculations in a spreadsheet checked in to source control.

Some resources I found useful while calculating cache sizes:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s