Tuning Server Parameters
722
read_buffer_size 131072
read_only FALSE
read_rnd_buffer_size 262144
record_buffer 131072
relay_log_purge TRUE
relay_log_space_limit 0
slave_compressed_protocol FALSE
slave_net_timeout 3600
slave_transaction_retries 10
slow_launch_time 2
sort_buffer_size 2097144
sync-binlog 0
sync-frm TRUE
table_cache 64
table_lock_wait_timeout 50
thread_cache_size 0
thread_concurrency 10
thread_stack 262144
time_format (No default value)
tmp_table_size 33554432
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
updatable_views_with_limit 1
wait_timeout 28800
For a
mysqld
server that is currently running, you can see the current values of its system variables by
connecting to it and issuing this statement:
mysql>
SHOW VARIABLES;
You can also see some statistical and status indicators for a running server by issuing this statement:
mysql>
SHOW STATUS;
System variable and status information also can be obtained using
mysqladmin
:
shell>
mysqladmin variables
shell>
mysqladmin extended-status
For a full description of all system and status variables, see
Section 5.1.4, “Server System Variables”
,
and
Section 5.1.6, “Server Status Variables”
.
MySQL uses algorithms that are very scalable, so you can usually run with very little memory.
However, normally you get better performance by giving MySQL more memory.
When tuning a MySQL server, the two most important variables to configure are
key_buffer_size
[458]
and
table_cache
[498]
. 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:
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...