First off, try running (a copy of) your code with the DBI stuff commented out. If your problem goes away, you know that's where to look.

Then, produce a cut down verion of your deamon script that only contains the DBI checks against a single, test installation of MySQL, and try to reproduce the problem by setting the frequency as high as you can.

At that point you should have a much smaller script that reproduces the problem much more quickly. If you then post that here, the DBI experts here (not me!), will be much more likely to take the time to review your shorter code and perhaps spot the problem or offer suggestions as to a way forward.

I have a vague recollection that by default (back at version 3.something), MySQL hung on to unclosed connections for something like 900 seconds? And that there was a configuration option (at the server end) to have connections timeout more quickly. My recollection may be wrong, and it probably wouldn't produce the symptoms you are seeing, but it the kind of thing that those with good MySQL experience may spot for you, once you have isolated the problem and posted a concise script that reproduces it.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^3: Failures in TCP/IP stack by BrowserUk
in thread Failures in TCP/IP stack by hubb0r

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.