I recently had a performance issue with one of my collections.
On a whim (and thanks to this article), I decided to try compacting (as written in the official documentation).
This worked brilliantly. However, I'm now wondering how often I should do it.
Since compacting is not a completely online task (I can only do it on passive nodes), I can't decide to do it every night and forget about it.
I couldn't find any documentation about knowing when a DB/collection has a high fragmentation rate. Do you have any experience with determining the fragmentation level of a DB (other than benchmarking)?
Note: I'm talking about "internal" fragmentation as in spaces inside the file, not "external" fragmentation as in file spread accross the disk.