MySQL keeps getting “connect” commands 100X per minute! My server was having performance issues, things loading slow, pages not loading, etc so I ran the "top" command after logging in via SSH. I noticed the CPU kept jolting up to 40%, on and off, when literally no one is accessing the website. I have other (much less powerful) servers with resting heartrates at 1-5% so I know something is wrong. I log into MySQL, enable general logging and this is what I find:

    event_time Descending 1     user_host   thread_id   server_id   command_type    argument 
    2014-09-20 04:35:07     [root] @ localhost []   46833   0   Connect     root@localhost on
    2014-09-20 04:35:07     [root] @ localhost []   46834   0   Connect     root@localhost on
    2014-09-20 04:35:04     [root] @ localhost []   46832   0   Connect     root@localhost on
    2014-09-20 04:35:03     [root] @ localhost []   46829   0   Connect     root@localhost on
    2014-09-20 04:35:03     [root] @ localhost []   46830   0   Connect     root@localhost on
    2014-09-20 04:35:03     [root] @ localhost []   46831   0   Connect     root@localhost on
    2014-09-20 04:34:58     [root] @ localhost []   46828   0   Connect     root@localhost on
    2014-09-20 04:34:57     [root] @ localhost []   46827   0   Connect     root@localhost on
    2014-09-20 04:34:48     [root] @ localhost []   46826   0   Connect     root@localhost on
    2014-09-20 04:34:41     [root] @ localhost []   46823   0   Connect     root@localhost on
    2014-09-20 04:34:41     [root] @ localhost []   46824   0   Connect     root@localhost on
    2014-09-20 04:34:41     [root] @ localhost []   46825   0   Connect     root@localhost on
    2014-09-20 04:34:39     [root] @ localhost []   46822   0   Connect     root@localhost on
    2014-09-20 04:34:37     [root] @ localhost []   46821   0   Connect     root@localhost on
    2014-09-20 04:34:36     [root] @ localhost []   46820   0   Connect     root@localhost on
    2014-09-20 04:34:33     [root] @ localhost []   46819   0   Connect     root@localhost on
    2014-09-20 04:34:30     [root] @ localhost []   46818   0   Connect     root@localhost on
    2014-09-20 04:34:29     [root] @ localhost []   46815   0   Connect     root@localhost on
    2014-09-20 04:34:29     [root] @ localhost []   46816   0   Connect     root@localhost on


There is literally something like 100 "connect" commands mySQL is processing every minute. I'm sure this is what is causing my performance issues. But my problem is that I don't know where these commands are coming from or how I might go about tracing the source. Any ideas?
I would check / verify if there is a init_connect option in your my.cnf, if so that would be a great place to start to see what the var is set to.

Also:

While the server is running, in terminal, run:

ps -aef | grep mysql


and identify the user(s) that are running processes up against mysql. If you end up seeing a sort of trend in the processes than grep out the parent processes for each child process to get to the route PID that is engaging.

Also:

If this MySQL instance is not in production, I would suggest a server restart as well. We all know MySQL can be finicky and in many cases a clean restart clears up buggy issues.

Side note: Is there a proxy in front of your MySQL server? If so, I would look into this layer just as intensive as the database.

Gluck! Cheers.