Identify slow query without slow query logs in mysql server -
i wondering there other way to check our slow queries without logging slow query. suppose, have highily busy server can't afford log save memory , i/os. then, there other way available check if have slow query? know, can profiling of query still not sure identify query 1 taking of time , memory.
just started mysql administration , not sure how handle this. guidance highly appreciated.
i find slow best source of bogging down server.
suggest start moderately high value of long_query_time. minimize i/o , disk space. fix queries finds, if can.
when have exhausted that, lower setting find more.
use pt-query-digest find "worst" queries.
keep in mind high value finds long queries, if rare. lower value find fast queries run frequently, , these may real villains.
another approach turn on slowlog briefly or during relatively idle time. find may still useful.
anecdote: in 1 system there query where
misformulated such running 100% cpu. one-line fix dropped cpu 2%.
another anecdote: particular query fast, running frequently. little bit of arithmetic said query should not have issued seen. query inside loop when have been outside loop.
back direction taking... could manually show processlist
see or running. tedious, , hit or miss. may catch both (1) slow, infrequent, queries, , (2) fast, frequent, queries.
if post show variables;
, show global status;
, check couple hundred formulas may lead more insight inefficiencies.
Comments
Post a Comment