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 would like to know if there is anyway I can display the most frequent sql requests onmy mysql server in order to memcache it.

Thanks !

share|improve this question
    
? But MySQL already caches: dev.mysql.com/doc/refman/5.1/en/query-cache.html –  symcbean Sep 30 '10 at 14:29
    
It does but it's still slower than memcached –  mnml Sep 30 '10 at 15:24
add comment

4 Answers 4

up vote 1 down vote accepted

You have to enable query logging or you should monitor it trough show processlist; Please see the documentation:

http://dev.mysql.com/doc/refman/5.1/en/show-processlist.html

If you pick up the parameters right you can see the queries in the slow query log:

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

share|improve this answer
add comment

check mysqlsla - it can take your query log, parametrize queries and provide you report with query types that show up most often.

share|improve this answer
add comment

I'd suggest you set your slow query time to something very small, then run maatkit's mk-query-digest to profile all the logged queries. You may be able to run it on an ordinary log file as well.

There are other maatkit utilities that may be able to help too.

Innotop is a good way of watching what your server is up to - generally easier to keep an eye on than showing the processlist.

share|improve this answer
add comment

I've been working with the commercial software package Jet Profiler for MySQL http://www.jetprofiler.com/ and like it. It's about $400, though there's a trial period.

Otherwise, I log the SQL requests in my application. With Java (my language of choice) you can configure the JDBC Connector/J driver to log all sql requests. Then I do a mix of regexp and hand editing to make it readable and analyze the results.

share|improve this answer
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.