August 13, 2007

The Gutwrenching Joy of Linux

So, there was a post on Slashdot recently that epitomized the frustrating thrill that you can get with a complex system like Linux.

Basically, Linux evolved from Unix. Unix files have a time stamp called "atime." What atime means is it's the last time a file was accessed in any way: reading or writing. So, every time the system opens a file for reading, it has to write back out to the same file to adjust the atime. It's a bit more complicated than that with inode-based filesystems, but the upshot of this is that reading files can require disk writes. Disk writes can be slow...much slower than reads. Current hard disks aren't too bad in a difference, but flash memory is much, much slower to write to than to read from.

The game I work on at work now has migrated to using USB flash drives. That's been a whole host of other problems I won't get into now, but we'd noticed some odd slowdowns when doing things like playing video. Basically, since a file write is done on access, that means if you're streaming video from flash, you end up writing out for every read, and that REALLY slows things down.

Well, you can fix this by a simple mount command argument in fstab - noatime. Doing that sped up our game immensely. What does this have to do with frustration & joy? Well, there's always the idea that there's some setting, some optimization, some configuration that is hiding in the back alley somewhere that can make life better. It's like being in a jungle, but a jungle that has treasure hidden in the form of a downed plane, a buried chest, or a tree of life. It's out there....you just have to look.

Posted by flynn at August 13, 2007 12:19 PM
Comments
Post a comment7777






Remember personal info?