Recent Changes - Search:

Softwares

.

HowToTuneMysqldServerParameters

  • The following values are typical and suit most users:
  [mysqld]
  skip-external-locking
  max_connections=200
  read_buffer_size=1M
  sort_buffer_size=1M
  #
  # Set key_buffer to 5 - 50% of your RAM depending on how much
  # you use MyISAM tables, but keep key_buffer_size + InnoDB
  # buffer pool size < 80% of your RAM
  key_buffer_size=value
  • When tuning a MySQL server, the two most important variables to configure are key_buffer_size and table_cache. You should first feel confident that you have these set appropriately before trying to change any other variables.

The following examples indicate some typical variable values for different runtime configurations.

  • If you have at least 256MB of memory and many tables and want maximum performance with a moderate number of clients, you should use something like this:
      shell> mysqld_safe --key_buffer_size=64M --table_cache=256 --sort_buffer_size=4M --read_buffer_size=1M &
  • If you have only 128MB of memory and only a few tables, but you still do a lot of sorting, you can use something like this:
      shell> mysqld_safe --key_buffer_size=16M --sort_buffer_size=1M

If there are very many simultaneous connections, swapping problems may occur unless mysqld has been configured to use very little memory for each connection. mysqld performs better if you have enough memory for all connections.

  • With little memory and lots of connections, use something like this:
      shell> mysqld_safe --key_buffer_size=512K --sort_buffer_size=100K --read_buffer_size=100K &

Reference : http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html

Edit - History - Print - Recent Changes - Search
Page last modified on July 09, 2007, at 11:19 PM