Followup on my MySQL persistent threads

Rick Stevens rstevens@publichost.com
Mon, 11 Dec 2000 10:22:05 -0800


This is just an update on my persistent threads problem on MySQL.

In the last episode, Rocky and Bullwinkle had just met Mr. Big (OOPS!
Sorry!  Wrong show!)

I had some MySQL threads that were hanging on for a ridiculous length
of time.  MySQL got so confused that IMP sessions were hanging.  Well, 
I've done some surgery and seem to have fixed the situation.  Which
one of the following items was the magic bullet I'm not certain, but
the problem appears to be fixed.

My analysis started by using "mysqladmin(8)" to see just what the
devil MySQL was doing.  mysqladmin showed that there was a "DELETE
FROM active_sessions WHERE date < somedate AND name = HordeSession"
statement running for a REAL long time.  This thread was stalling,
causing all dependent threads to enter a "Locked" state. Ah HAH!

We use two load-balanced servers (balanced via an Alteon box).  I
looked at the horde/imp/config/defaults.php3 file and discovered the
"$default->localhost" item on both servers was set to the same value.
I changed it so each server has a unique value here.  That was item
1.

I also noticed that the route to our MySQL server was using the same
interface that was connected to the load balancer.  I changed the
routing to use our back-end network (used for backups, maintenance
and other internal operations).  That was item 2.

I purged the data from the "active_sessions" table of the Horde
database because I suspected that items 1 or 2 caused a corruption
in that table.  That was item 3.

I changed the MySQL thread timeout from the default of 24 hours to
15 minutes.  That was item 4.

As I said, which one of these things actually fixed the problem is
unclear (I doubt it was the reroute in item 2).  But, if anyone else
is having problems, I thought this information may help.

We now return you to your regularly scheduled cartoon...

----------------------------------------------------------------------
- Rick Stevens, CTO, PublicHost, Inc.        rstevens@publichost.com -
- 949-743-2010 (Voice)                     http://www.publichost.com -
-                                                                    -
-   Tempt not the dragons of fate, since you are crunchy and taste   -
-                         good with ketchup.                         -
----------------------------------------------------------------------