Rechercher dans le manuel MySQL
15.11.1 InnoDB Disk I/O
InnoDB
uses asynchronous disk I/O where
possible, by creating a number of threads to handle I/O
operations, while permitting other database operations to proceed
while the I/O is still in progress. On Linux and Windows
platforms, InnoDB
uses the available OS and
library functions to perform “native” asynchronous
I/O. On other platforms, InnoDB
still uses I/O
threads, but the threads may actually wait for I/O requests to
complete; this technique is known as “simulated”
asynchronous I/O.
Read-Ahead
If InnoDB
can determine there is a high
probability that data might be needed soon, it performs
read-ahead operations to bring that data into the buffer pool so
that it is available in memory. Making a few large read requests
for contiguous data can be more efficient than making several
small, spread-out requests. There are two read-ahead heuristics
in InnoDB
:
In sequential read-ahead, if
InnoDB
notices that the access pattern to a segment in the tablespace is sequential, it posts in advance a batch of reads of database pages to the I/O system.In random read-ahead, if
InnoDB
notices that some area in a tablespace seems to be in the process of being fully read into the buffer pool, it posts the remaining reads to the I/O system.
For information about configuring read-ahead heuristics, see Section 15.8.3.4, “Configuring InnoDB Buffer Pool Prefetching (Read-Ahead)”.
InnoDB
uses a novel file flush technique
involving a structure called the
doublewrite
buffer, which is enabled by default in most cases
(innodb_doublewrite=ON
). It
adds safety to recovery following a crash or power outage, and
improves performance on most varieties of Unix by reducing the
need for fsync()
operations.
Before writing pages to a data file, InnoDB
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 does InnoDB
write the pages to their proper positions in the data file. If
there is an operating system, storage subsystem, or
mysqld process crash in the middle of a page
write (causing a torn page
condition), InnoDB
can later find a good copy
of the page from the doublewrite buffer during recovery.
If system tablespace files (“ibdata files”) are
located on Fusion-io devices that support atomic writes,
doublewrite buffering is automatically disabled and Fusion-io
atomic writes are used for all data files. Because the
doublewrite buffer setting is global, doublewrite buffering is
also disabled for data files residing on non-Fusion-io hardware.
This feature is only supported on Fusion-io hardware and is only
enabled for Fusion-io NVMFS on Linux. To take full advantage of
this feature, an
innodb_flush_method
setting of
O_DIRECT
is recommended.
Traduction non disponible
Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-innodb-disk-io.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.