mysql5.0.75优化配置

服务器是2950,16G内存,raid10,数据有9G多,有innodb,有myisam,以innodb居多。

[client]
#password       = [your_password]
port            = 3306
socket          = /tmp/mysql.sock

[mysqld]
# generic configuration options
port            = 3306
socket          = /tmp/mysql.sock
skip-locking

#以下两项是让mysql不使用交换分区
 memlock  
 innodb_flush_method=O_DIRECT

skip-name-resolve
bind_address=192.168.0.187
back_log = 64
max_connections = 500
max_connect_errors = 10
table_cache = 4096
max_allowed_packet = 16M
binlog_cache_size = 1M
max_heap_table_size = 128M
sort_buffer_size = 16M
join_buffer_size = 16M
thread_cache_size = 64
thread_concurrency = 8
query_cache_size = 256M
query_cache_limit = 4M
query_cache_type = 1
ft_min_word_len = 4
default_table_type = MYISAM
thread_stack = 256K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 128M
log-bin=mysql-bin
expire_logs_days = 10
log_slow_queries = slow.log
log-queries-not-using-indexes
long_query_time = 2
log_long_format
tmpdir = /tmp
server-id = 1
key_buffer_size = 768M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_max_extra_sort_file_size = 10G
myisam_repair_threads = 1
# Automatically check and repair not properly closed MyISAM tables.
myisam_recover

# Disable Federated by default
skip-federated
skip-bdb
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 5G
innodb_data_file_path = ibdata1:5000M;ibdata2:3000M:autoextend
innodb_data_home_dir = /opt/app/mysql/var
innodb_file_io_threads = 4
innodb_thread_concurrency = 0
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 8M
innodb_log_file_size = 512M
# Total number of files in the log group. A value of 2-3 is usually good
# enough.
innodb_log_files_in_group = 3
# Location of the InnoDB log files. Default is the MySQL datadir. You
# may wish to point it to a dedicated hard drive or a RAID1 volume for
# improved performance
innodb_log_group_home_dir=/opt/app/mysql/var
innodb_log_arch_dir=/opt/app/mysql/var
innodb_max_dirty_pages_pct = 90
# The flush method InnoDB will use for Log. The tablespace always uses
# doublewrite flush logic. The default value is "fdatasync", another
# option is "O_DSYNC".
#innodb_flush_method=O_DSYNC
innodb_lock_wait_timeout = 120
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值