• I have a problem with all my sites displaying database connection errors whenever a single database has too many sleeping connections. That database only powers one site so I know the problem is with that site. Probably a WordPress plugin on the site.

    How can I figure out which plugin is the problem?

    There are too many to look at the source code, so I need an automated solution that says which file is opening the unclosed connections.

    Increase max connection size is only a temporary solution because eventually the number of sleeping connections reaches that number.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter wpbroken2much

    (@wpbroken2much)

    To make matters worse, rebooting the server does not delete the sleeping processes. They seem to be on the process list after the restart. Is there some setting in MySQL that tries to reconnect to those things automatically or something? If so, can it be disabled?

    Do you see which statement it is? Maybe you can tell from this which plugin is causing it.

    Wordpress has internal cronjobs that are initialised via http request. If someone or something calls the page directly after booting, either this request itself could generate the statement or the request could start a wp-cron that executes the statement.

    Thread Starter wpbroken2much

    (@wpbroken2much)

    How would I be able to tell which statement it is? I can access the process list but all the processes are sleeping and don’t show anything in the info field.

    If you have installed phpmyadmin, you can call up the process list in the browser and see which statement it is.

    You can also log on to the mysql service via SSH.

    mysql -u yourmysqluser -p

    and then use

    show processlist;

    show all processes.

    You can also activate MySQL logging. This creates log files containing all SQL statements that are transferred to the MySQL service. How to activate this should be documented in the Linux distribution you are using.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unknown WordPress Plugin Not Closing MySQL Connections’ is closed to new replies.