[mythtv-users] Frontend looses connection to backend server when idle

Michael T. Dean mtdean at thirdcontact.com
Thu Feb 19 14:07:07 UTC 2009


On 02/19/2009 04:58 AM, Mikael Djurfeldt wrote:
> My MythTV 0.21 setup on Ubuntu 8.10 works well in most aspects, except
> for one thing: When the frontend has been idle for some period of time
> (hours) it seems like the connection to the backend server is lost.
> When starting to use the frontend after such an idle period and trying
> to watch recordings there is a hang for 10-20 seconds after which the
> frontend reports about the connection being lost.  If I then try again
> to watch recordings, the connection has been re-established and
> everything works well until the system has been idle for yet some
> time.
>
> Is this a common problem?
>
> Is there some setting I could use to keep the connection alive?
>
> Is there, maybe, some OS setting I could change in order for the
> system not to drop the connection?

I'm guessing 8 hours...  I think there's a problem with some newer
version of some libs or with some configuration on some distros that
causes Myth's cached DB connections to take forever to timeout, so you
get a delay when it tries to reestablish those connections and--in your
case--the delay is great enough that the frontend may even lose the
connection to the master backend.  I'm pretty sure one of the devs, Greg
Estabrooks, is looking into it (though he's recently been very much
distracted with some major work he's been doing for 0.22, so I'm sure he
would very much appreciate any debugging you could do).

As a workaround in the interim, you could set wait_timeout and
interactive_timeout in your MySQL configuration (usually /etc/my.cnf or
/etc/mysql/my.cnf) to some number of seconds greater than 28800 (which
is the default value, 8 hours)--perhaps to 93600 (26 hrs) or 108000 (30
hrs), so that--assuming you use mythfrontend every day, the connections
won't be killed.

Or, even better, you could set them to 120 (seconds), which would allow
you to easily reproduce the problem easily so you could debug it... ;)

Mike


More information about the mythtv-users mailing list