Forums

[resolved] MySQL sleep problem (connections not closed) (7 posts)

  1. tici
    Member
    Posted 3 years ago #

    Just wondering if you or anyone on your forum can answer/solve this problem.

    I've received the following from my shared hosting company where I have my wordpress blog installed:

    "This account has recently been showing signs of causing stability problems on the server which appear to be due to mysql
    usage on the wordpress installation, it does not appear to be closing it's connections which are then hanging and causing
    problems for the rest of the server. You will need to resolve this issue immediately or the account will need to be suspended
    again to prevent further server issues."

    What this means is that wordpress is opening up a connection and then not closing it before the page request is complete.
    This leaves the connection open which in turn causes load issues.

    Here's a fingerprint of whats going on with my database server:

    | 468 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 310 | NULL
    | 470 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 289 | NULL
    | 471 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 413 | NULL
    | 477 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 333 | NULL
    | 532 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 381 | NULL
    | 557 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 320 | NULL
    | 558 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 25 | NULL
    | 566 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 318 | NULL
    | 576 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 367 | NULL
    | 627 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 331 | NULL
    | 660 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 22 | NULL
    | 667 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 26 | NULL
    | 673 | v6mascar_mascari | localhost | v6mascar_mascarit | Sleep | 323 | NULL

    P.S - I don't use persistent connections - this means that my wp-includes/wp-db.php its using mysq_connect instead of mysql_pconnect.

  2. Otto
    Tech Ninja
    Posted 3 years ago #

    WordPress does not use persistent connections, meaning that when the request ends, the connection is automatically closed. If it's left open, then something else is leaving it open. Check the PHP configuration as well as the mySQL config, to see if something is overriding the connection and making it persistent.

  3. tici
    Member
    Posted 3 years ago #

    Hello Otto! Thanks for your reply.

    Err, I did all the things out there to make it to work normally. I've checked all my plugins (most of the cases they are built by me). I'm not using any of the ones from wordpress directory. They are very well tested on other hosting providers (they all using the $wpdb class - so I dont have any custom queries - my plugins are very well coded).

    I don't have access to any MySQL conf file as I`m on a shared hosting. Also, this hosting provider doesn't help me with anything. They only provided me with the above. So I can't spot the problem only with that information.

    I think they could easily tell the file that causing the problem directly. They want money for extra-support. I don't believe this is happening to me.

    I read all the opened threads out there but I couldn't find anything to satisfy my needs.

    Man ...I'll go crazy in one day, I`m stamped here.

    Thanks again Otto for your nice words,
    Have a nice day.

    P.S - sorry for my english

    - Tici

  4. tici
    Member
    Posted 3 years ago #

    Well, actually a plugin was causing me problems with the above. I've forgot to overwrite a custom query (used for testing pourposes).

    Phew, I'm saved now.

  5. stajich
    Member
    Posted 3 years ago #

    I'm in the same boat - can you mention which plugin caused the problem or how you determined which plugin caused the problem?

  6. tici
    Member
    Posted 3 years ago #

    Hi Stajich and sorry for being so late with this reply. Well, my problem was because of a plugin named Comment Karma. I have rewrite it to support the $wpdb class and now it's everything ok.

  7. loosefast
    Member
    Posted 2 years ago #

    I had the same problem on my site. The last plugin installed before the issue happened was the Page Links To plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic