InnoDB内存包括: buffer pool(缓冲池), redo log buffer, additional memory pool
1 2 3 4 5 6 7 8 9 10 11 12 13
MySQL [test]> show variables like 'innodb_buffer_pool_size'; +-------------------------+-----------+ | Variable_name | Value | +-------------------------+-----------+ | innodb_buffer_pool_size | 134217728 | +-------------------------+-----------+
MySQL [test]> show variables like 'innodb_log_buffer_size'; +------------------------+----------+ | Variable_name | Value | +------------------------+----------+ | innodb_log_buffer_size | 16777216 | +------------------------+----------+
BUFFER POOL AND MEMORY ---------------------- Total large memory allocated 137363456 Dictionary memory allocated 404218 Buffer pool size 8191 Free buffers 7237 Database pages 950 Old database pages 370 Modified db pages 0 Pending reads 0 Pending writes: LRU 0, flush list 0, single page 0 Pages made young 1, not young 0 0.00 youngs/s, 0.00 non-youngs/s Pages read 803, created 147, written 218 0.00 reads/s, 0.00 creates/s, 0.00 writes/s No buffer pool page gets since the last printout Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s LRU len: 950, unzip_LRU len: 0 I/O sum[0]:cur[0], unzip sum[0]:cur[0]
do_thing_once_per_second() { flush(log buffer); // even if transaction not committed if (last_second_io < 5) merge(insert buffer) if (buf_get_modified_ratio_pct > innodb_max_dirty_page_pct) flush(dirty_page) if (no user activity) goto background_loop }