in reply to Re: Failures in TCP/IP stack
in thread Failures in TCP/IP stack

I'm thinking that there is actually a bug in either the DBI or in DBD::mysql that is causing the file descriptors to hang open on failed connections. Anyone have any ideas, or should I start looking through the DBI code to track it down?

Replies are listed 'Best First'.
Re^3: Failures in TCP/IP stack
by BrowserUk (Patriarch) on May 29, 2006 at 03:42 UTC

    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.
      My conclusion that it was a DBI issue was based on commenting out all checks but DBI. I counted the orphaned file descriptors per pass, and they corresponded with the number of servers which were not in fact running mysql at the time.

      You are right though... I'll make a test case which illustrates that issue, and present that as a new question here.