GNU Info

Info Node: (mysql.info)InnoDB Disk i/o

(mysql.info)InnoDB Disk i/o


Next: InnoDB File space Prev: File space management Up: File space management
Enter node , (file) or (file)node

Disk i/o
........

In disk i/o InnoDB uses asynchronous i/o. On Windows NT it uses the
native asynchronous i/o provided by the operating system.  On Unix,
InnoDB uses simulated asynchronous i/o built into InnoDB: InnoDB
creates a number of i/o threads to take care of i/o operations, such as
read-ahead. In a future version we will add support for simulated aio
on Windows NT and native aio on those versions of Unix which have one.

On Windows NT InnoDB uses non-buffered i/o. That means that the disk
pages InnoDB reads or writes are not buffered in the operating system
file cache. This saves some memory bandwidth.

Starting from 3.23.41 InnoDB uses a novel file flush technique called
doublewrite.  It adds safety to crash recovery after an operating
system crash or a power outage, and improves performance on most Unix
flavors by reducing the need for fsync operations.

Doublewrite means that InnoDB before writing pages to a data file first
writes them to a contiguous tablespace area called the doublewrite
buffer. Only after the write and the flush to the doublewrite buffer
has completed, InnoDB writes the pages to their proper positions in the
data file. If the operating system crashes in the middle of a page
write, InnoDB will in recovery find a good copy of the page from the
doublewrite buffer.

Starting from 3.23.41 you can also use a raw disk partition as a data
file, though this has not been tested yet. When you create a new data
file you have to put the keyword `newraw' immediately after the data
file size in `innodb_data_file_path'. The partition must be >= than you
specify as the size. Note that 1M in InnoDB is 1024 x 1024 bytes, while
in disk specifications 1 MB usually means 1000 000 bytes.

     innodb_data_file_path=hdd1:3Gnewraw;hdd2:2Gnewraw

When you start the database again you MUST change the keyword to `raw'.
Otherwise InnoDB will write over your partition!

     innodb_data_file_path=hdd1:3Graw;hdd2:2Graw

Using a raw disk you can on some Unixes perform non-buffered i/o.

There are two read-ahead heuristics in InnoDB: sequential read-ahead
and random read-ahead. In sequential read-ahead InnoDB notices that the
access pattern to a segment in the tablespace is sequential.  Then
InnoDB will post in advance a batch of reads of database pages to the
i/o system. In random read-ahead InnoDB notices that some area in a
tablespace seems to be in the process of being fully read into the
buffer pool. Then InnoDB posts the remaining reads to the i/o system.


automatically generated by info2www version 1.2.2.9