Rechercher dans le manuel MySQL
15.8.3.6 Fine-tuning InnoDB Buffer Pool Flushing
The configuration options
innodb_flush_neighbors
and
innodb_lru_scan_depth
let you
fine-tune aspects of the
flushing process for the
InnoDB
buffer pool.
Specifies whether flushing a page from the buffer pool also flushes other dirty pages in the same extent. When the table data is stored on a traditional HDD storage device, flushing neighbor pages in one operation reduces I/O overhead (primarily for disk seek operations) compared to flushing individual pages at different times. For table data stored on SSD, seek time is not a significant factor and you can disable this setting to spread out write operations.
Specifies, per buffer pool instance, how far down the buffer pool LRU list the page cleaner thread scans looking for dirty pages to flush. This is a background operation performed once per second.
These options primarily help write-intensive workloads. With heavy DML activity, flushing can fall behind if it is not aggressive enough, resulting in excessive memory use in the buffer pool; or, disk writes due to flushing can saturate your I/O capacity if that mechanism is too aggressive. The ideal settings depend on your workload, data access patterns, and storage configuration (for example, whether data is stored on HDD or SSD devices).
For systems with constant heavy
workloads, or workloads
that fluctuate widely, several configuration options let you
fine-tune the flushing
behavior for InnoDB
tables:
These options feed into the formula used by the
innodb_adaptive_flushing
option.
The innodb_adaptive_flushing
,
innodb_io_capacity
and
innodb_max_dirty_pages_pct
options are limited or extended by the following options:
The InnoDB
adaptive flushing
mechanism is not appropriate in all cases. It gives the most
benefit when the redo log
is in danger of filling up. The
innodb_adaptive_flushing_lwm
option specifies a “low water mark” percentage of
redo log capacity; when that threshold is crossed,
InnoDB
turns on adaptive flushing even if not
specified by the
innodb_adaptive_flushing
option.
If flushing activity falls far behind, InnoDB
can flush more aggressively than specified by
innodb_io_capacity
.
innodb_io_capacity_max
represents an upper limit on the I/O capacity used in such
emergency situations, so that the spike in I/O does not consume
all the capacity of the server.
InnoDB
tries to flush data from the buffer
pool so that the percentage of dirty pages does not exceed the
value of
innodb_max_dirty_pages_pct
. The
default value for
innodb_max_dirty_pages_pct
is
75.
The
innodb_max_dirty_pages_pct
setting establishes a target for flushing activity. It does
not affect the rate of flushing. For information about
managing the rate of flushing, see
Section 15.8.3.5, “Configuring InnoDB Buffer Pool Flushing”.
The
innodb_max_dirty_pages_pct_lwm
option specifies a “low water mark” value that
represents the percentage of dirty pages where pre-flushing is
enabled to control the dirty page ratio and ideally prevent the
percentage of dirty pages from reaching
innodb_max_dirty_pages_pct
. A
value of
innodb_max_dirty_pages_pct_lwm=0
disables the “pre-flushing” behavior.
Most of the options referenced above are most applicable to servers that run write-heavy workloads for long periods of time and have little reduced load time to catch up with changes waiting to be written to disk.
innodb_flushing_avg_loops
defines the number of iterations for which
InnoDB
keeps the previously calculated
snapshot of the flushing state, which controls how quickly
adaptive flushing responds to foreground load changes. Setting a
high value for
innodb_flushing_avg_loops
means
that InnoDB
keeps the previously calculated
snapshot longer, so adaptive flushing responds more slowly. A
high value also reduces positive feedback between foreground and
background work, but when setting a high value it is important
to ensure that InnoDB
redo log utilization
does not reach 75% (the hardcoded limit at which async flushing
starts) and that the
innodb_max_dirty_pages_pct
setting keeps the number of dirty pages to a level that is
appropriate for the workload.
Systems with consistent workloads, a large
innodb_log_file_size
, and small
spikes that do not reach 75% redo log space utilization should
use a high
innodb_flushing_avg_loops
value
to keep flushing as smooth as possible. For systems with extreme
load spikes or log files that do not provide a lot of space,
consider a smaller
innodb_flushing_avg_loops
value. A smaller value allows flushing to closely track the load
and helps avoid reaching 75% redo log space utilization.
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 26/06/2006, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/mysql-rf-innodb-lru-background-flushing.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.