mysql going to sleep/sbwait while executing slow query [message #472] |
Mon, 18 December 2006 09:04  |
firestorm Messages: 9 Registered: September 2006 Location: Moscow |
Junior Member |
|
|
We use mysql for creating inverted index files for our small scientific search engine.
We have a lot of XML files, indexate them to one big (50mln) mysql table.
Then we create tables and files using group by similar rows
(for example:
insert ignore into table (field1, fieldCount) select field,count(*) from table_temp group by field order by field)
So sometimes this query doesn't work with no errors:
Using command top and iostat I see, that mysql is working, but without using processor (memory and HDD) resources.
MySQL is in state sbwait (waiting for data!!??)
Mysql command show processlist shows, that NULL query is executing.
Mysql logs are ok - no problems.
Parent process (php script, that executed query) is working, also without using resources.
Does everybody know, where is the problem?
|
|
|
|
|
|
|
|
|
|
| Re: mysql going to sleep/sbwait while executing slow query [message #490 is a reply to message #472 ] |
Wed, 20 December 2006 04:41  |
Peter Messages: 405 Registered: August 2006 |
Senior Member Super Guru |
|
|
The state is "SLEEP" so that query was inactive for over 400 seconds.
You can enable general query log in MySQL and see what application does th the database, also logging queries as they are executed in the applications and returned error codes may be helpful. Error codes are not stored in MySQL Error log file.
wait_timeout may not work for some reason or might be you do not set it correctly.
Peter Zaitsev, MySQL Performance Expert
MySQL Performance Blog - http://www.mysqlperformanceblog.com
MySQL Consulting http://www.mysqlperformanceblog.com/mysql-consulting/
|
|
|