Proposal for Configuration Namespaces

by Jeremy Cole

Note: This document is a work in progress. If you have some ideas, comments, or suggestions, please feel free to contact me.

Background

MySQL’s configuration files currently use a nearly flat namespace: the namespace is only divided between programs, such as the group names [mysqld], [mysql], and [mysqldump].

The problem

Given that MySQL has many storage engines now, and that it’s getting more and more features added every day, the flat namespace has been quickly outgrown. It’s very difficult to remember all of the different configuration options, what they relate to, and when and where they are allocated.

For example: What’s the difference between sort_buffer_size and myisam_sort_buffer_size? What storage engines use read_buffer_size?

Many variables are prefixed with some kind of feature or storage engine name, but it’s inconsistent and often overly verbose.

My proposed solution

I propose to rename all of MySQL’s configuration variables into a multi-level hierarchical namespace, for example:

key_buffer_size —> engine.myisam.key_cache.size
innodb_buffer_pool_size —> engine.innodb.buffer_pool.size

The old names can be supported for a long time, but new variables should only be added with the new namespace-format names. (Unless the variable is added to an older version of MySQL.)

Complete (not yet, though!) list of proposed name changes

Old Name New Name
global.*
basedir global.basedir
datadir global.datadir
pid_file global.pid_file
global.net.*
back_log global.net.back_log
net_read_timeout global.net.read_timeout
net_write_timeout global.net.write_timeout
net_retry_count global.net.retry_count
global.net.tcp.*
port global.net.tcp.port
global.net.unix.*
socket global.net.unix.socket
global.log.*
log global.log.general
log_bin global.log.binlog
max_binlog_size global.log.binlog.max_size
binlog_cache_size global.log.binlog.cache_size
log_slave_updates global.log.binlog.log_slave_updates
log_slow_queries global.log.slow
long_query_time global.log.slow.time_limit
global.query_cache.*
query_cache_size global.query_cache.size
query_cache_type global.query_cache.type
query_cache_min_res_unit global.query_cache.min_res_unit
query_cache_limit global.query_cache.result_limit_size
query_alloc_block_size global.query_cache.block_alloc_size
query_cache_wlock_invalidate global.query_cache.wlock_invalidate
global.fulltext.*
ft_boolean_syntax global.fulltext.boolean_syntax
ft_max_word_len global.fulltext.word_len.max
ft_min_word_len global.fulltext.word_len.min
ft_query_expansion_limit global.fulltext.query_expansion_limit
ft_stopword_file global.fulltext.stopword_file
global.replication.*
server_id global.replication.server_id
slave_net_timeout global.replication.slave.net_timeout
slave_transaction_retries global.replication.slave.transaction_retries
global.auto_increment.*
auto_increment_offset global.auto_increment.offset
auto_increment_increment global.auto_increment.increment
session.*
sort_buffer_size session.sort_buffer_size
wait_timeout session.timeout.general
interactive_timeout session.timeout.interactive
engine.myisam.*
key_buffer_size engine.myisam.key_cache.size
key_cache_age_threshold engine.myisam.key_cache.age_threshold
key_cache_block_size engine.myisam.key_cache.block_size
key_cache_division_limit engine.myisam.key_cache.division_limit
myisam_data_pointer_size engine.myisam.data_pointer_size
myisam_sort_buffer_size engine.myisam.repair.sort_buffer_size
myisam_repair_threads engine.myisam.repair.threads
myisam_stats_method engine.myisam.stats_method
read_buffer_size engine.myisam.read_buffer_size
read_rnd_buffer_size engine.myisam.read_rnd_buffer_size
engine.innodb.*
innodb_data_home_dir engine.innodb.data.home_dir
innodb_data_file_path engine.innodb.data.files
innodb_log_group_home_dir engine.innodb.log.home_dir
innodb_log_files_in_group engine.innodb.log.files_in_group
innodb_log_file_size engine.innodb.log.file_size
innodb_log_archive engine.innodb.log.archive
innodb_log_arch_dir engine.innodb.log.archive_dir
innodb_log_buffer_size engine.innodb.log.buffer_size
innodb_buffer_pool_size engine.innodb.buffer_pool.size
innodb_buffer_pool_awe_mem_mb engine.innodb.buffer_pool.awe_mem_mb
engine.heap.*
engine.archive.*
engine.ndb.*

Legacy support

In order to continue to support all of the old variable names, a new namespace would be created, called legacy.* and all of the old names for variables would be mapped into it. For the first major MySQL version that supports namespaces, any variable without a dot in it would be mapped to legacy.*, which would allow them to continue working. For the next major version, the legacy.* namespace could still be supported, but without the automatic mapping. In the future, the legacy.* namespace could be dropped completely.

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s