• I’m running a LAMP with ubuntu server 12, mysql innodb_version 5.5.49 on a WordPress platform (3 websites virtualized). Has been running without issue for about 2 years, but I just started getting an error “Error establishing a database connection” error. My other virtualized sites get a “max connections exceeded” error occasionally as well. No new plugins, no db changes.

    When I log into mysql as root and run show full processlist; I get a list of 150 Sleep processes spawned by only one of my site’s primary login. Of course, 150 is my max_connections limit, so these processes are dragging the entire server down. Given the time each one is up, it appears that about 6 are being spawned every second.

    My problem is that I’ve run out of troubleshooting ideas. I’m a DBA neophyte to be sure. Here’s what I’ve tried so far:

      Looked at current traffic to the site to see if I was getting attacked. Nothing out of the ordinary there. Just in case, I changed where my DNS pointed for a brief time, but the processes were still being spawned. I think this rules out an attack or SQL injection.
      Tried setting wait_timeout=60, but even this wasn’t short enough given the rate of process spawning. No difference.
      Updated WP, disabled all WP plugins and switched themes. No change. AFAIK, WP doesn’t even use persistent db connections, so it shouldn’t even be a WP issue.

    When I enable a global log and examine the queries I get a ton of these queries:
    7990391 Query SELECT COUNT(*) FROM wp_postmeta WHERE meta_key = '_loved' AND post_id = 1274

    Anyone know where this query is coming from? I had to limit the connections for this site to prevent it from taking down the entire server.

    Thanks in advance.

  • The topic ‘getting a ton of Sleep queries (meta_key = '_loved') to mySQL taking down server’ is closed to new replies.