Home » Performance » MySQL » Mysql Server tuning
Mysql Server tuning [message #1449] Wed, 20 June 2007 16:25 Go to next message
mrmartin  is currently offline mrmartin
Messages: 4
Registered: June 2007
Junior Member
Hello, I am going to switch my mysql server configuration, and
I'd like to know what do you think about this configuration.

I have 2 servers, one (apache2, php5) and the otherone mysql (mysql-server 5.0.38, last debian version).

The mysqlserver specifications are.

3 disks 72GB SAS 15,000 rpm RAID 5
2 Dual Core Intel® Xeon® (2.66GHz, 1333 FSB)
4GB DIMM PC2-5300 (I know.. is too low Sad )

All tables are Innodb, and database have arround 90M now, but it will grow exponentially. Now have the "standar" mysql configuration and I ll change for this one.


[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
[mysqld]
port            = 3306
bind-address           = 192.168.1.2
socket          = /var/run/mysqld/mysqld.sock
skip-locking
key_buffer = 2048M
max_allowed_packet = 2M

max_connections = 800
table_cache = 5600
open_files_limit = 6000

sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 8M

thread_cache_size = 16

query_cache_size = 32M
thread_concurrency = 8
skip-name-resolve
log-bin=mysql-bin

innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
innodb_log_group_home_dir = /var/lib/mysql/
innodb_log_arch_dir = /var/lib/mysql/
innodb_buffer_pool_size = 2048M
innodb_additional_mem_pool_size = 20M
innodb_log_file_size = 500M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash




Thanks !

Martin
Re: Mysql Server tuning [message #1450 is a reply to message #1449 ] Thu, 21 June 2007 03:50 Go to previous messageGo to next message
Speeple  is currently offline Speeple
Messages: 91
Registered: August 2006
Member
Everything looks ok execept:

key_buffer = 2048M

You say it's a innodb heavy server, therefore lower key_buffer to 16/32Mb


Martin Gallagher | Speeple: The latest news
Re: Mysql Server tuning [message #1452 is a reply to message #1449 ] Thu, 21 June 2007 11:59 Go to previous messageGo to next message
mrmartin  is currently offline mrmartin
Messages: 4
Registered: June 2007
Junior Member
Oks.. key_buffer is only for myisam index.. so 32mb should be fine.

Thanks for your post!

any other comment?
Re: Mysql Server tuning [message #1453 is a reply to message #1452 ] Thu, 21 June 2007 13:06 Go to previous messageGo to next message
Speeple  is currently offline Speeple
Messages: 91
Registered: August 2006
Member
Max connections could be lowered, is there any reason that it is set so high?

Thread level variables would consume a lot of memory with 800 concurrent connections.

Might as well safe guard against that issue by lowering max connections with a more real world value.


Martin Gallagher | Speeple: The latest news
Re: Mysql Server tuning [message #1454 is a reply to message #1449 ] Thu, 21 June 2007 13:24 Go to previous messageGo to next message
mrmartin  is currently offline mrmartin
Messages: 4
Registered: June 2007
Junior Member
oks.. I talk with the dev-team and we think 600 should be enough

400 - apache
600 - mysql (there are some batch processes that will take up 50 connections max)

Should I have to change any other variable if I change the max_connections to 600?

Thanks.
Re: Mysql Server tuning [message #1464 is a reply to message #1449 ] Fri, 22 June 2007 10:21 Go to previous messageGo to next message
mrmartin  is currently offline mrmartin
Messages: 4
Registered: June 2007
Junior Member
Hllo! I try this configuration and I get this errors:

Jun 22 06:58:39 host1 mysqld_safe[9523]: started
Jun 22 06:58:39 host1 mysqld[9526]: InnoDB: Error: data file /var/lib/mysql/ibdata1 is of a different size


and

Jun 22 07:00:57 host1 mysqld[9847]: InnoDB: Error: log file /var/lib/mysql/ib_logfile0 is of different size 0 5242880 bytes
Jun 22 07:00:57 host1 mysqld[9847]: InnoDB: than specified in the .cnf file 0 524288000 bytes!


The solution was remove this lines (leave the default values).

innodb_log_file_size = 500M
innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend

Any idea how can I increment this values without server crashing?

Thanks !
Re: Mysql Server tuning [message #1465 is a reply to message #1449 ] Fri, 22 June 2007 11:10 Go to previous message
Speeple  is currently offline Speeple
Messages: 91
Registered: August 2006
Member
You're going to have to backup your databases to change the innodb_data_file_path variable. Backup, then change the variable, then import backup.

Altering the innodb_log_file_size can be achieved without backing up. What you need to do is stop the mysql instance, alter the config to the sizes you desire, then you need to remove the old log files:

rm -f ib_logfile*


Martin Gallagher | Speeple: The latest news
Previous Topic:Please help in increasing the speed of query
Next Topic:PRIMARY KEY or FOREIGN KEY?
Goto Forum:
  



Current Time: Fri Nov 21 01:34:04 EST 2008

Total time taken to generate the page: 0.03384 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge