June 19, 2013

Post: Optimizing slow web pages with mk-query-digest

mk-query-digest to list me top slowest queries, I asked it to list me top slowest sessions: mk-query-digest –group-by=Thread_id –order-by=Query… 0 0 0 0 0 # Tmp tables 0 15 0 1 0.03 0 0.17 0 # Tmp disk tbl 0… way, unfortunately mk-log-player will not have all the other useful information, not even query timing. Instead, I’ve used mk-query-digest: mk-query-digest –filter…

Post: Maatkit's mk-query-digest filters

… 3s 26us 69us 3ms 0 # Rows sent 9.80M 0 1.05M 3.50 0.99 642.32 0 # Rows examine… kind of messes up the whole mk-query-digest output. There’s a simple solution to that though — mk-query-digest –filter. With just a small change it will completely ignore administrator commands: mk-query-digest –filter=’$event->{arg} !~ m…

Post: mk-query-digest, query comments and the query cache

… binary log and the slow query log. Maatkit includes tools which interact with these logs, including mk-query-digest. This tool, in particular, has… Apache logs. select 1 — File: myfile.php Line: 25 Function: myFunc SessionID: a1b2c3d4e5f6a7b8c9d0aef UserID: swany78 Notice that the query ends with a…

Post: How to generate per-database traffic statistics using mk-query-digest

… Maatkit. There is an often-ignored gem in Maatkit’s mk-query-digest, and that is the –group-by argument. This can be… perldoc). %> perl mk-query-digest –limit 100% –group-by db slow.log … # Rank Query ID Response time Calls R/Call Item # ==== ======== ============= ===== ====== ==== # 1 0x 6000 60…

Post: What do we optimize with mk-query-digest ?

… at mk-query-digest report we typically look at the Queries causing the most impact (sum of the query execution times) as well as queries having…, table locks all could cause query response time to be unreasonable. If Slowest query is not interactive query, for example part of a….000, 20.000 and even more queries to generate. In such cases even with queries taking 1 ms in average you’re looking…

Post: Gathering queries from a server with Maatkit and tcpdump

…: mk-query-digest –type=tcpdump –report-format=profile tcpdump.out # Rank Query ID Response time Calls R/Call Item # ==== ================== ================ ======= ========== ==== # 1 0x088084BF139954D8 0.1009 90.2% 1… suppose that one query was that took a tenth of a second? We can find out. mk-query-digest –type=tcpdump –limit 1 tcpdump.out…

Comment: Maatkit Now Supports Memcached

I have root@lb2:~# ./mk-query-digest –type memcached memc_tcpdump.txt # mk_query_digest:6381 6920 Use of uninitialized value in string eq at ./mk-query-digest line 5363, chunk 1. # # mk_query_digest:6381 6920 Use of uninitialized value in string eq at ./mk-query-digest line 5363, chunk 2. #

Post: Slow Query Log analyzes tools

…. First – it only allows you to set slow query time in seconds, having 1 second minimum value. For most of interactive applications… be slowest queriesquery taking 10ms and run 1.000 times per second puts more load on server than 10 seconds query running once… slow query log format as well. Update 2009-03-04: most of us at Percona now use mk-query-digest from Maatkit for slow query

Post: How to use tcpdump on very busy hosts

… “mk-query-digest –filter ‘$event->{time} && $event->{time} > 1‘” to exclude all queries which it believes took longer than the servers long-query-time of 1 second… TERM EXIT # digest the result, copy to localhost, then email it ssh $REMOTEHOST — “mk-query-digest –type tcpdump –limit $LIMIT < $TMP/$TMPfile 2>&1 > $TMP…

Post: Maatkit Now Supports Memcached

… out the most expensive ones. Here’s the top one: # Query 1: 7.06 QPS, 0.04x concurrency, ID 0x7AFBE9433477C7BC at byte… with mk-query-digest Ponder the results, or consider a different –report option In code: wget http://maatkit.googlecode.com/svn/trunk/mk-query-digest/mk-query-digest sudo tcpdump -s 65535 -x -n -q -tttt -i eth0 port 11211 > memc_tcpdump.txt mk-query-digest –type memcached…