Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

MySQL server has gone away

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


mythtv at duncb

Nov 5, 2009, 6:57 AM

Post #1 of 19 (1412 views)
Permalink
MySQL server has gone away

Hi Guys

Since the upgrade to 0.22RC1 i've had an intermittent problem were the
backend stops connecting to the DB. It seems to happen when the backend
starts scanning for EIT data, but cant be sure about that.

The logs will suddenly start filling with this, over and over:

> Query was:
> SELECT chanid, useonairguide FROM channel, dtv_multiplex WHERE
> serviceid $
> Bindings were:
> :NETWORKID=9018, :SERVICEID=4672, :SOURCEID=1, :TRANSPORTID=4222
> No error type from QSqlError? Strange...
> 2009-11-04 19:59:29.645 Error preparing query: SELECT chanid,
> useonairguide FRO$
> 2009-11-04 19:59:29.678 Driver error was [2/2006]:
> QMYSQL3: Unable to prepare statement
> Database error was:
> MySQL server has gone away
The frontend is then unresponsive. Restarting mysqld makes no difference
and I have to restart the backend.

Since seeing the problems I have rebuilt the box from scratch, with a
completely new install of F11 and a clean db, but its still happening

anyone seeing anything similar?

cheers

Dunc

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


andy at squeakycode

Nov 5, 2009, 7:00 AM

Post #2 of 19 (1383 views)
Permalink
Re: MySQL server has gone away [In reply to]

Duncan Brown wrote:
> Hi Guys
>
> Since the upgrade to 0.22RC1 i've had an intermittent problem were the
> backend stops connecting to the DB. It seems to happen when the backend
> starts scanning for EIT data, but cant be sure about that.
>
> The logs will suddenly start filling with this, over and over:
>
>> Query was:
>> SELECT chanid, useonairguide FROM channel, dtv_multiplex WHERE
>> serviceid $
>> Bindings were:
>> :NETWORKID=9018, :SERVICEID=4672, :SOURCEID=1, :TRANSPORTID=4222
>> No error type from QSqlError? Strange...
>> 2009-11-04 19:59:29.645 Error preparing query: SELECT chanid,
>> useonairguide FRO$
>> 2009-11-04 19:59:29.678 Driver error was [2/2006]:
>> QMYSQL3: Unable to prepare statement
>> Database error was:
>> MySQL server has gone away
> The frontend is then unresponsive. Restarting mysqld makes no difference
> and I have to restart the backend.
>
> Since seeing the problems I have rebuilt the box from scratch, with a
> completely new install of F11 and a clean db, but its still happening
>
> anyone seeing anything similar?
>
> cheers
>
> Dunc
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Not with myth, but I have seen it before. We fixed it by increasing the
max packet size:

[mysqld]
max_allowed_packet=16M


I've had to set it as high as 32M on one of our web servers.

-Andy

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv at duncb

Nov 5, 2009, 7:15 AM

Post #3 of 19 (1390 views)
Permalink
Re: MySQL server has gone away [In reply to]

Andy Colson wrote:
>
> Not with myth, but I have seen it before. We fixed it by increasing
> the max packet size:
>
> [mysqld]
> max_allowed_packet=16M
>
>
> I've had to set it as high as 32M on one of our web servers.
>
> -Andy
>
Hi Andy

Thanks for the ridiculously quick reply!

Have added the option, will see how it goes

cheers

Dunc

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


aab at cichlid

Nov 5, 2009, 7:26 AM

Post #4 of 19 (1391 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 11/05/2009 07:00:56 AM, Andy Colson wrote:

> Not with myth, but I have seen it before. We fixed it by increasing
> the max packet size:
>
> [mysqld]
> max_allowed_packet=16M

Pardon my ignorance but what file are you editing here?
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv at duncb

Nov 5, 2009, 7:31 AM

Post #5 of 19 (1383 views)
Permalink
Re: MySQL server has gone away [In reply to]

Andrew Burgess wrote:
> On 11/05/2009 07:00:56 AM, Andy Colson wrote:
>
>> Not with myth, but I have seen it before. We fixed it by increasing
>> the max packet size:
>>
>> [mysqld]
>> max_allowed_packet=16M
>
> Pardon my ignorance but what file are you editing here?
>
Hi Andrew

/etc/my.cnf, then you'll need to restart the server

cheers

Dunc
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


aab at cichlid

Nov 5, 2009, 8:02 AM

Post #6 of 19 (1389 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 11/05/2009 07:31:15 AM, Duncan Brown wrote:

> /etc/my.cnf, then you'll need to restart the server

Oh that's hilarious
I doped out from google that it was a mysql option but when I
did 'ls /etc/my*' hoping to find mysql.conf or a /etc/mysql directory
all I found was my.cnf and I said "well THAT can't be it" :-)
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


ylee at pobox

Nov 5, 2009, 11:50 AM

Post #7 of 19 (1359 views)
Permalink
Re: MySQL server has gone away [In reply to]

Andy Colson <andy [at] squeakycode> says:
> [mysqld]
> max_allowed_packet=16M

What is the default, and any potential negative side effects from
this? My frontend/backend has 2GB of RAM and the mythconverg database
is about 1.5GB in size.

--
Frontend/backend: P4 3.0GHz, 1.5TB software RAID 5 array
Backend: Quad-core Xeon 1.6GHz, 6.6TB sw RAID 6
Video inputs: Four high-definition over FireWire/OTA
Accessories: 47" 1080p LCD, 5.1 digital, and MX-600
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Nov 5, 2009, 12:35 PM

Post #8 of 19 (1361 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 11/05/2009 02:50 PM, Yeechang Lee wrote:
> Andy Colson says:
>
>> [mysqld]
>> max_allowed_packet=16M
>>
> What is the default, and any potential negative side effects from
> this? My frontend/backend has 2GB of RAM and the mythconverg database
> is about 1.5GB in size.

Default is 1MiB and should be at least 10x larger than any of the MythTV
data requires. However, if a system is configured with a size of 1024
bytes (the smallest you can set), it could have problems post 0.21-fixes
due to the fact that our data can now be potentially 3x larger than it
was in 0.21-fixes due to the character encoding conversion. However,
even with 1024, there are few places where we should have issues with
max_allowed_packet size (most all of our DB data is small).

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv at duncb

Nov 6, 2009, 2:05 AM

Post #9 of 19 (1342 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 05/11/2009 15:15, Duncan Brown wrote:
> Andy Colson wrote:
>>
>> Not with myth, but I have seen it before. We fixed it by increasing
>> the max packet size:
>>
>> [mysqld]
>> max_allowed_packet=16M
>>
>>
>> I've had to set it as high as 32M on one of our web servers.
>>
>> -Andy
>>
> Hi Andy
>
> Thanks for the ridiculously quick reply!
>
> Have added the option, will see how it goes
>
> cheers
>
> Dunc
>
Unfortunately it didnt appear to work, again last night it 'went away'

The logs were full of stuff like this again, but for all sorts of
different queries:

2009-11-05 22:05:28.908 TVRec(6): Changing from Watching WatchingLiveTV
to None
2009-11-05 22:05:28.971 Error preparing query: DELETE FROM eit_cache
WHERE chanid = :CHANID AND status = :STATUS
2009-11-05 22:05:29.041 Driver error was [2/2006]:
QMYSQL3: Unable to prepare statement
Database error was:
MySQL server has gone away

It always seem to happen when i'm not home too, so the WAF is rapidly
hitting breaking point!

I've never seen this before and have been using myth for many years now,
the only change is the switch to 0.22

anyone got any other ideas?

cheers

Dunc
I



_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


andy at squeakycode

Nov 6, 2009, 6:25 AM

Post #10 of 19 (1335 views)
Permalink
Re: MySQL server has gone away [In reply to]

Duncan Brown wrote:
> On 05/11/2009 15:15, Duncan Brown wrote:
>> Andy Colson wrote:
>>>
>>> Not with myth, but I have seen it before. We fixed it by increasing
>>> the max packet size:
>>>
>>> [mysqld]
>>> max_allowed_packet=16M
>>>
>>>
>>> I've had to set it as high as 32M on one of our web servers.
>>>
>>> -Andy
>>>
>> Hi Andy
>>
>> Thanks for the ridiculously quick reply!
>>
>> Have added the option, will see how it goes
>>
>> cheers
>>
>> Dunc
>>
> Unfortunately it didnt appear to work, again last night it 'went away'
>
> The logs were full of stuff like this again, but for all sorts of
> different queries:
>
> 2009-11-05 22:05:28.908 TVRec(6): Changing from Watching WatchingLiveTV
> to None
> 2009-11-05 22:05:28.971 Error preparing query: DELETE FROM eit_cache
> WHERE chanid = :CHANID AND status = :STATUS
> 2009-11-05 22:05:29.041 Driver error was [2/2006]:
> QMYSQL3: Unable to prepare statement
> Database error was:
> MySQL server has gone away
>
> It always seem to happen when i'm not home too, so the WAF is rapidly
> hitting breaking point!
>
> I've never seen this before and have been using myth for many years now,
> the only change is the switch to 0.22
>
> anyone got any other ideas?
>
> cheers
>
> Dunc
> I

Eww.. bummer. Not sure, sorry.

I read someplace the EIT stuff works for a while and crashes for a
while.. seemingly at random. Do you really need the EIT stuff? if you
disable it do the crashes go away?

What QT version are you running? Not sure if its related, but this:
http://www.gossamer-threads.com/lists/mythtv/users/375066

says:
"It's actually a bug in Qt 4.5.0. You can either run Qt 4.4.x or apply a
patch to Qt"

-Andy
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv-users2 at dwilga-linux1

Nov 6, 2009, 6:27 AM

Post #11 of 19 (1328 views)
Permalink
Re: MySQL server has gone away [In reply to]

What is the value for wait_timeout in your my.cnf? It's been my
experience that this variable is more important, since it controls
the length of time that a connection is allowed to remain idle before
the server disconnects. It has to be longer than the execution time
of the longest query.

IMHO, a value of 600 (10 minutes) should be plenty. And on a system
where you generally only have a few clients at most, that value
should not result in too many zombie connections.
--
Dan Wilga "Ook."
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv at duncb

Nov 6, 2009, 6:58 AM

Post #12 of 19 (1321 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 06/11/2009 14:25, Andy Colson wrote:
>
> Eww.. bummer. Not sure, sorry.
>
> I read someplace the EIT stuff works for a while and crashes for a
> while.. seemingly at random. Do you really need the EIT stuff? if
> you disable it do the crashes go away?
>
> What QT version are you running? Not sure if its related, but this:
> http://www.gossamer-threads.com/lists/mythtv/users/375066
>
> says:
> "It's actually a bug in Qt 4.5.0. You can either run Qt 4.4.x or apply a
> patch to Qt"
>
Hi Andy

Unfortunately I do need the EIT, in the UK it is the only available
method of getting listings for DVB-T Radio channels

I'm not 100% sure it is an EIT thing, that always seems to be the first
mysql query that fails though. However, as the EIT crawl happens when
the backend is idle, if the mysql server is somehow timing out, it would
make sense that is the first thing to trip it up.

I'm going to try the timeout setting suggested and see if that fixes it.
If not I'll try disabling EIT

As for Qt I'm running 4.5. Running F11 I font think I have much choice.

cheers

Dunc
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv at duncb

Nov 6, 2009, 6:59 AM

Post #13 of 19 (1317 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 06/11/2009 14:27, Dan Wilga wrote:
> What is the value for wait_timeout in your my.cnf? It's been my
> experience that this variable is more important, since it controls the
> length of time that a connection is allowed to remain idle before the
> server disconnects. It has to be longer than the execution time of the
> longest query.
>
> IMHO, a value of 600 (10 minutes) should be plenty. And on a system
> where you generally only have a few clients at most, that value should
> not result in too many zombie connections.
At the moment it is whatever the default is. I'll try bumping it up to
600 and see how it goes.

Thanks for the suggestion

Dunc
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Nov 6, 2009, 8:29 AM

Post #14 of 19 (1330 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 11/06/2009 09:58 AM, Duncan Brown wrote:
> On 06/11/2009 14:25, Andy Colson wrote:
>> What QT version are you running? Not sure if its related, but this:
>> http://www.gossamer-threads.com/lists/mythtv/users/375066
>>
>> says:
>> "It's actually a bug in Qt 4.5.0. You can either run Qt 4.4.x or apply a
>> patch to Qt"
> As for Qt I'm running 4.5. Running F11 I font think I have much choice.

This issue is not the same as the one caused by that bug. We've
actually fixed all of Myth to work around that Qt 4.5 bug.

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Nov 6, 2009, 8:33 AM

Post #15 of 19 (1318 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 11/06/2009 09:59 AM, Duncan Brown wrote:
> On 06/11/2009 14:27, Dan Wilga wrote:
>> What is the value for wait_timeout in your my.cnf? It's been my
>> experience that this variable is more important, since it controls
>> the length of time that a connection is allowed to remain idle before
>> the server disconnects. It has to be longer than the execution time
>> of the longest query.
>>
>> IMHO, a value of 600 (10 minutes) should be plenty. And on a system
>> where you generally only have a few clients at most, that value
>> should not result in too many zombie connections.
> At the moment it is whatever the default is. I'll try bumping it up to
> 600 and see how it goes.
>
> Thanks for the suggestion

Wait timeout defaults to 28800 (seconds--which is 8hrs) in MySQL (though
your distro may have changed your system configuration such that it uses
something lower). Bumping from 28800 to 600 won't help. :)

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


ylee at pobox

Nov 6, 2009, 8:39 AM

Post #16 of 19 (1329 views)
Permalink
Re: MySQL server has gone away [In reply to]

Dan Wilga <mythtv-users2 [at] dwilga-linux1> says:
> IMHO, a value of 600 (10 minutes) should be plenty. And on a system
> where you generally only have a few clients at most, that value
> should not result in too many zombie connections.

Just checked my my.cnf and it was set to 93600 (!); same with
interactive_timeout. Should I lower one, or both?

--
Frontend/backend: P4 3.0GHz, 1.5TB software RAID 5 array
Backend: Quad-core Xeon 1.6GHz, 6.6TB sw RAID 6
Video inputs: Four high-definition over FireWire/OTA
Accessories: 47" 1080p LCD, 5.1 digital, and MX-600
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv at duncb

Nov 6, 2009, 9:08 AM

Post #17 of 19 (1329 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 06/11/2009 16:33, Michael T. Dean wrote:
> On 11/06/2009 09:59 AM, Duncan Brown wrote:
>> On 06/11/2009 14:27, Dan Wilga wrote:
>>> What is the value for wait_timeout in your my.cnf? It's been my
>>> experience that this variable is more important, since it controls
>>> the length of time that a connection is allowed to remain idle
>>> before the server disconnects. It has to be longer than the
>>> execution time of the longest query.
>>>
>>> IMHO, a value of 600 (10 minutes) should be plenty. And on a system
>>> where you generally only have a few clients at most, that value
>>> should not result in too many zombie connections.
>> At the moment it is whatever the default is. I'll try bumping it up
>> to 600 and see how it goes.
>>
>> Thanks for the suggestion
>
> Wait timeout defaults to 28800 (seconds--which is 8hrs) in MySQL
> (though your distro may have changed your system configuration such
> that it uses something lower). Bumping from 28800 to 600 won't help. :)
>
> Mike
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Hmm

Any other ideas? It hasnt happened since I changed that setting, but
then again it probably wont until I leave the mrs at home watching tv..

Dunc
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv-users2 at dwilga-linux1

Nov 6, 2009, 11:17 AM

Post #18 of 19 (1316 views)
Permalink
Re: MySQL server has gone away [In reply to]

At 8:39 AM -0800 11/6/09, Yeechang Lee wrote:
>Dan Wilga <mythtv-users2 [at] dwilga-linux1> says:
>> IMHO, a value of 600 (10 minutes) should be plenty. And on a system
>> where you generally only have a few clients at most, that value
>> should not result in too many zombie connections.
>
>Just checked my my.cnf and it was set to 93600 (!); same with
>interactive_timeout. Should I lower one, or both?

Don't bother, unless you're using lots of applications which use
MySQL and don't disconnect properly--which is unlikely.

These timeouts are there to keep clients that crash or otherwise fail
to close their connections from consuming MySQL's resources by
keeping the "slot" open. You'd probably have to make an application
crash a dozen times in a row during that period before you would even
notice a slight difference in speed.

If you make this value too low, you can run into situations where the
client retrieves some data, takes a long time to process it, and then
tries to fetch the next bit of data but can't because its connection
has been dropped.
--
Dan Wilga "Ook."
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Nov 6, 2009, 11:51 AM

Post #19 of 19 (1323 views)
Permalink
Re: MySQL server has gone away [In reply to]

On 11/06/2009 02:17 PM, Dan Wilga wrote:
> At 8:39 AM -0800 11/6/09, Yeechang Lee wrote:
>> Dan Wilga says:
>>> IMHO, a value of 600 (10 minutes) should be plenty. And on a system
>>> where you generally only have a few clients at most, that value
>>> should not result in too many zombie connections.
>>
>> Just checked my my.cnf and it was set to 93600 (!); same with
>> interactive_timeout. Should I lower one, or both?
> Don't bother, unless you're using lots of applications which use MySQL
> and don't disconnect properly--which is unlikely.
>
> These timeouts are there to keep clients that crash or otherwise fail
> to close their connections from consuming MySQL's resources by keeping
> the "slot" open. You'd probably have to make an application crash a
> dozen times in a row during that period before you would even notice a
> slight difference in speed.
>
> If you make this value too low, you can run into situations where the
> client retrieves some data, takes a long time to process it, and then
> tries to fetch the next bit of data but can't because its connection
> has been dropped.

For example, nuvexport can be affected by too-low timeouts. If your
system takes longer than 8hrs to transcode some show (which happens to
some users--especially for long recordings), the MySQL-default of 8hrs
will cause it to fail (/after/ at least 8hrs of processing, of course :).

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.