全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1270|回复: 6
打印 上一主题 下一主题

8G8H内存的阿里云服务器,请各位帮忙看看mysql设置合理不?

[复制链接]
跳转到指定楼层
1#
发表于 2018-6-7 15:24:21 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 amo 于 2018-6-7 15:25 编辑

OS:CentOS 6.5
Nginx:1.0.15
MySQL:5.1.69
  1. # Example MySQL config file for very large systems.
  2. #
  3. # This is for a large system with memory of 1G-2G where the system runs mainly
  4. # MySQL.
  5. #
  6. # MySQL programs look for option files in a set of
  7. # locations which depend on the deployment platform.
  8. # You can copy this option file to one of those
  9. # locations. For information about these locations, see:
  10. # http://dev.mysql.com/doc/mysql/en/option-files.html
  11. #
  12. # In this file, you can use all long options that a program supports.
  13. # If you want to know which options a program supports, run the program
  14. # with the "--help" option.

  15. # The following options will be passed to all MySQL clients
  16. [client]
  17. #password        = your_password
  18. port                = 3306
  19. socket                = /tmp/mysql.sock

  20. # Here follows entries for some specific programs

  21. # The MySQL server
  22. [mysqld]

  23. #lum_config_start
  24. wait_timeout=888888
  25. interactive_timeout=888888
  26. max_connections=1000
  27. back_log=500
  28. key_buffer_size=3840MB
  29. sort_buffer_size=32MB
  30. read_buffer_size=32MB
  31. join_buffer_size=2MB
  32. thread_cache_size=32
  33. query_cache_size=256MB
  34. #lum_config_end

  35. port                = 3306
  36. socket                = /tmp/mysql.sock
  37. skip-locking

  38. max_allowed_packet = 1M
  39. table_open_cache = 512


  40. read_rnd_buffer_size = 8M
  41. myisam_sort_buffer_size = 64M


  42. # Try number of CPU's*2 for thread_concurrency
  43. thread_concurrency = 8

  44. # Don't listen on a TCP/IP port at all. This can be a security enhancement,
  45. # if all processes that need to connect to mysqld run on the same host.
  46. # All interaction with mysqld must be made via Unix sockets or named pipes.
  47. # Note that using this option without enabling named pipes on Windows
  48. # (via the "enable-named-pipe" option) will render mysqld useless!
  49. #
  50. #skip-networking

  51. # Replication Master Server (default)
  52. # binary logging is required for replication
  53. log-bin=mysql-bin

  54. # required unique id between 1 and 2^32 - 1
  55. # defaults to 1 if master-host is not set
  56. # but will not function as a master if omitted
  57. server-id        = 1

  58. # Replication Slave (comment out master section to use this)
  59. #
  60. # To configure this host as a replication slave, you can choose between
  61. # two methods :
  62. #
  63. # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
  64. #    the syntax is:
  65. #
  66. #    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
  67. #    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
  68. #
  69. #    where you replace <host>, <user>, <password> by quoted strings and
  70. #    <port> by the master's port number (3306 by default).
  71. #
  72. #    Example:
  73. #
  74. #    CHANGE MASTER TO MASTER_HOST='*.*.*.*', MASTER_PORT=3306,
  75. #    MASTER_USER='joe', MASTER_PASSWORD='secret';
  76. #
  77. # OR
  78. #
  79. # 2) Set the variables below. However, in case you choose this method, then
  80. #    start replication for the first time (even unsuccessfully, for example
  81. #    if you mistyped the password in master-password and the slave fails to
  82. #    connect), the slave will create a master.info file, and any later
  83. #    change in this file to the variables' values below will be ignored and
  84. #    overridden by the content of the master.info file, unless you shutdown
  85. #    the slave server, delete master.info and restart the slaver server.
  86. #    For that reason, you may want to leave the lines below untouched
  87. #    (commented) and instead use CHANGE MASTER TO (see above)
  88. #
  89. # required unique id between 2 and 2^32 - 1
  90. # (and different from the master)
  91. # defaults to 2 if master-host is set
  92. # but will not function as a slave if omitted
  93. #server-id       = 2
  94. #
  95. # The replication master for this slave - required
  96. #master-host     =   <hostname>
  97. #
  98. # The username the slave will use for authentication when connecting
  99. # to the master - required
  100. #master-user     =   <username>
  101. #
  102. # The password the slave will authenticate with when connecting to
  103. # the master - required
  104. #master-password =   <password>
  105. #
  106. # The port the master is listening on.
  107. # optional - defaults to 3306
  108. #master-port     =  <port>
  109. #
  110. # binary logging - not required for slaves, but recommended
  111. #log-bin=mysql-bin
  112. #
  113. # binary logging format - mixed recommended
  114. #binlog_format=mixed

  115. # Uncomment the following if you are using InnoDB tables
  116. #innodb_data_home_dir = /usr/local/mysql/var
  117. #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
  118. #innodb_log_group_home_dir = /usr/local/mysql/var
  119. # You can set .._buffer_pool_size up to 50 - 80 %
  120. # of RAM but beware of setting memory usage too high
  121. #innodb_buffer_pool_size = 384M
  122. #innodb_additional_mem_pool_size = 20M
  123. # Set .._log_file_size to 25 % of buffer pool size
  124. #innodb_log_file_size = 100M
  125. #innodb_log_buffer_size = 8M
  126. #innodb_flush_log_at_trx_commit = 1
  127. #innodb_lock_wait_timeout = 50

  128. [mysqldump]
  129. quick
  130. max_allowed_packet = 16M

  131. [mysql]
  132. no-auto-rehash
  133. # Remove the next comment character if you are not familiar with SQL
  134. #safe-updates

  135. [myisamchk]


  136. read_buffer = 2M
  137. write_buffer = 2M

  138. [mysqlhotcopy]
  139. interactive-timeout
复制代码
7#
发表于 2018-6-7 17:17:01 来自手机 | 只看该作者
花钱买云数据库
6#
 楼主| 发表于 2018-6-7 16:33:19 | 只看该作者
几年前的服务器了,上面东西很多,不好迁移啊 怕出问题。。
另外关于mysql优化网上说法千人千面。。
http://www.jb51.net/article/119515.htm
https://**blogs.com/52php/p/5675350.html
https://www.linuxidc.com/Linux/2017-07/145868.htm
http://www.jb51.net/article/83569.htm
好纠结
5#
发表于 2018-6-7 16:14:10 | 只看该作者
上centos7和mysql5.7吧、、、、
4#
发表于 2018-6-7 16:11:35 | 只看该作者
楼上说的对,当然,如果早期数据需要迁移,用的是这个版本,那还是继续用吧
3#
发表于 2018-6-7 16:10:55 来自手机 | 只看该作者
5.1。。都8.0了。最起码也5
2#
发表于 2018-6-7 15:42:49 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2026-1-13 18:08 , Processed in 0.068549 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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