You are not logged in.

#1 2009-10-24 12:37:32

alanmies
Member
From: Manchester, Finland
Registered: 2004-12-04
Posts: 23

Avoiding XFS fragmentation

(sorry if this is the wrong forum, I guess Multimedia would be appropriate as well)

My /media disk is formatted with XFS, and houses mainly MythTV recordings, videos, music and photographs. Lately I had noticed that MythTV performance was getting abysmal - more often than not, when watching live TV and a new program would start, the playback would freeze and I'd have to exit live TV and restart watching to see the new program. I knew I was low on disk space, but MythTV deletes recording as needed so that shouldn't be the issue. But then I noticed that deleting files from /media took a really, really long time - XFS is known for very speedy deletions, so obviously something was wrong.

This was unheard of. With updates Arch has continuously been getting better performance; while there are regressions every now and then, they're not permanent and certainly nothing in this scale. Then it finally hit me... could it be an issue that I have all but forgotten, fragmentation? After some googling it turns out this really could be the case, and sure enough, the drive was >98% fragmented. After several hours of xfs_fsr the performance was restored, now deleting files of several gigabytes happens instantly again. It also turns out this was a case of PEBKAC - the drive housing my / partition had died a while back, and now /media was in fstab with "noatime,defaults"; I had forgot to define allocsize, and the default allocsize (64kb, AFAIK) is really unsuited for MythTV.

But this got me wondering, what would be the ideal allocsize? MythTV wiki reccommends 512m, which probably is correct for the recordings and video files as well. And ever since I discovered Spotify (which thankfully runs very well under Wine) my music collection has been updated very infrequently. But I update /media/images from my digicam quite often, and obviously even at 8Mpix the images are less than 512MB.

So what's your opinion, should I use 512m, or a smaller value? Or should I just use a different drive for images/music and dedicate this one to recordings and video?

Last edited by alanmies (2009-10-24 12:41:52)

Offline

#2 2009-10-24 13:45:53

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Avoiding XFS fragmentation

allocsize=512m for mythtv is perfect if the primary use of that partition is indeed recordings.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB