mirror of
https://github.com/MariaDB/server.git
synced 2025-12-07 17:42:39 +03:00
In commit c4c8830709 (MDEV-28111) we disabled
the file system cache on the InnoDB write-ahead log file (ib_logfile0)
by default on Linux.
It turns out that especially with innodb_flush_trx_log_at_commit=2,
writing to the log via the file system cache typically improves throughput,
especially on slow storage or at a small number of concurrent transactions.
For other values of innodb_flush_log_at_trx_commit, direct writes were
observed to be mostly but not always faster. Whether it pays off to
disable the file system cache on the log may depend on the type of storage,
the workload, and the operating system kernel version.
On Linux and Microsoft Windows, we will introduce the settable Boolean
global variable innodb_log_file_buffering that indicates whether the
file system cache on the redo log file is enabled. The default value is
innodb_log_file_buffering=OFF. If the server is started up with
innodb_flush_log_at_trx_commit=2, the value will be changed to
innodb_log_file_buffering=ON.
When a persistent memory interface is being used for the log,
the value cannot be changed from innodb_log_file_buffering=OFF.
On Linux, when the physical block size cannot be determined
to be a power of 2 between 64 and 4096 bytes, the file system cache
cannot be disabled, and innodb_log_file_buffering=ON cannot be changed.
Server log messages will indicate whether the file system cache is
enabled for the redo log:
[Note] InnoDB: Buffered log writes (block size=512 bytes)
[Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
After this change, the startup parameter innodb_flush_method will no
longer control whether O_DIRECT will be set on the redo log on Linux.
On other operating systems that support O_DIRECT, no interface has been
implemented for controlling the file system cache for the redo log.
The innodb_flush_method values O_DIRECT, O_DIRECT_NO_FSYNC, O_DSYNC
will enable O_DIRECT for data files, not the log.
Tested by: Matthias Leich, Axel Schwenke
18 lines
1002 B
Plaintext
18 lines
1002 B
Plaintext
--source include/have_innodb.inc
|
|
--source include/have_debug.inc
|
|
--source include/not_valgrind.inc
|
|
--source include/word_size.inc
|
|
|
|
--vertical_results
|
|
--replace_regex /^\/\S+/PATH/ /\.\//PATH/
|
|
select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT, NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT from information_schema.system_variables
|
|
where variable_name like 'innodb%' and
|
|
variable_name not in (
|
|
'innodb_version', # always the same as the server version
|
|
'innodb_numa_interleave', # only available WITH_NUMA
|
|
'innodb_evict_tables_on_commit_debug', # one may want to override this
|
|
'innodb_use_native_aio', # default value depends on OS
|
|
'innodb_log_file_buffering', # only available on Linux and Windows
|
|
'innodb_buffer_pool_load_pages_abort') # debug build only, and is only for testing
|
|
order by variable_name;
|