您的位置:首页 > 其它

性能诊断与调优之OWI--OverView

2012-06-07 17:17 267 查看
最近在学习关于Oracle调优方面的知识,正在阅读

<<Oracle Wait Interface: A Practical Guide to Performance Diagnostics & Tuning>>,

这本书以一种独到的见解论述了性能调优的知识。

Oracle Wait Interface (OWI) to help DBAs quickly and effectively diagnose

performance problems

The old school teaches DBAs to identify and tune SQL statements that
consume a lot of CPU,
use a

lot of buffers, or
make a lot of physical I/O calls, because they are a threat to performance and

therefore must be eliminated. What is wrong with this concept? It has no regard for bottlenecks and

response time. When you judge a SQL statement based on its resource consumption alone, you will

not be able to forecast the improvement or the return on your tuning effort because the time element

is missing. You can’t tell how much faster a process will run after you reduce the level of resource

consumption because you don’t know what impact the level of consumption has on the process in

terms of processing time. You may tune your heart out and still not make a dent in the process

response time. With OWI, however, you know what impact each bottleneck has on processing time

because every bottleneck is timed. When a bottleneck is removed, the process can potentially run

that much faster.

我对这段话的理解:早期的DBA在进行性能调优时只注重消耗了多少的CPU,读取了多少buffer,进行了多少次的物理I/O,

而不注重造成性能瓶颈的响应时间,即使在 对这些资源消耗作出了调整后,也不清楚能够提升多大的性能,因为这些都不能够

量化。而OWI则能够知道影响每一个瓶颈的响应时间,相应的解决了这些瓶颈,就能够运行得更快。

Furthermore, a statement may rank No.1 on CPU used, buffer gets, or I/O calls, but the process that

it belongs to may spend the majority of its time on a certain bottleneck that, when removed or

reduced, could yield a far greater performance gain than what could be realized by reducing the level

of resource consumption. For example, you may reduce your car’s gasoline consumption by ensuring

that the engine is properly tuned, but that doesn’t necessarily guarantee that you will get to your next

destination any faster, especially if you are behind a school bus.

减少资源的消耗并不能够保证能够带来性能的提升。我对他这个例子进行了延伸:比如一个人开车从一个地方出发到达一个

目的地,他花了很长时间,如果你发现他花了很多的油,跑了很多的路程,你认为他绕远了,可以通过减少路程来减小时间的消耗,

其实不然,当选择了一个近道的路线,而这条路线车流量特别大,而且红绿灯特别多,那这样反而消耗更多的时间。

所以这样通过降低资源的消耗并不一定能解决性能问题,而要真正找到这个性能问题的瓶颈,缩短这个响应时间,才能达到性能优化

的目的。

OWI plays a significant role in determining the database response time. The database response time

consists of the “service time” and “wait time” as follows:

Response Time = ServiceTime + WaitTime

The service time is the amount of time a process spends on the CPU. The wait time is the amount of

time a process waits for specific resources to be available before continuing with processing.
This

formula is based on the notion that at any point, a process is either actively servicing a request on the

CPU or is off the CPU and in a wait state. You can improve database response time by shortening

the service time, the wait time, or both. This is not hard to understand as you also practice this

formula in your daily chores. Take your last trip to the grocery store. When you were getting ready

to pay, your checkout response time was how long you had to wait in line plus how fast the clerk

scanned your items. You normally get bad checkout response time if you shop during peak hours

(high wait time), or if you are unlucky enough to get a rookie clerk who needs to look up the code

numbers on most of your produce purchases (high service time). So you improve your checkout

response time by shopping during off hours (low wait time) and picking an experienced clerk with

whom you are familiar (low service time).

数据库的响应时间=进程消耗CPU的时间+等待时间

OWI是如何在决定数据库的响应时间中扮演着一个重要的角色的,继续学习中。。。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: