buffer cache hit ratio. LIO vs PIO
I came across a post on AskTom that seemed to contradict everything I've been told or read about tuning the buffer cache hit ratio and reducing Physical IO by aiming to get all queries satisfied by reading the blocks in the buffers.
The article quotes a paper by Cary Millsap of Hotsos, and is titled "Why a 99%+ Database Buffer Cache Hit Ratio is NOT OK".
Whats your view on LIP vs PIO and exactly what should we look for when tuning memory?
Re: buffer cache hit ratio. LIO vs PIO
Quote:
Originally posted by JMac
I came across a post on AskTom that seemed to contradict everything I've been told or read about tuning the buffer cache hit ratio and reducing Physical IO by aiming to get all queries satisfied by reading the blocks in the buffers.
Whats your view on LIP vs PIO and exactly what should we look for when tuning memory?
Wass wrong in that link???????
wont reducing ur LIO reduce ur PIO (most often than not it will)..
U shud look for ur CONSISTENT/DB BLOCK gets and reduce as much as possible..
Re: buffer cache hit ratio. LIO vs PIO
Further thoughts - I don't want to pick on you particularly JMac, but your post is revealing:
Quote:
Originally posted by JMac
. . . tuning the buffer cache hit ratio . . . .
. . . . what should we look for when tuning memory?
I think this emphasises how easy it is to get away from the real objective. I don't want to do either of the above, I want to "maximise throughput" or "minimise response time" or something similar which relates to business efficiency. No user will congratulate you on keeping the hit ratio above 95%!
Frankly, I didn't realise 100% what I was doing when I looked at "I/O Work" in my previous. Almost by accident I stumbled upon a rule which says: if you are going to look at hit ratios or parse/execute ratios etc, you'd be advised to write down some kind of short-hand which relates them to your real objective.
(Climbs down off soap-box.)
Buffer cache hit ratio.....
When I was being taught Oracle 9i(OCP) our Instructor made the point that if buffer cache hit ratio should be at the acceptable level of 95%, and if it fell below 95% to add more ram(tuning). All but 1 article that I have read on the subject, and outside books(2) that I have said the same thing, "when buffer cache hit ratio falls below 95% throw more ram(tuning) at it until it rises back up to 95%.
I truely understand that some of you strongly suggest that we(newbies) RTM, but when we read the manual, and it says the same thing, I feel that I have been cornered into asking you folks for assistance.
As mentioned earlier in this post (All but 1 article that I have read on the subject) it only touched on design, it did not get real in depth about it.
I throw in with JMac on this one, what should a DBA tasked with buffer cache hit ratio look for in this matter?
Rick
Re: Buffer cache hit ratio.....
Quote:
Originally posted by Alchemy
When I was being taught Oracle 9i(OCP) our Instructor made the point that if buffer cache hit ratio should be at the acceptable level of 95%, and if it fell below 95% to add more ram(tuning). All but 1 article that I have read on the subject, and outside books(2) that I have said the same thing, "when buffer cache hit ratio falls below 95% throw more ram(tuning) at it until it rises back up to 95%.
I truely understand that some of you strongly suggest that we(newbies) RTM, but when we read the manual, and it says the same thing, I feel that I have been cornered into asking you folks for assistance.
As mentioned earlier in this post (All but 1 article that I have read on the subject) it only touched on design, it did not get real in depth about it.
I throw in with JMac on this one, what should a DBA tasked with buffer cache hit ratio look for in this matter?
Rick
You can use the cache advisor to indicate the effectiveness of allocating or deallocating RAM to buffer cache.
Long story short, the sources you quote were wrong. If you are tasked with improving buffer cache hit ratio, just run some badly designed sql over and over again, thus increasing LIO's and herdly touching PIO's. That tells you all you need to know about how meaningful the ratio is.
Re: Re: Buffer cache hit ratio.....
Quote:
Originally posted by slimdave
just run some badly designed sql over and over again, thus increasing LIO's and herdly touching PIO's. That tells you all you need to know about how meaningful the ratio is.
Why not tell Hit Ratio as CRAP :rolleyes: :rolleyes:
Abhay.
Re: Re: Re: Buffer cache hit ratio.....
Quote:
Originally posted by abhaysk
Why not tell Hit Ratio as CRAP :rolleyes: :rolleyes:
But it's not! It's just one of many "tools" that you can use to judge if your db is healthy - you need to understand its usefulness and its limitations in the context of your db.
Re: Buffer cache hit ratio.....
Quote:
Originally posted by Alchemy
When I was being taught Oracle 9i(OCP) our Instructor made the point that if buffer cache hit ratio should be at the acceptable level of 95%, and if it fell below 95% to add more ram(tuning). All but 1 article that I have read on the subject, and outside books(2) that I have said the same thing, "when buffer cache hit ratio falls below 95% throw more ram(tuning) at it until it rises back up to 95%.
A generalisation and therefore false! HOWEVER in some proportion of cases, it might be a cost-effective solution: memory is cheap and consultants are expensive.
The proper solution is expensive because it requires someone to think about it:
a) Is there a problem?
A low hit ratio in itself is NOT a problem. (A few times per day, I have hit ratios around 20% for a few minutes when a user selects customers according to some ad-hoc profile. We made a conscious decision NOT to add a vast numbers of indexes to cover all eventualities, so most of these selections are FTS. Getting a customised client list in two minutes is very acceptable to the end-user - it would take 24hrs if he asked me to do it).
b) Why has the ratio changed?
c) Does it matter?
d) Should I fix it?
e) Can I fix it?
These may take weeks to answer. But these answers are the only valid ones.
Re: Re: Re: Re: Buffer cache hit ratio.....
Quote:
Originally posted by DaPi
But it's not! It's just one of many "tools" that you can use to judge if your db is healthy - you need to understand its usefulness and its limitations in the context of your db.
Ok, lets see how use full might be that * HIT Ratio *..
Case 1 :
Ratio > 95+
* Some argue that u gotta bad sqls where in ur LIOs shooting up so much that u cannot see the PIOs to be significant..
* But it can as well be some thing like ALL SQL perfectly tuned and ther isnt any crap requirement by which LIOs will have shoot up ... and yes now u can say HIT is perfect and u can be happy..
So with this u really cannot make anything unless u know what SQL are running and r they tuned and so many with respect to SQL.
Case 2 :
Ratio < 75-
* Some may argue that u have a balance between PIO/LIO and assume all SQL tuned one.
* Contradictory to it will be, there are very simple requirements (SQLs) and its codeded in such a fashion its worst ( BAD sqls ) and ofen reading data from files...
So with this as well u really cannot make anything unless u know what SQL are running and r they tuned and so many with respect to SQL.
So, why bother on HIT Ratio and just start looking for BAD SQLs and every one will be happy !
Abhay.
Re: Re: Re: Re: Re: Buffer cache hit ratio.....
Quote:
Originally posted by abhaysk
So, why bother on HIT Ratio and just start looking for BAD SQLs and every one will be happy !
Ah, but WHEN do you look for BAD SQL? Possible answers:
a) when someone complains
b) when the hit ratio changes unexpectedly
To my mind it's like a doctor using a thermometer: if the patient's temperature is normal, it doesn't necessarily mean he/she is in good health; if it is abnormal, better find out why.
On p11 of Millsap's article, he describes the hit ratio as "unreliable" - by his definition the doctor's thermometer is "unreliable" too. Would you expect doctors to stop using thermometers?
What would you think of a doctor who:
a) never used a thermometer?
b) never used anything but a thermometer?
Re: Re: Re: Re: Re: Re: Buffer cache hit ratio.....
Quote:
Originally posted by DaPi
Ah, but WHEN do you look for BAD SQL? Possible answers:
a) when someone complains
b) when the hit ratio changes unexpectedly
To my mind it's like a doctor using a thermometer: if the patient's temperature is normal, it doesn't necessarily mean he/she is in good health; if it is abnormal, better find out why.
On p11 of Millsap's article, he describes the hit ratio as "unreliable" - by his definition the doctor's thermometer is "unreliable" too. Would you expect doctors to stop using thermometers?
Well the things (Ratio Vs Thermometer) u r trying relate will be meaningless...
Lets consider one by one cases..
1) Thermo shows too high value than the normal 98 F Vs Ratio Showing more than 98+
Conlusion from Thermo : Person is suerly not in good health.
Conclusion from Ration : Can u make?? ( coz it can be any may be good if all sqls running are good and no stupid requirements and also may not be good if bad sqls running )
2) Thermo shows normal value i.e 98 F Vs Ratio Showing 90 to 93.
Conlusion from Thermo : Person may or may not be in good health.
Conclusion from Ration : Can u make?? (here the ans being same).
3) Thermo shows too less value than the normal 98 F Vs Ratio Showing too less than 80 may be between (50 to 70)
Conlusion from Thermo : Person is suerly not in good health.
Conclusion from Ration : Can u make?? (here the ans being same).
Conclusion from above 3 : 2 out 3 cases for Thermo, u can be sure that something is wrong, but 0 out of 3 cases u are not sure that some thing is wrong/right ( Plainly by seeing Ratio ).
So can u realy corelate?
Yes ofcourse the second point u made ( drastic change in Hit Ratio is a very valid point, but with also u cannot be sure )..
as far as the quote
Quote:
What would you think of a doctor who:
a) never used a thermometer?
b) never used anything but a thermometer?
is concerned, both are CRAP !!
I see u r big fan of * Hit Ratio * ;) ;)
Abhay.