Wednesday, March 19, 2008

The tool I?ve been waiting for years

I've just been pointed to the nice tool which I was waiting for years to see. It is fincore - little perl script which allows you to see what pages of file are cached in OS memory. This is really cool.
When it comes to MySQL it is very useful with MyISAM tables which has their data file cached by OS cache only so you do not have any good information from MySQL side on what data is cached. You can also use it with Innodb to see how much memory are you wasting with double buffering by not using of O_DIRECT.
Besides general clues such as 50% of my file is cached you should watch for dynamics - for example check it during backup process and compare it due to normal load - this can give you a clue if slow down happens because of extra IO pressure or just because pages were washed out. You can also check how pages are cached. For example every second page cached may be helpful for point queries but does not save a lot of IO for doing table scans.
One thing I'm still missing is looking it from another side - so I have say 10GB of OS cache used on the server but how can I tell what is using it ? This look from another side would help me dramatically to find out what is causing cache pressure and what needs to be worked on. Scanning all files on filesystem and checking which are cached obviously does not work.
The fincore looks more like proof of concept tool - it is a bit simplistic, however being written in Perl it is easily hackable - if you want to make it to print percentage of file cached or "graph" showing how cached pages are distributed among file is very easy.
The great thing about this tool it is very fast and it does not disturbs OS file cache by using mincore function to get pages which are currently in cache.
This function is actually the real meat here - the tool is simplistic but it shows how to use the function so you can write real stuff. For example using this tool MySQL can easily add amount of cached data per table for MyISAM and Archive tables to INFORMATION_SCHEMA (or other system tables) which would be really cool Of course than one would need to implement cache content tracking for storage engines which cache everything in their own cache memory - Innodb, Falcon, Maria.
Having information about how large portion of table is cached would allow optimizer to take much smarter decisions in many cases.
Lets now see some examples:
PLAIN TEXT
SQL:
  1. [FONT='Courier New', Courier, monospace][root@DB01 mysql]# du -h ib_log*[/font]
  2. [FONT='Courier New', Courier, monospace]257M ib_logfile0[/font]
  3. [FONT='Courier New', Courier, monospace]257M ib_logfile1[/font]
  4. [FONT='Courier New', Courier, monospace][root@DB01 mysql]# perl /tmp/fincore --justsummarize ib_logfile0 ib_logfile1[/font]
  5. [FONT='Courier New', Courier, monospace]page size: 4096 bytes[/font]
  6. [FONT='Courier New', Courier, monospace]24141 pages, 94.3 Mbytes IN core FOR 2 files; 12070.50 pages, 47.2 Mbytes per file.[/font]
  7. [FONT='Courier New', Courier, monospace][root@DB01 mysql]# perl /tmp/fincore --justsummarize ib_logfile0[/font]
  8. [FONT='Courier New', Courier, monospace]page size: 4096 bytes[/font]
  9. [FONT='Courier New', Courier, monospace]1 page, 4.0 kbytes IN core FOR 1 file; 1.00 page, 4.0 kbytes per file.[/font]
  10. [FONT='Courier New', Courier, monospace][root@DB01 mysql]# perl /tmp/fincore --justsummarize ib_logfile1[/font]
  11. [FONT='Courier New', Courier, monospace]page size: 4096 bytes[/font]
  12. [FONT='Courier New', Courier, monospace]24169 pages, 94.4 Mbytes IN core FOR 1 file; 24169.00 pages, 94.4 Mbytes per file. [/font]



So we can see one of Innodb log files is practically uncached while other has about 1/3rd cached - this makes sense, perhaps second log file is being written now and there is a "tail" of pages which just were not removed from the cache yet. As Innodb does not read logfile unless in recovery these are waste and Innodb could use fadvice to give instruction to kernel not to cache these as long as it can't perform direct IO to log files on Linux because it is not aligned.
PLAIN TEXT
SQL:
  1. [FONT='Courier New', Courier, monospace][root@DB01 mysql]# du -h ibdata*[/font]
  2. [FONT='Courier New', Courier, monospace]246G ibdata1[/font]
  3. [FONT='Courier New', Courier, monospace][root@DB01 mysql]# perl /tmp/fincore --justsummarize ibdata1[/font]
  4. [FONT='Courier New', Courier, monospace]page size: 4096 bytes[/font]
  5. [FONT='Courier New', Courier, monospace]0 pages, 0.0 bytes IN core FOR 1 file; 0.00 pages, 0.0 bytes per file. [/font]



Out of 250GB innodb data file none of pages are in cache - this is because this instance is using O_DIRECT flag to bypass data buffering and we can well see it works.
Lets now see stats for MyISAM tables:
PLAIN TEXT
SQL:
  1. [FONT='Courier New', Courier, monospace][root@DB01 logs]# du -h performance_log_080318.MYD[/font]
  2. [FONT='Courier New', Courier, monospace]1.1G performance_log_080318.MYD[/font]
  3. [FONT='Courier New', Courier, monospace][root@DB01 logs]# perl /tmp/fincore --justsummarize performance_log_080318.MYD[/font]
  4. [FONT='Courier New', Courier, monospace]page size: 4096 bytes[/font]
  5. [FONT='Courier New', Courier, monospace]497 pages, 1.9 Mbytes IN core FOR 1 file; 497.00 pages, 1.9 Mbytes per file.[/font]
  6. [FONT='Courier New', Courier, monospace] [/font]
  7. [FONT='Courier New', Courier, monospace][root@DB01 logs]# du -h performance_log_080319.MYD[/font]
  8. [FONT='Courier New', Courier, monospace]229M performance_log_080319.MYD[/font]
  9. [FONT='Courier New', Courier, monospace][root@DB01 logs]# perl /tmp/fincore --justsummarize performance_log_080319.MYD[/font]
  10. [FONT='Courier New', Courier, monospace]page size: 4096 bytes[/font]
  11. [FONT='Courier New', Courier, monospace]28415 pages, 111.0 Mbytes IN core FOR 1 file; 28415.00 pages, 111.0 Mbytes per file.[/font]
  12. [FONT='Courier New', Courier, monospace][root@DB01 logs]# [/font]



The performance log for yesterday is almost out of cache. It is about 0:50 by server clock this is why we still can see some pages remaining. Today log file is 50% in cache. Knowing access pattern to the file you can draw some conclusions about how much IO pressure we have on this server.
P.S If you would hack this tool or know any similar tools please let me know.
Entry posted by peter | No comment
Add to: | | | |


The tool I?ve been waiting for years - Read More...

Distance Learning and University Effectiveness: Changing Educational Paradigms for Online Learning

Distance Learning and University Effectiveness: Changing Educational Paradigms for Online Learning

Category: Study
<< Buy This Book on Amazon >>
Read more

Microsoft Windows PowerShell Scripting Guide DEC 2007 eBook-UnderPl

Microsoft Windows PowerShell Scripting Guide DEC 2007 eBook-UnderPl

Category: Technical
Tag: Operating System
<< Buy This Book on Amazon >>
Read more

Turn $6 into $1,000s as seen on Oprah and 20/20

Make 15k in 30 Days!!!! As seen on Oprah
and 20/20!!!
That's Right 15,000 dollars in your PayPal account - That's all it takes...
FIRST, PRINT THIS OUT TO FOLLOW INSTRUCTIONS EASIER!
. PAYPAL MAGIC!!!
. TURN $6.00 INTO $15,000 IN ONLY 30 DAYS...HERES HOW!
This is Not a Scam!!!
How to Turn $6.00 into $15,000 in 30 Days with PayPal.
AS SEEN ON OPRAH!!
PAYPAL VERIFIES THAT THIS $6 INVESTMENT
IS 100% LEGAL AND IS A BIG HIT THIS YEAR
SEE THEIR NOTE BELOW OR ASK THEM DIRECTLY...
THIS MIGHT TAKE 15-30 MINUTES AND JUST $6,
BUT IT IS 100% WORTH IT TO MAKE THOUSANDS SO
QUICKLY.
From PayPal:
"Dear Member, it has come to our attention that there
is a PayPal scheme floating around at the moment you
may have heard or seen the $6 scheme. You may have
even taken part in it well we have been asked a lot of
questions about this scheme the answer is yes it does
work and yes it is safe to use providing you follow the
rules it is legal and has made a big hit on the internet
this year. If you would like to take part in this scheme
or would like a bit more information then please see the
attached file that was kindly donated to us. Thank you for
using PayPal!" This Really Works Keep in mind that everything stated below is 100% legal as stated by the U.S. Post Office (1-800-725-2161).

Now honestly,what is six Dollars, especially out of a Paypal account. In exchange
you will make thousands in the first few months. You then place your own name and email address in the bottom of the list at #6, and post the article in at least 200 newsgroups. (There are thousands of
newsgroups)

I sent out my measly $6.00 to the six people on the list. Within 7 days, I started: getting $$$$$ in my account!
I was shocked! I figured it would end soon, but the CASH just kept coming in. In my first week, I made about $25.00.By the end of the second week I had made a total of over $1,000.00! In the third week I had over $15,060.00 and it's still growing.This is now my fourth week and I have made a total of just over $26,000.00 and it's still coming in rapidly. It's certainly worth $6.00 and 6 minutes to send it out. This program WORKS. Put in message boards or send as emails.
INSTRUCTIONS
1. Login to PayPal and click the "Send Money" tab near top of
screen
In the "Recipient's Email" field type: the email address
In the "Amount" field type: "1" (your $1.00 payment)
In the "Category" field select: "Service" (Keeping it
legal)
In the "subject" field type: "EMAIL LIST",
In the "message" field type: "PLEASE PUT ME ON YOUR EMAIL LIST".
Finally, click on the "Continue" button to complete the payment.
Repeat these steps for each of the 6 email addresses. that's it!
Below are the emails that you transfer the money into:
Paypal accounts to send 1 Dollar to:
The Email List:

1. linkatam@yahoo.com
2. Jcmabrey85@aol.com
3. skgates30@yahoo.com
4. rickreineke@hotmail.com
5. hawki336@hughes.net
6. Shandriver2003@yahoo.com


2.After sending the money to the first 6 people on the list, you can
remove the name next to the #1 on the list and move the rest of the
names up one position (#2 becomes #1, #3 becomes #2, etc?) Then place
your name in the #6 position. Then save it.
3. When you have completed the instructions, take this letter and then
go to (Google, Yahoo,...) and type in (Making Money Message board, Money Message Board, Money
Forum, Free money Forum, or anything along those lines that are forums)
and start posting your copy of this message at least 200 times, to as
many unique message boards as you can, or more. The more times you post
this at a unique board, the more money you will make.
Keep a copy of this letter so you can use it a second time.
Remember, play FAIRLY and HONESTLY and this will work.
4. This program remains successful because of the honesty and integrity
of the participants. Please continue its success by carefully adhering
to the instructions.
5.This is perfectly legal! If you have any doubts, refer to 18 Sec.
1302 & 1241 of the Postal Lottery laws.
You can try this or buy another lottery ticket and see which pays first. It's up to you!
[[[ IMPORTANT NOTE: If you can not see full email addresses (this
happens on some web-based groups), just click on the link that appears
near the @ symbol of any email address above. This will take you to a
page for you to verify that you're human and then it takes you back to
this message finally revealing the full email addresses. ]]]

vagas - Atento contrata para Comunicação Interna na

São Paulo/SP (Chácara Santo Antonio) - Atento contrata para sua área de Comunicação Interna:

Analista de Comunicação Interna e Endomarketing Sênior
  • Formação: Comunicação (RELAÇÕES PÚBLICAS/Jornalismo/ Publicidade e Propaganda)
  • Experiência mínima: 4 ano de experiência na área de Comunicação Interna em agência e/ou corporações, com forte atuação na parte de atendimento e captação de briefing. Será responsável pelo atendimento e desenvolvimento de iniciativas de comunicação em áreas pré- determinadas, onde atuará como ponto focal de relacionamento entre estes departamentos e a Diretoria de Comunicação e Marca.
  • Idioma: Inglês ou espanhol avançados
Atividades:
  • Atendimento, captação de briefing e desenvolvimento de atividades de comunicação junto às áreas mencionadas acima, estabelecendo relacionamento de parceria e posicionando-se como consultor de comunicação, oferecendo soluções que atinjam e superem as expectativas do cliente interno.
  • Produzirá textos, revisará conteúdo e layout produzidos pela agência que atende a Atento,
  • Fará interface com fornecedores que atendam à área, bem como interagirá com os demais profissionais de toda a Diretoria de Comunicação e Marca, em especial os Analistas de atendimento de Comunicação Institucional e de Comunicação Interna.
  • Atuará como líder de projeto no que realizar, tocando a iniciativa do começo ao final, atentando para atividades que precisarão ser desempenhadas com profissionais de outras áreas da empresa e aspectos administrativos comuns à rotina de uma corporação.
  • Deverá fazer pesquisas e relatórios do que desenvolver para acompanhamento da gestão da área.

Gestor de Comunicação Interna e Endomarketing
  • Formação: Comunicação (RELAÇÕES PÚBLICAS/Jornalismo)
  • Experiência mínima: 5 anos de experiência na área de Comunicação em agências e/ou corporações, sendo pelo menos 2 anos como Gestor de Pessoas. É imprescindível o conhecimento técnico sobre ferramentas de comunicação interna, ações de endomarketing, relacionamento entre áreas e campanhas institucionais.
  • Faz-se fundamental texto impecável, pois todo o conteúdo produzido pela área e pela empresa passará pela revisão deste profissional.
  • Idioma: Inglês ou espanhol fluentes - preferencialmente espanhol.
Atividades:
  • Condução de todas as ações da equipe mencionada, atendimento às demais áreas da empresa, eventual produção de textos, contínua edição e revisão de textos, interface com agência de design, produtora e demais fornecedores da área, produção de textos em espanhol ou inglês, gerenciamento de relatórios da área para apresentação à gerência e direção da empresa, bem como reporte à Espanha.
  • Manutenção e oferecimento de novas soluções de comunicação às áreas atendidas, bem como à própria área de Comunicação Interna e Endomarketing.
  • O principal desafio deste profissional será integrar as atividades da equipe às dos demais funcionários que atuarão diretamente com a gerência da área, potencializando a qualidade do trabalho oferecido à empresa.
Para ambas vagas, o horário de trabalho é das 09h00 às 18h00, segunda à sexta-feira.

Os currículos deverão ser encaminhados para fabiana.clemente@atento.com.br.

(Via Link Zero)

Windows Vista Home Networking Oct 2007 eBook-BBL

Windows Vista Home Networking Oct 2007 eBook-BBL

Category: Technical
Tag: Operating System
<< Buy This Book on Amazon >>
Read more

Rising above the NOISE: Using targeted web portals to turbo charge your lead nurturing programs

You have a huge pile of leads... from prospects who have expressed interest, but aren't ready to buy. You know they will buy eventually so you work on nurturing their interest, educating them on your...

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Transparency in Marketing ROI

I will admit that I though I strongly believe in accountability and feel I am a good enough marketer that my work speaks for itself, I am not always comfortable with having bright lights shone on...

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Marketing Matters Live is now Marketing News Radio

This month the AMA is changing the name of its three year old radio program from Marketing Matters Live to Marketing News Radio. (I have to admit, the name similarity to one of the best situational...

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Cutco Cutlery and the All-Important Summer Job

In today's competitive job market, college kids have got to use every advantage to make themselves stand out from the crowd. If you think it's hard to land a job as a fully-qualified professional,...

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Non Profit Marketing Not Small Potatoes

Today we took a look at the other side of the marketing aisle…that is we departed from our regular focus on for-profit marketing to our friends in the non-profit world. The reason is that...

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Gadgets, Gizmos, and Great Tech Ideas for Marketers

Today's companies depend on deeper and more relevant customer connections to drive loyalty, retention, referrals and increased buying activity within their coveted customer base. These companies...

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]

On Demand Communications -- Sales and Marketing Alignment

Today we kicked the radio portion of the AMA's Marketing and Sales Alignment Forum. So we took on the prennial discussion of marketing and sales – a topic that just seems to get hotter and hotter....

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]