File systems have nothing to do with your hard drive

Many people think processes communicating by using files are crude. In some sense they are right. It is the crudest mechanism ever invented. It is often a feature, not a bug. It’s lego-like: the pieces connect in unsubtle ways, it’s easy to understand what goes where, and there is the advantage. It has disadvantages, of course.

One of these disadvantages, however, is *NOT* the “overuse if the hard drives”, at least not on modern UNIX operating systems. On a modern operating system, the file will be cached to memory, and read from memory by the other process, unless there’s a severe memory shortage. The file will be eventually written to the hard drive, but it will all be written in one go, usually as the hard drive is seeking to the area for other reasons. If it’s that much of a concern, possibly because of battery life, it’s possible to tune the file system to write to the disk less often. It’s probably a good idea anyway, on a laptop — power is not going to run out (there’s the battery, and when it’s low I expect the OS to be smart enough to write everything and suspend) and on the other hand, it would save battery power.

Advertisements

One Response to File systems have nothing to do with your hard drive

  1. prodlife says:

    Did you tune the write-to-disk frequency on your laptop? What did you set it to?

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: