--use-memory
This page is part of MariaDB's Documentation.
The parent of this page is: mariadb-backup
& mariabackup
Topics on this page:
Overview
This is a command-line option for the mariadb-backup
& mariabackup
commands (arg: Required).
The value is used in place of innodb_
See also: Options for mariadb-backup & mariabackup in MariaDB Enterprise Server 10.6, in 10.5 ES, in 10.4 ES, in 10.3 ES, in 10.2 ES, in 10.6 CS, in 10.5 CS, in 10.4 CS, in 10.3 CS, and in 10.2 CS
USAGE
The --use-memory
option can be specified on the command-line when the --prepare
option is specified:
$ sudo mariadb-backup --prepare \
--use-memory=32G \
--target-dir=/data/backups/full
DETAILS
The --use-memory
option configures the amount of memory that mariadb-backup
and mariabackup
can allocate to prepare a backup, which occurs when the --prepare
option is specified. The default value is 104857600
(100 MiB).
While preparing the backup, mariadb-backup
and mariabackup
use the allocated memory in the same way that InnoDB uses the InnoDB Buffer Pool during crash recovery. Therefore, for best performance, the value of the --use-memory
option should be greater than or equal to the innodb_buffer_pool_size
value from the server where the backup was created.
In MariaDB Enterprise Server 10.5 and later, mariadb-backup
and mariabackup
use memory very efficiently when preparing a backup, so it can be safe to set the --use-memory
option to a smaller size than innodb_buffer_pool_size
, but setting it to innodb_buffer_pool_size
or larger can make the prepare finish sooner.
In MariaDB Enterprise Server 10.4 and before, mariadb-backup
and mariabackup
can require more memory to prepare a backup than InnoDB requires for crash recovery, so the --use-memory
option might sometimes need to be set to a higher value than the server's innodb_buffer_pool_size
.
MariaDB recommends testing a --use-memory
value in your own environment to confirm that it provides acceptable performance.
When a backup is prepared on a running database server, a high --use-memory
value can impact performance of the database. Therefore, MariaDB recommends preparing backups on a different system to avoid impacting the database server.
CHANGE HISTORY
Release Series | History |
---|---|
10.6 Enterprise |
|
10.6 Community |
|
10.5 Enterprise |
|
10.5 Community |
|
10.4 Enterprise |
|
10.4 Community |
|
10.3 Enterprise |
|
10.3 Community |
|
10.2 Enterprise |
|
10.2 Community |
|