Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

While executing SQL Scripts, mysqlnt.exe uses 50% of CPU . Even there is no access, the CPU usage doesn't come down. Any solution for this ?

share|improve this question

migrated from stackoverflow.com Dec 22 '09 at 10:14

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

add comment

3 Answers

You most likely have a dual core machine, and some MySQL session is using 100% of one of your cores/processors.

Open the MySQL command line client, and issue a

SHOW FULL PROCESSLIST

to see what sessions are currently running, what they are doing, and how long they are doing it. If you get a feeling who de culprit is, and you can safely abort it, Issue a

KILL ###

Where ### is the number of a session (found in the Id column of the SHOW PROCESSLIST output)

share|improve this answer
    
I've killed the unused threads. There is only 4 live connections right now. But still the the process eats 50% of the box ? Is there anything I need to change in the "Start up variables" section ? –  Vinoj Dec 22 '09 at 10:08
add comment

The best way is to diagnose what query is causing the problem, you should probably optimize it and add some indexes on questioned table.

Use SHOW FULL PROCESSLIST for getting list of processes and then run it with EXPLAIN to see why it takes so long.

share|improve this answer
add comment

try to make indexing on your table - also you need to make some performance - tunning on your query - so which makes it much faster :-) optimize it - I'm agree with Michal Chihar !

share|improve this answer
add comment

Your Answer

 
discard

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