设为首页收藏本站

ZMX - IT技术交流论坛 - 无限Perfect,追求梦想 - itzmx.com

 找回密码
 注册论坛

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

用百度帐号登录

只需两步,快速登录

搜索
查看: 3530|回复: 0

upupw的mysql主机配置文件优化my.ini

[复制链接]
 成长值: 351

签到天数: 4742 天

[LV.Master]伴坛终老

发表于 2017/3/2 17:56 | 显示全部楼层 |阅读模式 |Google Chrome 56.0.2924.87|Windows 8.1
天涯海角搜一下: 百度 谷歌 360 搜狗 有道 雅虎 必应 即刻
1.jpg
0级别
  1. [client]
  2. port=3306

  3. [mysql]
  4. default-character-set=utf8

  5. [mysqld]
  6. port=3306
  7. server_id=1
  8. character-set-server=utf8
  9. default-storage-engine=MYISAM
  10. sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  11. slow_query_log=0
  12. long_query_time=2
  13. local-infile=0
  14. skip-external-locking
  15. #skip-innodb
  16. #log-bin=mysql-bin
  17. #binlog_format=mixed

  18. max_connections=500
  19. key_buffer_size=32M
  20. sort_buffer_size=128kb
  21. read_buffer_size=256kb
  22. join_buffer_size=1M
  23. read_rnd_buffer_size=1M
  24. max_allowed_packet=16M
  25. table_open_cache=128
  26. tmp_table_size=32M
  27. max_heap_table_size=32M
  28. thread_cache_size=16

  29. myisam_max_sort_file_size=64G
  30. myisam_sort_buffer_size=8M

  31. innodb_buffer_pool_size=32M
  32. innodb_log_file_size=8M
  33. innodb_log_buffer_size=1M
  34. innodb_file_per_table=1
  35. innodb_flush_log_at_trx_commit=1
  36. innodb_thread_concurrency=0
  37. innodb_lock_wait_timeout=50

  38. [mysqldump]
  39. quick
  40. max_allowed_packet=16M

  41. [mysql]
  42. no-auto-rehash

  43. [myisamchk]
  44. key_buffer_size=10M
  45. sort_buffer_size=10M
  46. read_buffer=1M
  47. write_buffer=1M

  48. [mysqlhotcopy]
  49. interactive-timeout

  50. [mysqld_safe]
  51. open-files-limit=8192
复制代码



1级别
  1. [client]
  2. port=3306

  3. [mysql]
  4. default-character-set=utf8

  5. [mysqld]
  6. port=3306
  7. server_id=1
  8. character-set-server=utf8
  9. default-storage-engine=MYISAM
  10. sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  11. slow_query_log=0
  12. long_query_time=2
  13. local-infile=0
  14. skip-external-locking
  15. #skip-innodb
  16. #log-bin=mysql-bin
  17. #binlog_format=mixed

  18. max_connections=1000
  19. key_buffer_size=64M
  20. sort_buffer_size=256kb
  21. read_buffer_size=512kb
  22. join_buffer_size=2M
  23. read_rnd_buffer_size=2M
  24. max_allowed_packet=16M
  25. table_open_cache=256
  26. tmp_table_size=64M
  27. max_heap_table_size=64M
  28. thread_cache_size=16

  29. myisam_max_sort_file_size=64G
  30. myisam_sort_buffer_size=32M

  31. innodb_buffer_pool_size=64M
  32. innodb_log_file_size=16M
  33. innodb_log_buffer_size=2M
  34. innodb_file_per_table=1
  35. innodb_flush_log_at_trx_commit=1
  36. innodb_thread_concurrency=0
  37. innodb_lock_wait_timeout=50

  38. [mysqldump]
  39. quick
  40. max_allowed_packet=16M

  41. [mysql]
  42. no-auto-rehash

  43. [myisamchk]
  44. key_buffer_size=20M
  45. sort_buffer_size=20M
  46. read_buffer=2M
  47. write_buffer=2M

  48. [mysqlhotcopy]
  49. interactive-timeout

  50. [mysqld_safe]
  51. open-files-limit=8192
复制代码


2级别
  1. [client]
  2. port=3306

  3. [mysql]
  4. default-character-set=utf8

  5. [mysqld]
  6. port=3306
  7. server_id=1
  8. character-set-server=utf8
  9. default-storage-engine=INNODB
  10. sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  11. slow_query_log=0
  12. long_query_time=2
  13. local-infile=0
  14. skip-external-locking
  15. #log-bin=mysql-bin
  16. #binlog_format=mixed

  17. max_connections=2000
  18. key_buffer_size=256M
  19. sort_buffer_size=1M
  20. read_buffer_size=2M
  21. join_buffer_size=4M
  22. read_rnd_buffer_size=4M
  23. max_allowed_packet=32M
  24. table_open_cache=512
  25. tmp_table_size=128M
  26. max_heap_table_size=128M
  27. thread_cache_size=16

  28. myisam_max_sort_file_size=64G
  29. myisam_sort_buffer_size=64M

  30. innodb_buffer_pool_size=256M
  31. innodb_log_file_size=64M
  32. innodb_log_buffer_size=8M
  33. innodb_file_per_table=1
  34. innodb_flush_log_at_trx_commit=1
  35. innodb_thread_concurrency=0
  36. innodb_lock_wait_timeout=50

  37. [mysqldump]
  38. quick
  39. max_allowed_packet=16M

  40. [mysql]
  41. no-auto-rehash

  42. [myisamchk]
  43. key_buffer_size=40M
  44. sort_buffer_size=40M
  45. read_buffer=4M
  46. write_buffer=4M

  47. [mysqlhotcopy]
  48. interactive-timeout

  49. [mysqld_safe]
  50. open-files-limit=8192
复制代码


3级别
  1. [client]
  2. port=3306

  3. [mysql]
  4. default-character-set=utf8

  5. [mysqld]
  6. port=3306
  7. server_id=1
  8. character-set-server=utf8
  9. default-storage-engine=INNODB
  10. sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  11. slow_query_log=0
  12. long_query_time=2
  13. local-infile=0
  14. skip-external-locking
  15. #log-bin=mysql-bin
  16. #binlog_format=mixed

  17. max_connections=3000
  18. key_buffer_size=512M
  19. sort_buffer_size=1M
  20. read_buffer_size=4M
  21. join_buffer_size=8M
  22. read_rnd_buffer_size=8M
  23. max_allowed_packet=64M
  24. table_open_cache=1024
  25. tmp_table_size=256M
  26. max_heap_table_size=256M
  27. thread_cache_size=16

  28. myisam_max_sort_file_size=64G
  29. myisam_sort_buffer_size=128M

  30. innodb_buffer_pool_size=512M
  31. innodb_log_file_size=128M
  32. innodb_log_buffer_size=16M
  33. innodb_file_per_table=1
  34. innodb_flush_log_at_trx_commit=1
  35. innodb_thread_concurrency=0
  36. innodb_lock_wait_timeout=50

  37. [mysqldump]
  38. quick
  39. max_allowed_packet=16M

  40. [mysql]
  41. no-auto-rehash

  42. [myisamchk]
  43. key_buffer_size=80M
  44. sort_buffer_size=80M
  45. read_buffer=8M
  46. write_buffer=8M

  47. [mysqlhotcopy]
  48. interactive-timeout

  49. [mysqld_safe]
  50. open-files-limit=8192
复制代码



一般来说table_open_cache 是最终影响CPU性能的,可以适当调大,比如说2048,值越大时内存使用量越高

欢迎光临IT技术交流论坛:http://bbs.itzmx.com/
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册论坛 新浪微博账号登陆用百度帐号登录

本版积分规则

手机版|Archiver|Mail me|网站地图|IT技术交流论坛 ( 闽ICP备13013206号-7 )

GMT+8, 2024/12/28 02:07 , Processed in 0.146547 second(s), 26 queries , MemCache On.

Powered by itzmx! X3.4

© 2011- sakura

快速回复 返回顶部 返回列表