- 论坛徽章:
- 0
|
PURPOSE
-------
In this document we are going to explain how to check that asynchronous I/O
is working.
SCOPE & APPLICATION
-------------------
Many times there is a requirement to check if Asynchronous I/O is working
on Linux Platform, so we can try to use it for our datafiles access
inside database.
SOLUTION
--------
slabinfo maintains statistics about objects in memory. Some of the structs used
by Asynchronous I/O are threated as objects in the virtual memory, so we can
look for those structs on slabinfo. The ones related to AIO are named kio*.
$ cat /proc/slabinfo | grep kio
for example:
output with async io enabled.
$ cat /proc/slabinfo | grep kio
kioctx 270 270 128 9 9 1 : 252 126
kiocb 66080 66080 96 1652 1652 1 : 252 126
kiobuf 236 236 64 4 4 1 : 252 126
$
output with async io disabled.
$ cat /proc/slabinfo | grep kio
kioctx 0 0 128 0 0 1 : 252 126
kiocb 0 0 96 0 0 1 : 252 126
kiobuf 0 0 64 0 0 1 : 252 126
$
There are 3 caches involved.
The kioctx and kiocb are Async I/O data structures that are defined in aio.h.
If it shows a non zero value that means async io is enabled.
If you have the source code loaded, you can review it at file aio.h.
This file is located under:
/usr/src/linux-/include/linux/aio.h
These data structures are using to track the I/O requests, and are allocated as
part of the __init aio_setup() call in aio.c.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/16666/showart_99121.html |
|