• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

my.cnf set-variables

C

corman420

Guest
I have a CentOS 5 installation with Plesk 8.6. I am optimizing my configuration files. I have noticed in the my.cnf file, that I used "set-variable=" in front of every variable. I am just wondering - do I need this?

After spending alot of time optimizing, here is my new my.cnf file:
Code:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
#skip-name-resolve
safe-show-database
#old_passwords
back_log = 50
skip-innodb
max_connections = 500
key_buffer_size = 128M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 4000
thread_cache_size = 256
wait_timeout = 20
connect_timeout = 10
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
net_buffer_length = 16384
max_connect_errors = 100000
thread_concurrency = 8
concurrent_insert = 2
table_lock_wait_timeout = 30
read_rnd_buffer_size = 786432
bulk_insert_buffer_size = 8M
query_cache_limit = 4M
query_cache_size = 80M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65536
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
default-storage-engine = MyISAM
max_write_lock_count = 8

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
nice = -10
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 16M

[myisamchk]
key_buffer = 384M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

And here is my OLD my.cnf file (notice how I used set-variable=):
Code:
[mysqld]
set-variable=local-infile=0
# skip-networking
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
 
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
set-variable=max_connections=500
set-variable=key_buffer=96M
set-variable=myisam_sort_buffer_size=64M
set-variable=join_buffer_size=1M
set-variable=read_buffer_size=1M
set-variable=sort_buffer_size=2M
set-variable=table_cache=4000
set-variable=thread_cache_size=128
set-variable=wait_timeout=35
set-variable=connect_timeout=10
set-variable=tmp_table_size=64M
set-variable=max_heap_table_size=64M
set-variable=max_allowed_packet=64M
set-variable=max_connect_errors=10
set-variable=thread_concurrency=8
set-variable=concurrent_insert=2
set-variable=max_allowed_packet=64M
set-variable=max_connect_errors=10
set-variable=table_lock_wait_timeout=30
set-variable=read_rnd_buffer_size=786432
set-variable=bulk_insert_buffer_size=8M
set-variable=query_cache_limit=4M
set-variable=query_cache_size=64M
set-variable=query_cache_type=1
set-variable=query_prealloc_size=262144
set-variable=query_alloc_block_size=65536
set-variable=transaction_alloc_block_size=8192
set-variable=transaction_prealloc_size=4096
set-variable=default-storage-engine=MyISAM
 
 
# To allow mysqld to connect to a MySQL Cluster management daemon, uncomment
# these lines and adjust the connectstring as needed.
#ndbcluster
#ndb-connectstring="nodeid=4;host=localhost:1186"
 
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
nice = -5
open_files_limit = 8192
 
[mysqldump]
quick
max_allowed_packet = 16M
 
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
 
[ndbd]
# If you are running a MySQL Cluster storage daemon (ndbd) on this machine,
# adjust its connection to the management daemon here.
# Note: ndbd init script requires this to include nodeid!
connect-string="nodeid=2;host=localhost:1186"
 
[ndb_mgm]
# connection string for MySQL Cluster management tool
connect-string="host=localhost:1186"
 
No, you don't need set-variable anymore. At least not with MySQL 5, which comes with CentOS 5. I don't know since what version of MySQL exactly this is, but I believe it's been quite a while.
 
Back
Top