Oracle V $ OSSTAT

The Oracle V $ OSSTAT view contains several operational statistics, including:

  • IDLE_TICKS The number of hundredths of a second during which the processor has been idle, for all processors in total.
  • BUSY_TICKS The number of hundredths of a second when the processor is busy executing user or kernel code, summed across all processors.

The documentation I read is unclear as to whether they are ever reset. Somebody knows?

Another question I have is that I would like to calculate the average CPU load experienced by the system. For this, I expect that I need to go:

busy_ticks / (idle_ticks + busy_ticks)

Is it correct?

November 08 Update

Oracle 10g r2 includes a stat table called LOAD in the table. It provides the current load of the machine at the time of reading the value. This is much better than using other information, since * _ticks "starting from instance start" data does not apply to the current point in time.

+3
source share
5 answers

You will need to specify "IOWAIT_TICKS" if available.

IDLE_TICKS - The number of hundredths of a second, the processor is idle, the total number of all processors

BUSY_TICKS - the number of hundredths of a second that the processor is busy executing user or kernel code, total for all processors

IOWAIT_TICKS - the number of hundredths of a second that the processor expects I / O complete, common to all processors

Here is the request.

SELECT (select value from v$osstat where stat_name = 'BUSY_TICKS') /
(
   NVL((select value from v$osstat where stat_name = 'IDLE_TICKS'),0) +
   NVL((select value from v$osstat where stat_name = 'BUSY_TICKS'),0) +
   NVL((select value from v$osstat where stat_name = 'IOWAIT_TICKS'),0)
)
FROM DUAL;

10.2 _TICKS _TIME.

reset, .

. v $OSStat .

+4

, USER_TICKS SYS_TICKS.

BUSY_TICKS :

"...been busy executing user or kernel code, totalled over all processors"

, BUSY_TICKS USER_TICKS SYS_TICKS.

NICE_TICKS - ( ).

IOWAIT_TICKS, , .

0

. , Busy - User + Sys.

, Busy Idle ( IOWAIT).

0

Think about it. If my goal is to get a general idea of ​​the load on the machine, I would probably be better off, including IOWAIT_TICKS in the numerator and denominator, to understand how long the CPU is not available for my work.

SELECT (
(select value from v$osstat where stat_name = 'BUSY_TICKS') +
(select value from v$osstat where stat_name = 'IOWAIT_TICKS'))
/
(
   NVL((select value from v$osstat where stat_name = 'IDLE_TICKS'),0) +
   NVL((select value from v$osstat where stat_name = 'BUSY_TICKS'),0) +
   NVL((select value from v$osstat where stat_name = 'IOWAIT_TICKS'),0)
)
FROM DUAL;

This would ensure that if the machine had a high level of competition or IO expectations, I would not be fooled and add the problem by completing more tasks.

0
source

Depending on your perspective. Knowing what you need, I think everything is fine with you.

0
source

Source: https://habr.com/ru/post/1698329/


All Articles