I'm trying to tweak my MySQL server to fit my needs... and I have a basic question: What is the key buffer?
Through try and error I've found that a bigger key buffer makes my inserts faster... but I don't quite understand what it is. So... before I make something I might regret, I'd like to know what it is, and how it works.
The script I'm running (MyISAM tables) is making about 2000 inserts per second.
(My server setup is Intel i7, 8GB RAM, CentOS 5.5, MySQL Server 5.0.)
By default, MySQL will only use 8MB for MyISAM's key buffer and 8MB for InnoDB's buffer pool. Therefore, databases of any significant size will need these configurations tuned. The upper limit is determined in part by your operating system process limits, and how much memory is available with your system's hardware.
What is an InnoDB Buffer Pool? InnoDB buffer pool is the memory space that holds many in-memory data structures of InnoDB, buffers, caches, indexes and even row-data. innodb_buffer_pool_size is the MySQL configuration parameter that specifies the amount of memory allocated to the InnoDB buffer pool by MySQL.
The buffer pool is an area in main memory where InnoDB caches table and index data as it is accessed. The buffer pool permits frequently used data to be accessed directly from memory, which speeds up processing.
The key buffer is MyISAM specific, a structure for index blocks that contains a number of block buffers where the most-used index blocks are placed. It's mean for minimizing disk I/O, because memory is still faster than hard drives [currently]. The MyISAM key buffer is described in more detail in the documentation.
Size depends on amount of indexes, data size and workload.
For more info, see this article on MySQL tuning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With