Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Won't Do
-
10.1(EOL), (13)
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL)
Description
The initialization of innodb buffer pool chunks/blocks on allocation has a number of consequences.
- on very large memory systems this can take significant time
- the initialization of data in the allocated memory forces this to paged into the process resulting in a real allocation out of the available OS space.
The second becomes a problem when a large number of processes are on the system, potentially a large number of mariadb instances all competing for memory. A claim on use approach leaves more RAM available for other processes if mariadb doesn't end up using it.
Sizing innodb buffer pool is a hard task so lets try to make it easier, or just less consequences if its wrong.
The proposal is buf_pool_t::chunk_t::create removed the initialization (buf_block_init) and this becomes detected when blocks/chunks are used and then initialized there.
Attachments
Issue Links
- relates to
-
MDEV-25341 innodb buffer pool soft decommit of memory
-
- Closed
-
-
MDEV-33279 Disable transparent huge pages after page buffers has been allocated
-
- Closed
-
-
MDEV-24670 avoid OOM by linux kernel co-operative memory management
-
- Closed
-
-
MDEV-25342 autosize innodb_buffer_pool_chunk_size
-
- Closed
-
-
DOCS-5414 Loading...
Was getting 3 seconds on 20G with memlock, only some of it huge pages.
10.6-4bd94afbd3cecdcca9edb87834b41de5494fbbea
# echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
# cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
201
# ulimit -l 20000000
# sql/mariadbd --no-defaults --datadir=/tmp/${PWD##*/}-datadir --socket=/tmp/${PWD##*/}.sock --plugin-dir=${PWD}/mysql-test/var/plugins/ --verbose --skip-networking --large-pages=1 --innodb-buffer-pool-size=20G --memlock --user=root
2023-12-01 13:16:42 0 [Note] Starting MariaDB 10.6.17-MariaDB source revision 4bd94afbd3cecdcca9edb87834b41de5494fbbea as process 185716
2023-12-01 13:16:42 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2023-12-01 13:16:42 0 [Note] InnoDB: Number of pools: 1
2023-12-01 13:16:42 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-12-01 13:16:42 0 [Note] InnoDB: Using liburing
2023-12-01 13:16:42 0 [Note] InnoDB: Initializing buffer pool, total size = 21474836480, chunk size = 134217728
2023-12-01 13:16:42 0 [Note] InnoDB: Completed initialization of buffer pool
2023-12-01 13:16:42 0 [Note] InnoDB: Setting O_DIRECT on file ./ibdata1 failed
2023-12-01 13:16:42 0 [Note] InnoDB: 128 rollback segments are active.
2023-12-01 13:16:42 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-12-01 13:16:42 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-12-01 13:16:42 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-12-01 13:16:42 0 [Note] InnoDB: 10.6.17 started; log sequence number 55985; transaction id 23
2023-12-01 13:16:42 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-12-01 13:16:42 0 [Note] InnoDB: Loading buffer pool(s) from /tmp/build-mariadb-server-10.6-datadir/ib_buffer_pool
2023-12-01 13:16:42 0 [Note] InnoDB: Buffer pool(s) load completed at 231201 13:16:42
2023-12-01 13:16:45 0 [Note] sql/mariadbd: ready for connections.
Version: '10.6.17-MariaDB' socket: '/tmp/build-mariadb-server-10.6.sock' port: 0 Source distribution
With 38ee8129d85e867c86b16404a3906030ddab7129
# sql/mariadbd --no-defaults --datadir=/tmp/${PWD##*/}-datadir --socket=/tmp/${PWD##*/}.sock --plugin-dir=${PWD}/mysql-test/var/plugins/ --verbose --skip-networking --large-pages=1 --innodb-buffer-pool-size=20G --memlock --user=root
2023-12-01 13:32:49 0 [Note] Starting MariaDB 10.6.17-MariaDB source revision 4bd94afbd3cecdcca9edb87834b41de5494fbbea as process 186718
2023-12-01 13:32:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2023-12-01 13:32:49 0 [Note] InnoDB: Number of pools: 1
2023-12-01 13:32:49 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-12-01 13:32:49 0 [Note] InnoDB: Using liburing
2023-12-01 13:32:49 0 [Note] InnoDB: Initializing buffer pool, total size = 21474836480, chunk size = 134217728
2023-12-01 13:32:49 0 [Note] InnoDB: Completed initialization of buffer pool
2023-12-01 13:32:49 0 [Note] InnoDB: Setting O_DIRECT on file ./ibdata1 failed
2023-12-01 13:32:49 0 [Note] InnoDB: 128 rollback segments are active.
2023-12-01 13:32:49 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-12-01 13:32:49 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-12-01 13:32:49 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-12-01 13:32:49 0 [Note] InnoDB: 10.6.17 started; log sequence number 56081; transaction id 23
2023-12-01 13:32:49 0 [Note] InnoDB: Loading buffer pool(s) from /tmp/build-mariadb-server-10.6-datadir/ib_buffer_pool
2023-12-01 13:32:49 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-12-01 13:32:49 0 [Note] InnoDB: Buffer pool(s) load completed at 231201 13:32:49
2023-12-01 13:32:51 0 [Note] sql/mariadbd: ready for connections.
Version: '10.6.17-MariaDB' socket: '/tmp/build-mariadb-server-10.6.sock' port: 0 Source distribution
Gained a second (1/3) on smallish 20G pools. Good gain. Thanks.