国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

企業情況下MySQL5.5調優

2024-07-24 12:32:45
字體:
來源:轉載
供稿:網友
        
       參照 騰訊云 和ucloud my.cnf 以及網上找的資料
       整理出來的 my.cnf , 以后修改任何參數都會繼續更新
      也是在測試階段
      物理機 : ubuntu14.04 配置 8core 32G
       mysql : 5.5.62
 
調優配置
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
default-character-set = utf8
[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
[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
skip-external-locking
key_buffer             = 256M
max_allowed_packet     = 1073741824
thread_stack           = 512K
thread_cache_size      = 50
max_connections        = 5000
max_connect_errors     = 1000000
table_cache            = 4096
max_heap_table_size    = 128M
open_files_limit       = 102400
back_log               = 2000
thread_concurrency     = 20
sort_buffer_size       = 524288
ft_min_word_len        = 4
query_cache_size       = 0
log_error                          = /var/log/mysql/error.log
log_slow_queries                   = /var/log/mysql/mysql-slow.log
long_query_time                    = 3
server-id                          = 1
log_bin                            = /var/log/mysql/mysql-bin.log
expire_logs_days                   = 2
tmp_table_size                     = 4294967295
#default_table_type                = InnoDB
#loose-skip-bdb
default-storage-engine             =InnoDB
innodb_file_format=barracuda
#ROW_FORMAT=COMPRESSED
innodb_additional_mem_pool_size    = 64M
innodb_buffer_pool_size            = 6G
innodb_data_file_path              = ibdata1:128M:autoextend
innodb_read_io_threads             = 8
innodb_write_io_threads            = 8
innodb_thread_concurrency          = 20
innodb_flush_log_at_trx_commit     = 2
innodb_log_buffer_size             = 8388608
innodb_log_file_size               = 512M
innodb_log_files_in_group          = 3
innodb_max_dirty_pages_pct         = 90
innodb_lock_wait_timeout           = 120
[mysqldump]
quick
quote-names
max_allowed_packet                 = 1073741824
[mysql]
default-character-set              = utf8
[isamchk]
key_buffer                         = 256M
!includedir /etc/mysql/conf.d/
附一些參數的簡單解釋
 
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0
open-files-limit = 8192   #增加每個進程的可打開文件數量
[mysqld]
#
# * Basic Settings
#
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          #記錄msyql臨時文件
#back_log        = 300   
lc-messages-dir = /usr/share/mysql
skip-external-locking    #允許外部文件級別的鎖. 打開文件鎖會對性能造成負面影響
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address       = 0.0.0.0   #控制可連接數據庫的 客戶端
#
# * Fine Tuning
 
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
[myisamchk]
key_buffer             = 2048M
sort_buffer_size       = 2048M
read_buffer            = 32M
write_buffer           = 32M
[mysqlhotcopy]
interactive-timeout
!includedir /etc/mysql/conf.d/

(編輯:武林網)

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 滦平县| 铁岭市| 沈丘县| 扎鲁特旗| 教育| 成安县| 大化| 高平市| 岳普湖县| 青铜峡市| 潢川县| 安达市| 确山县| 五原县| 平谷区| 泗洪县| 启东市| 商河县| 涡阳县| 阿尔山市| 保德县| 托里县| 芦山县| 东莞市| 萨迦县| 崇文区| 涿州市| 沾化县| 西和县| 合江县| 镶黄旗| 安图县| 镇原县| 安新县| 巴楚县| 延安市| 凤凰县| 武宣县| 诸暨市| 东乡族自治县| 凤山县|