--use-memory

Overview

This is a command-line option for the mariadb-backup & mariabackup commands (arg: Required).

The value is used in place of innodb_buffer_pool_size. This option is only relevant when the --prepare option is specified.

See also: Options for mariadb-backup & mariabackup in MariaDB Enterprise Server 10.6, in 10.6 CS, in 10.5 ES, in 10.5 CS, in 10.4 ES, in 10.4 CS, in 10.3 ES, in 10.3 CS, in 10.2 ES, 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

  • Present starting in MariaDB Enterprise Server 10.6.4-1.

10.6 Community

  • Present starting in MariaDB Community Server 10.6.0.

10.5 Enterprise

  • Present starting in MariaDB Enterprise Server 10.5.3-1.

10.5 Community

  • Present starting in MariaDB Community Server 10.5.0.

10.4 Enterprise

  • Present starting in MariaDB Enterprise Server 10.4.6-1.

10.4 Community

  • Present starting in MariaDB Community Server 10.4.0.

10.3 Enterprise

  • Present starting in MariaDB Enterprise Server 10.3.16-1.

10.3 Community

  • Added in MariaDB Community Server 10.3.4.

10.2 Enterprise

  • Present starting in MariaDB Enterprise Server 10.2.25-1.

10.2 Community

  • Added in MariaDB Community Server 10.2.8.