Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deeply parse the waiting event of Kfk: Async Disk IO in Oracle database

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to carry out Oracle database Kfk: Async Disk IO wait for the event of in-depth analysis, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can get something.

Overview

Early in the morning, the operation and maintenance team came to look for trouble, saying that the system was a bit stuck again, and then found a relatively rare waiting event-kfk: async disk IO. Take advantage of this investigation process to briefly talk about this waiting event.

1. View the TOP N wait event

SELECT inst_id,EVENT, SUM (DECODE (WAIT_TIME, 0,0,1)) "Prev", SUM (DECODE (WAIT_TIME, 0,1,0)) "Curr", COUNT (*) "Tot", sum (SECONDS_IN_WAIT) SECONDS_IN_WAIT FROM GV$SESSION_WAIT WHERE event NOT IN ('smon timer','pmon timer','rdbms ipc message','SQL*Net message from client') 'gcs remote message') AND event NOT LIKE'% idle%' AND event NOT LIKE'% Idle%' AND event NOT LIKE'% Streams AQ%' GROUP BY inst_id,EVENT ORDER BY 1pje 5 desc -- class slave wait

You can see that at the top of the list is the kfk: async disk IO wait event.

2. Check the conversation according to the waiting event

SELECT / * + rule * / sid, s.serializations, spid, event, sql_id, seconds_in_wait ws, row_wait_obj# obj, s.username, s.machine, BLOCKING_INSTANCE | |'. | | blocking_session b_sess FROM v$session s, v$process p WHERE event='&event_name' AND s.paddr = p.addr order by 6

3. Query the details of a session

SELECT / * + rule * / sid, s.serializations, spid, event, sql_id, seconds_in_wait ws, row_wait_obj# obj, s.username, s.machine, BLOCKING_INSTANCE | |'. | | blocking_session b_sess FROM v$session s, v$process p WHERE event='&event_name' AND s.paddr = p.addr order by 6

Show in backup..

4. Check whether the server is backing up?

Check the backup log and find that level 0 is indeed being done.

5. Check kfk: async disk IO

Select name,parameter1,parameter2,parameter3,wait_class from v$event_name where name='kfk: async disk IO'

6. About kfk: async disk IO

Kfk: the async disk IO wait event is an asynchronous System Imax O wait event under ASM, and the kfk kernel level is activated during disk_asynch_io=true. When rbal or other ASM-related background processes are maintaining ASM disk groups, they may enter kfk: async disk IO to wait.

To be sure, kfk: async disk IO is a wait event that will be encountered during direct path operations and ASM maintenance operations under ASM after 11G.

Let's first take a look at Daniel's description:

Two functions of asynchronous IO: io_submit and io_getevents,Oracle first call io_submit to initiate asynchronous IO, and then call io_getevents to check the IO status.

As you can see from the figure, this Daniel believes that in the io_submit phase, waiting is kfk: async disk IO, and from io_getevents to IO completion, it is direct path read.

Let's take a look at the next picture that follows:

In this picture, the master opens 10046 and tracks the execution of the process with the tools of Truss and trace classes at the same time. In the trace result, there is an io_submit call first, and immediately write kfk: async disk IO to the 10046 trace file to wait. The io_getevents call is followed by writing the direct path read wait event to the 10046 trace file. Based on this, the master concluded that during io_submit, the wait event is kfk: async disk IO,io_getevents corresponds to direct path read.

But the actual situation kfk: async disk IO is not so simple, because if io_submit corresponds to kfk: async disk IO,io_getevents corresponds to direct path read. As we all know, when the inter-path IO,db file scattered read waits for the event, the completion of the asynchronous IO is to issue the IO by io_submit first, and then use io_getevents to check the IO status later. As with direct paths, why do indirect paths have only db file scattered read waiting events and not kfk: async disk IO waiting events.

Obviously, it is the difference between direct and indirect paths that gives rise to kfk: async disk IO waiting. What's the difference between them? look at the picture below.

This picture is the case under the direct path, which is tracked by DTrace and is richer and more accurate than the results of Truss and Strace.

After issuing asynchronous IO instructions, Oracle does something else without waiting for IO to finish. Asynchronous IO? you don't need to issue the IO instruction and wait for the IO to complete.

After doing something, Oracle calls the function to check the completion status of the IO with a timeout of 0 seconds.

A timeout of 0 seconds means there will be no stopping. Just call the function to check the IO status. If the IO has been completed, enter the IO completion process.

If the IO is not completed, some other operations will be done, and then the function will be called again to check the IO status with a timeout of 600 seconds. That is, stay for up to 600 seconds and wait for the IO to complete. If the IO is complete, enter the IO completion process.

Let's take a look at the wait event. From issuing the IO instruction to the 0 second timeout, the wait event is kfk: async disk IO. If the 0-second timeout IO does not complete, the wait event until the IO completes is direct path read.

For indirect paths, all IO times out in 600s, and there is no zero-second timeout, so there is only db file scattered read wait for the indirect path, not kfk: async disk IO wait.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report