Documentation Home
MySQL 8.4 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.2Mb
PDF (A4) - 40.3Mb
Man Pages (TGZ) - 262.0Kb
Man Pages (Zip) - 367.6Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 8.4 Reference Manual  / ...  / The InnoDB Storage Engine  / InnoDB Configuration  / InnoDB Buffer Pool Configuration  /  Excluding or Including Buffer Pool Pages from Core Files

17.8.3.7 Excluding or Including Buffer Pool Pages from Core Files

A core file records the status and memory image of a running process. Because the buffer pool resides in main memory, and the memory image of a running process is dumped to the core file, systems with large buffer pools can produce large core files when themysqld process dies.

Large core files can be problematic for a number of reasons including the time it takes to write them, the amount of disk space they consume, and the challenges associated with transferring large files.

Excluding buffer pool pages may also be desirable from a security perspective if you have concerns about dumping database pages to core files that may be shared inside or outside of your organization for debugging purposes.

Note

Access to the data present in buffer pool pages at the time themysqld process died may be beneficial in some debugging scenarios. If in doubt whether to include or exclude buffer pool pages, consult MySQL Support.

Theinnodb_buffer_pool_in_core_file option is only relevant if thecore_file variable is enabled and the operating system supports theMADV_DONTDUMP non-POSIX extension to themadvise() system call, which is supported in Linux 3.4 and later. TheMADV_DONTDUMP extension causes pages in a specified range to be excluded from core dumps. Theinnodb_buffer_pool_in_core_file option is disabled by default on systems that support MADV_DONTDUMP, otherwise it defaults to ON.

Note

Before MySQL 8.4,innodb_buffer_pool_in_core_file was enabled by default instead of disabled.

To generate core files with buffer pool pages, start the server with the--core-file and--innodb-buffer-pool-in-core-file=ON options.

$> mysqld --core-file --innodb-buffer-pool-in-core-file=ON

Thecore_file variable is read-only and disabled by default. It is enabled by specifying the--core-file option at startup. Theinnodb_buffer_pool_in_core_file variable is dynamic. It can be specified at startup or configured at runtime using aSET statement.

mysql> SET GLOBAL innodb_buffer_pool_in_core_file=OFF;

If theinnodb_buffer_pool_in_core_file variable is disabled butMADV_DONTDUMP is not supported by the operating system, or anmadvise() failure occurs, a warning is written to the MySQL server error log and thecore_file variable is disabled to prevent writing core files that unintentionally include buffer pool pages. If the read-onlycore_file variable becomes disabled, the server must be restarted to enable it again.

The following table shows configuration andMADV_DONTDUMP support scenarios that determine whether core files are generated and whether they include buffer pool pages.

Table 17.4 Core File Configuration Scenarios

core_file variableinnodb_buffer_pool_in_core_file variablemadvise() MADV_DONTDUMP SupportOutcome
OFF (default)Not relevant to outcomeNot relevant to outcomeCore file is not generated
ONON (default on systems withoutMADV_DONTDUMP support)Not relevant to outcomeCore file is generated with buffer pool pages
ONOFF (default on systems withMADV_DONTDUMP support)YesCore file is generated without buffer pool pages
ONOFFNoCore file is not generated,core_file is disabled, and a warning is written to the server error log

The reduction in core file size achieved by disabling theinnodb_buffer_pool_in_core_file variable depends on the size of the buffer pool, but it is also affected by theInnoDB page size. A smaller page size means more pages are required for the same amount of data, and more pages means more page metadata. The following table provides size reduction examples that you might see for a 1GB buffer pool with different pages sizes.

Table 17.5 Core File Size with Buffer Pool Pages Included and Excluded

innodb_page_size SettingBuffer Pool Pages Included (innodb_buffer_pool_in_core_file=ON)Buffer Pool Pages Excluded (innodb_buffer_pool_in_core_file=OFF)
4KB2.1GB0.9GB
64KB1.7GB0.7GB