[mythtv-users] Sloooow database

Mache Creeger mache at creeger.com
Mon Jun 9 16:04:20 UTC 2008


At 03:48 PM 6/7/2008, Curtis Stanford wrote:

>On 6-Jun-08, at 10:26 AM, Brad DerManouelian wrote:
>
> > On Jun 6, 2008, at 9:10 AM, Curtis Stanford wrote:
> >
> >> Hey everyone, here's something I've put up with for a long time and
> >> thought I'd try to resolve it.
>
> > Is your backend swapping? Have you optimized mysql in your my.cnf file
> > at all?
> > I have 2GB in my backend, so I set /etc/my.cnf with this:
> >
> > key_buffer = 32M
> > table_cache = 256
> > sort_buffer_size = 4M
> > myisam_sort_buffer_size = 16M
> > query_cache_size = 64M
> > query_cache_limit = 8M
> > query_cache_type  = 1
> >
> > It's much faster than the default settings. I could probably give it
> > more memory, but I do lots of transcoding and other stuff on my
> > backend so I didn't want to push it too much.
>
>Thanks Brad, yes I did optimize my.cnf:
>
>key_buffer = 48M
>table_cache = 128
>sort_buffer_size = 48M
>myisam_sort_buffer_size = 8M
>query_cache_size = 64M
>query_cache_limit = not set
>query_cache_type = 1
>
>I'll try your settings and see what happens. I only have 512M but I
>don't think it's swapping much.
>
>Curtis

Also,

Set up a daily cron job to optimize the database.  Here is a copy of what I do:

#!/bin/sh
# Optimize the database
OPT_MYTHDB='/usr/share/doc/mythtv-docs-0.21/contrib/optimize_mythdb.pl'
LOG='/var/log/mythtv/optimize_mythdb.log'
echo "Started ${OPT_MYTHDB} on `date`" >> ${LOG}
${OPT_MYTHDB} >> ${LOG}
echo "Finished ${OPT_MYTHDB} on `date`" >> ${LOG}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20080609/897346ec/attachment.htm 


More information about the mythtv-users mailing list