0

I am using Ubuntu. I have a root partition and a separate, large ext4 data partition. The data partition has ~2GB free according to df and with that, things are fine.

I experience a repeatable behaviour in which the system generally slows down when the data partition fills up. As free space on the data partition shrinks to ~1GB, I find many applications start stalling during normal operations (copy-paste, loading web pages, ls, etc). The problem goes away if I free up space.

I am experiencing the ebb and flow of this problem a lot since I am syncing blockchain and have to periodically delete things to make room. This is a reliable, repeatable pattern. I am quite sure it is a hard disk access issue.

I have NO swap partition, and several gigabyes of unused RAM.

  1. Why does it happen when there is still "lots" (~1GB) of space free. Is df lying about the available space?

  2. Other than deleting more stuff, is there anything I can do to make the system more responsive in the low free space state? I would expect the system to still be responsive even with zero free space, but it isn't.

1 Answer 1

2

It’s not just sheer amount of hard disk available, it’s also the fragmentation of free space. Assuming you’re using Hard Disk, normal operations leave many files spread out over the disk, separated by random amounts of free space from deleted files.

When the OS needs to write something to the disk, it prefers to write a file to a continuous stretch of free space, rather than fragment it and write to many different spots on the disk.

Hard Disks have multiple platters, so the OS can analyze which platter is most convenient to write to (i.e., smallest amount of wait time as the whole disk rotates). Large amounts of free space anywhere on the disk means that there’s probably a smaller wait before the disk rotates to a writeable spot. As you get closer to full capacity, the many waits as the disk rotates around for a convenient place to write gets worse.

SSDs also have much longer rewrite times than write times. They’re an order of magnitude faster in general than HDDs, but the difference from an SSD at writing an empty cell to rewriting a partially-used cell is significant.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .