[mythtv-users] ramfs for mysql

Brent Bolin brent.bolin at gmail.com
Thu Dec 22 12:02:12 UTC 2011


8GB RAM
Release:	10.04
Codename:	lucid

I would also mention that my system runs on a UPS

/etc/init/mysql.conf
snip
pre-start script
# Copy from mysql save directory to tmpfs directory
cp -rp /var/lib/mysql.ram/* /var/lib/mysql

snip
post-stop script
# Copy mysql data to save directory and remove from tmpfs directory
cp -rp /var/lib/mysql/* /var/lib/mysql.ram
rm -fr /var/lib/mysql/*

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vol00-root
                      9.2G  5.4G  3.4G  62% /
none                  3.7G  544K  3.7G   1% /dev
none                  3.7G   96K  3.7G   1% /dev/shm
none                  3.7G  112K  3.7G   1% /var/run
none                  3.7G  4.0K  3.7G   1% /var/lock
none                  3.7G     0  3.7G   0% /lib/init/rw
none                  1.0G  343M  682M  34% /var/lib/mysql
none                  9.2G  5.4G  3.4G  62% /var/lib/ureadahead/debugfs
/dev/mapper/vol00-disk1
                      2.2T  2.1T   22G  99% /var/lib/mythtv
/dev/md0               46M   41M  2.9M  94% /boot
/dev/mapper/vol00-disk2
                      1.4T  1.3T   75G  95% /disk2


And yes I do run native mythtv optimization



On Thu, Dec 22, 2011 at 3:54 AM, Ian Clark <mrrooster at gmail.com> wrote:
> On 21 December 2011 19:56, Dan Wilga
> <mythtv-users2 at dwilga-linux1.amherst.edu> wrote:
>> On 12/21/11 2:04 PM, Josu Lazkano wrote:
>>> Hello all. I am having some playback problems on LiveTV
>>> (mythpreviewgen). I try to change the recordings file system (XFS,
>>> EXT3, EXT4...), but I got little stops.
>>>
>>> I read about to move the mysql files to ramfs, I have 3GB of memory
>>> (2x2GB, 1GB for nvidia card).
>>>
> Just out of interest, is this a bios limitation, or are you using a
> 32bit system? If you BIOS supports mapping periferals above the 4GB
> memory boundry and you have 4 gig of memory it may be worth moving to
> a 64bit linux, so you can take full advantage of it.
>
>>> Before start to break my system I want to know if this will help to
>>> the playback problems. I have problem on program guide change watching
>>> LiveTV.
>>>
>>> Anyone using ramfs for mysql? Any recomendation?
>>>
>> IMHO, if you have RAM to spare, it makes more sense to throw it at MySQL
>> directly by tuning the parameters in mysql.conf.
>
> This is good advice, you can probably make MySQL do most of the heavy
> lifiting cache wise, without having to worry about data on volotile
> storage. This is well worth running after the system's been up for a
> few hours...
>
> http://mysqltuner.com/
>
>> Using ramfs or tmpfs,
>> you have to worry about data loss during an unexpected reboot, unless
>> you also do MySQL replication to non-volatile storage.
>>
> ...which means you'll probably also be writing to a binary log file on
> non volotile storage, which probably negates a lot of the advantages?
>
> You also say you backup your database every 4 hours, do you run any of
> the optimisation routines? It may just be your tables could do with a
> spring clean?
>
> Aside: If someone is going to do this, or has done this, do you move
> the files onto a ramdisk, or do you rename a table and have a
> startup/shutdown scripts that SELECT INTOs a ram backed table?
>
> Cheers,
>
> Ian
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users


More information about the mythtv-users mailing list