Applies To:
  • CitectSCADA 1.x 2.x 3.x 4.x

Summary:
I have a large number of trend files configured on my trend server. According to the calculations provided in the Citect help, the files should consume about 450MB. However, it turns out that I have a lot less free space on my drive than I should have if the trend files take up this much space. What's happened? 

Solution:
The MS-DOS based FAT file system allocates space for files in clusters. A cluster is a collection of sectors; a sector under FAT is preset to a size of 512 bytes. As the partition size increases, the cluster size increases also because FAT can only track a maximum of 64K clusters. This cluster size also has a limit, being 32K under MS-DOS therefore delivering a maximum partition size of 2GB. See the chart below for more information.
 
  Drive Size
(logical vol)
FAT Type Sectors
Per Cluster
Cluster size
(Floppy Disks) 360K 12-bit 2 1K
  720K 12-bit 2 1K
  1.2 MB 12-bit 1 512 bytes
  1.44 MB 12-bit 1 512 bytes
  2.88 MB 12-bit 2 1K
(Hard Disks) 0 MB - 15 MB 12-bit 8 4K
  16 MB - 127 MB 16-bit 4 2K
  128 MB - 255 MB 16-bit 8 4K
  256 MB - 511 MB 16-bit 16 8K
  512 MB - 1023 MB 16-bit 32 16K
  1024 MB - 2048 MB 16-bit 64 32K

What this all means for your trend server is that typically it would have a drive of say over 600MB and therefore the smallest cluster size would be 16K (32K if the drive is bigger than 1GB). Say you have a system of trend files which comprises a large number of trend files, each of which is 20K in length. Each trend file would require 2 clusters (1 on a bigger drive), meaning 32K. It is clear that 12K out of the 32K is empty but still marked as used space. Over a heap of files, this kind of waste really adds up.

There are a number of things you can do about this. One is to live with it. Apart from a rather large storage space overhead your files should still work properly. You may need to worry about upgrading your drives sooner than you thought however. You could consider changing the type of file system you are using. NTFS (Windows NT's file system) has a maximum cluster size of 4096 bytes, but can track such a large number of clusters that the maximum partition size is 16Exabytes. Therefore in general it will use your disk space more efficiently. Also you could modify your trending scheme such that the files generated are of a size which coincides with the current cluster size of your partition. However, this last suggestion will not help if you already have a significant amount of trend information stored.

This principle is not confined to Trend files or Citect in general. It is a consequence of using the FAT file system.

 

Keywords:
 

Attachments