Minimizing Diskspace Usage For Monitoring Data by Using NTFS Built in Compression

 Originally published on October 11, 2006 by Dirk Paessler
Last updated on March 03, 2022 • 5 minute read

The monitoring databases of PRTG Traffic Grapher and IPCheck Server Monitor can become quite large for installations with many sensors. E.g. we have a monitoring database of some 3 GB for one of our internal test installations. To minimize actual disk space usage it is a good idea to enable the file system compression of the Windows operating system (available only on NTFS drives). This way the monitoring data is stored as compressed data on the disk and you save about two thirds of space.

Real Data

Sample "real" disk space usage for a PRTG installation:

  • Without compression: 1116 MB
  • With compression: 384 MB (-65%)

For smaller and medium sized installation (<200 sensors) there are virtually no disadvantages. For example the recalculation of the complete datacache mentioned above (1 GB of data!) took 2m30s without compression and 2m45s with compression on our test system (Pentium 4, 2.8 Ghz). For larger installations the performance may be affected more or less, especially for the files for the current day which are written to every some minutes. In this case only the compression of old files (that will no be changed any more) may be a wise decision. Some testing may be necessary because the performance effects depend on many parameters.

Background

The NTFS technical documentation mentions:

When a program opens a compressed file, NTFS decompresses only the portion of the file being read and then copies that data to memory. By leaving data in memory uncompressed, NTFS performance is not impacted when it reads or modifies data in memory. NTFS compresses the modified or new data in the file when the data is later written to disk. The compression algorithms in NTFS support cluster sizes of up to 4 KB. When the cluster size is greater than 4 KB on an NTFS volume, none of the NTFS compression features are available.

Hands-On!

But before you convert your huge monitoring database now, you should not to do the conversion "in-place". It is better to create a new folder, mark it "compressed" in Explorer and then use PRTG's "File|Save As" to copy the files into the new folder (remember to delete the old data later). Doing in-place-compression would lead to heavy fragmentation of the drive.

Links

More reading: