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.

I need some help diagnosing a fault

I have a development server and a production server. They are (in the large part) identical in setup. Both are Ubuntu Server 10.04 LTS installs.

I turned on the MySQL slow query logs on both servers, and it works on the development server, but not the production server. On development, the slow query log fills up fairly quicly, but on production, the log file remains empty.

And idea how I can diagnose why it's not working on production? Are there any error logs that might contain the information?

There's nothing obviously relevant in /var/log/mysql/error.log, and /var/log/mysql/mysql-slow.log actually exists - it's just empty.

my.cnf:

log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2

Thanks for any direction.

share|improve this question
    
What value did you set long_query_time to? And how about the min_examined_row_limit? What query did you use to test? –  quanta Oct 24 '11 at 15:20
    
log_slow_queries = /var/log/mysql/mysql-slow.log, long_query_time = 2, min_examined_row_limit is not set (on either server). I've run a few queries that took longer than 2 seconds. –  aidan Oct 24 '11 at 15:30
    
Which MySQL version are you running? –  quanta Oct 24 '11 at 16:06
add comment

2 Answers 2

I'd check the MySQL server versions for the correct parameters to use, as there are differences between them.

E.g. http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html

Which states that log_slow_queries is depracated as of version 5.1.29, and you need to use slow_query_log = 1 to enable it and slow_query_log_file = /path/to/file.name

Prior to 5.1.29 you used log_slow_queries = /path/to/file.name to specify where to log the queries to.

Between 5.1.12 and 5.1.29 you could use either variant.

It could be that your production box is 5.1.29 or higher, and your dev box is pre-5.1.29 and can therefore understand the options you are using, and the production box can't...

share|improve this answer
    
How strange! Server versions are identical: "5.1.41-3ubuntu12.10-log (Ubuntu)", but the old style my.cnf was working on dev but not prod. I've updated both my.cnf's, dev still works - just need to wait until I can restart prod to see if it works... Thanks for the pointer! –  aidan Oct 25 '11 at 9:25
    
The restart of the production server didn't work :( –  aidan Dec 13 '11 at 16:35
add comment

Can you be more specific on what is 'not working' Is it a system crash? A select not returning the right information? Tables not updating?

In general tools such as the:

explain statement (http://dev.mysql.com/doc/refman/5.0/en/explain.html)

show process list (http://dev.mysql.com/doc/refman/5.1/en/show-processlist.html)

general query log (http://dev.mysql.com/doc/refman/5.0/en/query-log.html)

are other avenues of investigation.

share|improve this answer
    
The slow-query log file just remains empty - like I never enabled it. I've updated my original question. –  aidan Oct 24 '11 at 15:32
add comment

Your Answer

 
discard

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.