I'm running a script to find out the disk usage on a wide range range of VPS (size ranging from less than 1 GB of usage to over 200 GB of usage)... I'm trying to maintain performance (EG: no extra load on the VPS) while maintaining accuracy.
df is fast and doesn't produce any disk load that I'm aware of, but it isn't very accurate (I've had it report 0.54 GB of used disk when there was 6+ GB of usage)...
du -s is fast enough on the smaller systems that it doesn't make an impact on performance (it's done before it matters), it's accurate and it works well, but if you run it on a larger system it uses a ton of I/O and can slow down the entire machine.
So I'd like some suggestions on maintaining performance while still getting accurate results.
This script runs every 10 seconds while I'm viewing the status... The data doesn't necessarily need to be 100% accurate on the first pull, but by the 3rd pull it should be. (If that makes sense...)