Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 servers:

  • Server W(indows), a webserver that runs MS Server 2003. Server W is our main webserver, and runs Apache and PHP 5.
  • Server U(buntu), that runs Ubuntu 10.04. Server U acts as a mail queuing server, running primarily a single C++ application and a single PHP script that interact with Server W's MySQL database.

I'm beginning to encounter massive CPU spikes on Server W, that brings its ability to properly host down. I'm talking 100% for 30 minutes, until the MySQL process is killed, or until the server is restarted.

When I use MySQL Query Browser to run a SHOW PROCESSLIST, I can see that Server U is maintaining what I believe to be too long of a connection with the MySQL server. I've attached and highlighted the remote connection that seems to be offending. Unfortunately, I use the same MySQL user to connect with both the C++ app and the PHP script, so I'm not sure which one is the cause. I've temporarily disabled the mail server until I can pin down a cause.

I'm really stuck here, so if you have any kind of inkling in the slightest about what this could be, or, since it's such a generic question, of any additional information I can procure to expedite the debugging process.

enter image description here

share|improve this question

migrated from Feb 9 '12 at 1:40

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

You have the remote port in the processlist above (can't read it in the screenshot). With that knowledge go to the results of netstat --program under linux, which will give you the name and PID of the troublesome process, the remote port on Windows is the local port on the Linux side of things.

share|improve this answer
Running that unfortunately doesn't list port 59705, and I cannot right now reconnect the server as Server W is hosting a webinar right now that must not be interrupted. I will definitely run this when I can, hopefully this afternoon, but do you have any other thoughts? Thanks a lot. – Josh Jul 15 '11 at 14:27
@josh this may sound silly, but if the cpu spikes due to the mysql process (you have verified that it's really mysql that eats up cpu?) someone must be giving it a lot of work. more to the right of your show full processlist you can see what query the process is executing atm, doing that repeatedly should give you an insight in what's going on and by who. You should also activate the slow query log asap. – fvu Jul 15 '11 at 15:17
Actually, going through the slow query log right now, and I believe I may have found the culprit query. I'll update in a bit. – Josh Jul 15 '11 at 15:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.