ramblings about life and tech...  

Novembro, 16 2006
Quinta-feira

MySQL monitoring tools
In the last couple of weeks I've been feedling with MySQL, you know, that "not so serious database" as some people like to call it. ;-) I'm glad I did because I was not expecting that some days after, the server would be so hammered by a new feature in the portuguese version of Firefox 2. That particular site saw a 400% increment on it's daily none unique visits. Although that particular recuring request is cached, it can stress the database, and I'm not even mentioning some other couple of sites on the same server that are also growing it's daily visitors and use the same MySQL server, and share the same hard drive.

Anyway, I wanted to tweak MySQL because some weeks ago it was acting up on me, clogging all Apache processes, making them wait for it to respond. So i searched for some tools so i could monitor it, see what it was doing, when and why.

mytop - a life saver

I found about mytop some years ago but never got any use out of it because small sites don't even tickle a MySQL server and fast queries don't even showed up... till now.
I've been using mytop for the last couple of weeks and it's a life saver. Basicaly mytop is a console-based (non-gui) tool for monitoring the threads and overall performance of a MySQL just like top, the unix command line. It helped me understand exactly why MySQL was choking. mytop never got updated to handle MySQL 5, so if you are wondering why the command statistics aren't working, search the source code for she SHOW STATUS line and change it to this

Show me the graphs

Then I wanted some graphs. Sure, there's the awesome Cacti project with some nice monitoring templates (scrool down), but I wanted something simpler than Cacti (I've used it before).

For starters, there's a point and shoot graphing script here called mrtg-mysql-load. Brainless to install and obviousely it requires MRTG, wich probably everyone has allready installed. The output one gets is something like this...



Searching around for some more detailed graphs I found MySQL Activity Report.
The MySQL Activity Report package is a tool to help MySQL database administrators to collect several database parameters and variables. These collected values can be used for server monitoring or performance tuning purposes.
The instalation is trickier than mrtg-mysql-load, it envolves a daemon, but the end result is far better. A demo can be seen here.
Basicaly, it gives you a connections graph, a questions (select,insert,update...) graphs and some others, but best of all, if you have the server running for some time it also gives you some server tunning tips like...
The table cache hit rate is 98 %, while 99 % of your table cache is in use.
You should raize your table_cache to improve your server's performance.


For example, the connections graph looks like this...


On a related note I found two other tools, one for Apache called ApacheTop (guess what) and another called htop (top on steroids).

What do you use ? Wanna share ? :-)

ps: Looking at the graphs, it seems like MySQL went balistic around 13:00

Hora 16 Novembro 2006 - 23:51   Comentários 3 Comentário(s)   Technorati links   Linking posts

Notícias possivelmente relacionadas:
MySQL vai ser integrado no Visual Studio da Microsoft
IBM anuncia venda e suporte a produtos MySQL
Digidesign prepara o lançamento do Pro Tools 7.4
Sun compra MySQL
Sun compra MySQL por um milhão de dólares
Sun compra MySQL por mil milhões de dólares (corrigida)
Sun Microsystems compra MySQL por um bilião de dólares
Powered by Destakes


Comentários - Comentar ?

Lindo!
Belo post, de certeza que foi um life saver para muita gente amante do MySQL, para mim foi!
Muito obrigado, se houve alguma tool que me venha à ideia mais para a tarde (acabei de acordar) virei aqui postar.

Cumprimentos.

por David Negreira a 17 Novembro 2006 - 08:04

My 2c
O mysqldumpslow usado em conjunto com o explain parece-me ser a solução (em ambiente SAP a solução para performance também passa por sqltrace mais explain dos queries críticos). Sobre este tema, achei esta apresentação bem interessante:

http://video.google.com/videoplay?docid=2524524540025172110


por Pedro Lima a 17 Novembro 2006 - 10:10

A good blog about MySQL Performance
Check this out: http://www.mysqlperformanceblog.com/

Very good stuff in there.

Also, download mysql own tools and check the MySQL Administrator. It's the best way to test new ideas for graphs, and when you are happy with them, move them to MRTG.

And finaly, http://mysql.com/products/enterprise/advisors.html... This one will probably be a paid service, but worth checking out.

por Pedro Melo a 17 Novembro 2006 - 10:37


Blogmaster
moi Tem 32 anos, é natural de Vila Nova de Famalicão mas mora no Porto desde que veio para a universidade... bem, morou. Agora já casado, está pela Maia. Anda pela internet há já uns 12 anos tendo trabalhado em vários projectos como foram o caso do Mail.pt ou no Sapo. Nos tempos livres vai tendo tempo para fazer umas brincadeiras, entre as quais o ITJobs o Lusocast o Hispanocast ou o Destakes
De resto já bloga há uns 7 anos apesar de ter perdido parte da "vida" numa mudança de hosting provider. Algumas restias ainda por aí andam... ah, e o email de contacto está no footer.
Btw... job offers are welcome!

Feeds RSS
Posts
Posts + comentários
Twitter



Procurar...

Em movimento...
mais fotos...

Últimos comentários...
07 Set - sim, há
07 Set - Sm, há.
07 Set - Um Ano Depois....
29 Ago - Arbitro
26 Ago - tshirts cão azul...
26 Ago - apenas uma ideia!
22 Ago - Humm...?
21 Ago - Negócio
21 Ago - adsense... na mesma?
21 Ago - :\
21 Ago - Picar?
21 Ago - people vs phones


@celso for sure... hope they release an API for that :>
08, Sep - 02:09
god, google now has it's own freaking satellite
08, Sep - 01:09
The story behind Google Chrome - http://tinyurl.com/6bxgm7
08, Sep - 01:09
@celso wondering why the blog post still didn't "get in"
08, Sep - 01:09
wikisym starts at 8:30... give me a break :-(
08, Sep - 00:09
@suskind ou isso :)
07, Sep - 23:09
@ndantas isso é tão web 1.0... agora há galerias com thumbs ;)
07, Sep - 23:09
there's that linus/bill gates hollywood movie playing at that "mov" channel
07, Sep - 22:09


Arquivos...
Setembro 2008 (2)
Agosto 2008 (11)
Julho 2008 (17)
Junho 2008 (28)
Maio 2008 (17)
Abril 2008 (14)
Março 2008 (21)
Fevereiro 2008 (21)
Janeiro 2008 (33)
Dezembro 2007 (23)
Novembro 2007 (16)
Outubro 2007 (6)
Setembro 2007 (16)
Agosto 2007 (18)
Julho 2007 (17)
Junho 2007 (10)
Maio 2007 (30)
Abril 2007 (17)
Março 2007 (24)
Fevereiro 2007 (27)
Janeiro 2007 (20)
Dezembro 2006 (16)
Novembro 2006 (20)
Outubro 2006 (24)
Setembro 2006 (18)
Agosto 2006 (33)
Julho 2006 (30)
Junho 2006 (31)
Maio 2006 (17)
Abril 2006 (21)
Março 2006 (23)
Fevereiro 2006 (26)
Janeiro 2006 (38)
Dezembro 2005 (33)
Novembro 2005 (28)
Outubro 2005 (33)
Setembro 2005 (48)
Agosto 2005 (43)
Julho 2005 (35)
Junho 2005 (47)
Maio 2005 (37)
Abril 2005 (38)
Março 2005 (25)
Fevereiro 2005 (27)
Janeiro 2005 (35)
Dezembro 2004 (42)
Novembro 2004 (26)
Outubro 2004 (45)
Setembro 2004 (52)
Agosto 2004 (25)
Julho 2004 (53)
Junho 2004 (55)
Maio 2004 (60)
Abril 2004 (46)
Março 2004 (65)
Fevereiro 2004 (45)
Janeiro 2004 (68)
Dezembro 2003 (68)
Novembro 2003 (59)
Outubro 2003 (67)
Setembro 2003 (46)
Agosto 2003 (31)
Julho 2003 (36)

Aqui ao lado...
Pedro Figueiredo
Pedro Melo
Celso Martinho
Sérgio Carvalho
Rui Carmo
Nuno Loureiro
Maria João Nogueira
Filipe Miguel Tavares
Bruno Pedro
Ricardo
Nuno Mariz
Vitor Magalhães
Carlos Duarte
Mário Lopes

Procurar...



 

 


 

não chateiem com os erros de Português... "the bad spelling is part of the charm". ;-)
escusado será dizer que as opiniões aqui expressas são minhas e só minhas, e não de outros ou da empresa onde trabalho
qualquer outro bitaite... ramblings at karlus.net
não, não é powered by MovableType ou Wordpress, é powered by código meu em PHP

O conteúdo deste site não poderá ser utilizado sem a sua autorização expressa.
As imagens nele contidas são propriedade dos respectivos autores.