max_user_connection, when is it a bad script and when is it a busy server.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • FFMG

    max_user_connection, when is it a bad script and when is it a busy server.

    First I should point out, that 99.99% of the time I have no problems
    with my server.
    Yes, it is semi busy but nothing that should bring MySQL server down. I
    get on average 70 to 100 queries a seconds.

    My understanding of max_user_connec tion is that it is the number of
    scripts that simultaneously request a connection, (before the script
    ends).
    If there is a bug in the script, such as an infinite loop then
    connection will be kept until the timeout occurs.

    Seen that my server works fine most of the time, I can assume that such
    a bug is pretty rare difficult to reproduce. So how can I can it reach
    the max number connection?

    So my question is, is there a log that keeps track of scripts that took
    a long time to run?
    I guess anything taking more than 3 seconds should be counted as slow.
    A script should never take more than one or two seconds to execute,
    (should it?).

    And from a database point of view, is there a way of setting a time
    out? If the query does not return within 1 or 2 seconds then there is a
    problem and it should exit.

    And last but not least, Is there a command I my script can send to
    flush all the connections regardless of who/what is using it?
    Because when that happens then I have to wait a very long time for the
    server to recover.

    Any thoughts?

    FFMG

Working...