0

I have a server with 8gb ram and 4 cpus. I don't have enough time for testing and bench marking so I would like to get the advise of experts like you guys, let me know if something is wrong with my mysql config.

[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
#connection setting
max_connect_errors      = 10
max_connections         = 400
wait_timeout            = 60
connect_timeout         = 10
interactive_timeout     = 60
#cache setting
query_cache_limit       = 2M
query_cache_size        = 50M
query_cache_type        = 1
table_open_cache        = 5000
thread_cache_size       = 100

#buffer sizes
key_buffer_size         = 20M
sort_buffer_size        = 2M
read_buffer_size        = 2M
join_buffer_size        = 2M

#tmpdir / temp table sizes
tmp_table_size          = 256M
max_heap_table_size     = 256M

#misc. settings
default-storage-engine  = innoDB
datadir                 = /var/lib/mysql
skip-external-locking
server-id               = 1
open-files-limit        = 65535
max_allowed_packet      = 64M

#innodb settings
innodb_data_file_path     = ibdata1:10M:autoextend
innodb_thread_concurrency = 0
innodb_buffer_pool_size   = 4G
innodb_log_buffer_size    = 8M
innodb_file_per_table     = 1
log_error               = /var/log/mysql/error.log
log_slow_queries        = /var/log/mysql/mysql-slow.log
long_query_time         = 2

#log-queries-not-using-indexes
[mysqldump]
quick
[mysql]
[isamchk]
key_buffer              = 16M
!includedir /etc/mysql/conf.d/
2
  • only one wrong - no any information WHAT will do this server? it is not bad, average settings, and it will run sone time good for everything, but for give advise need at least understand - what class of task? Example - I can give You advice about InnoDB, but You plan use vicidial software, which still work by default on MyISAM ...
    – a_vlad
    Nov 17, 2015 at 9:14
  • Basic Settings.
    – Rick James
    Dec 3, 2015 at 2:52

1 Answer 1

1

I'd agree with comment that asks for "purpose" of the mysql instance though these days you get decent configuration in-built provided with my.cnf.

You should look to use them, my-large/huge/medium.cnf etc... I see you have query cache and this link will help you understand best value for it.

Checkout this blog post for configuring few important parameters. Finally I'd also like you to review this config wizard.

Again... none of this will give you exact and perfect config... Be ready to monitor and make according changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.