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'm trying to use mytop for figuring out what queries are being executed and how long they take. I can connect properly to the db but

MySQL on localhost (5.1.41-3ubuntu12.8)                 up 0+01:50:47 [09:30:43]
Queries: 3.0     qps:    0 Slow:     0.0         Se/In/Up/De(%):    68767/00/00/00

Key Efficiency: 99.1%  Bps in/out:   0.0/  1.2

        Id      User         Host/IP         DB      Time    Cmd Query or State
        --      ----         -------         --      ----    --- --------------
       225      root       localhost                    0  Query show full processlist
       186      joom       localhost   culinary      5684  Sleep

The number of queries increases over time but the queries themselves do not appear in the list. Is there some type of configuration that I need to do to enable it?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

mytop can only show the queries that are executing at the moment that it samples--much like top can only show information about processes at the time it checks. You can adjust the sampling rate with the 's' key or hit the space bar to force an update.

(I wrote mytop.)

share|improve this answer

Possible queries are executed too quickly(default delay 5 second,to change press 's')

Run in MySQL:

mysql> SELECT SLEEP(100);

Then see mytop output.

share|improve this answer
    
Thanks. It seems I misunderstood the use of mytop. I guess the question should be, is there a tool that can let me monitor queries in realtime? –  recluze Feb 10 '11 at 7:32
    
mytop monitor queries in realtime wiht delay... SHOW PROCESSLIST monitor queries in realtime...General Query Log monitor all queries in file. –  alvosu Feb 10 '11 at 7:35

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.