[mythtv-users] my experience with myth on a solid state drive

Ronald Frazier ron at ronfrazier.net
Thu Jan 5 16:20:53 UTC 2012


A few months ago, I got a new larger SSD drive for my desktop
computer, to replace the older, smaller SSD I had previously (a 1st
generation Intel 80GB). I then decided to take that old drive and use
that as the primary drive for my myth system. Wow, what an incredible
performance boost it has been.

In my experience, myth's program guide has never really been snappy,
but it seems to have gotten worse over time. Perhaps it's just because
I've upgraded to digital HD and have about 3 times as many channels as
I used to. Whatever the cause, it's been a pain to use, sometime even
taking several seconds to scroll down a page. Likewise, entering the
Watch Recordings screen seems like it has gotten worse. Again, maybe
it's just because I have a lot more recordings now than I did several
years ago. Same thing for Videos.

Once installing the SSD, the performance of myth is just incredible.
The program guide is instant...far and away it's the most responsive
program guide I have ever used, anywhere on any device. Going into the
Watch Recordings and the Videos screens are likewise nearly instant.
Mythweb (which has always been slow all around) is likewise incredibly
fast in all respects...especially the guide. Changing channels in
LiveTV even seemed quite a bit faster. This was easily one of the best
upgrades I've done to my myth system over the years.

Before I made the switch, I did a lot of reading about SSD drives in
linux, and people talking about putting /tmp or /var or this or that
onto a physical drive or a tmpfs. The reasoning for all of this is
that SSDs wear out from excessive writing (unlike HDDs). I figured I'd
ignore all of that advice and just give it a shot with everything all
on the SSD (except for my recordings/movies, of course). The only
thing particular I did was to pay attention to partition
alignment...some resources said to align it to 512K boundaries, other
said 1MB boundaries. I played it safe and aligned it to 1MB.

The intel drives are rated for at least 5 years of 20GB/day of writes.
You can check the current wear level using the SMART feature of the
drive. After using this drive in my Windows box for over 3 years, the
drive still had 93% of it's rated life remaining, so I should have at
least 4 years of life at 20GB/day. So I began running my system and
periodically monitoring the wear level. Immediately I discovered I was
writing about 30+GB/day, which meant the drive would only last about 3
years. So off I went trying to figure out what was doing so much
writing. Was it mysql, or logging, or the fact that I'm also running
my 2 frontend systems (which are diskless boots) from this drive, or
/tmp? So I began systematically moving things one by one to another
partition, watching it for a few days, and then moving back when I saw
no change. Finally when I got to moving /tmp, that made all the
difference. SSD writes dropped down to about 2GB/day, which means it
would take 40 years to use up the drive's rated write life.

So what was doing all the writes to /tmp? Several times an hour, myth
recalculates its schedule. When it does, it uses about 500MB of
temporary mysql tables. That alone was responsible for over 90% of the
writes on the SSD. So instead, I created /tmp as a tmpfs partition.
I've got 2GB of ram, so that gives /tmp up to 1GB to use.

So far that's worked just fine with just that one change. I never had
to mess with all of the other things people say to do to minimize
wear, like alter the io scheduler or the cache flush timings, or move
/var or /var/log.

-- 
Ron Frazier


More information about the mythtv-users mailing list