容器技术交流

 找回密码
 立即注册
查看: 3026|回复: 5

请教洞哥,famp的mysql的my.ini 在那里??找了半天我也没找到

[复制链接]
发表于 2009-5-16 01:06:17 | 显示全部楼层 |阅读模式
FREEBSD系统下的mysql没有这个文件吗/
 楼主| 发表于 2009-5-16 01:06:44 | 显示全部楼层
如果卢优化一下mysql的性能, 是改这个文件吗??
大至有那些可行的办法来提高mysql的性能??
发表于 2009-5-16 01:15:30 | 显示全部楼层
/etc/my.cnf
 楼主| 发表于 2009-5-16 01:17:32 | 显示全部楼层
洞哥, 如果要优化mysql性能的话, 大概要改什么参数呢??
服务器主要跑论坛, 现在论坛一天发贴量在2W左右
cpu进程主要mysql进程高,大概占百分之10
php-fcgi和nginx的进程基本上占用不到百分之二
 楼主| 发表于 2009-5-16 01:19:39 | 显示全部楼层
  1. ghhhj# cat my.cnf
  2. # Example MySQL config file for very large systems.
  3. #
  4. # This is for a large system with memory of 1G-2G where the system runs mainly
  5. # MySQL.
  6. #
  7. # You can copy this file to
  8. # /etc/my.cnf to set global options,
  9. # mysql-data-dir/my.cnf to set server-specific options (in this
  10. # installation this directory is /usr/local/mysql/var) or
  11. # ~/.my.cnf to set user-specific options.
  12. #
  13. # In this file, you can use all long options that a program supports.
  14. # If you want to know which options a program supports, run the program
  15. # with the "--help" option.

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

  21. # Here follows entries for some specific programs

  22. # The MySQL server
  23. [mysqld]
  24. port = 3306
  25. socket = /tmp/mysql.sock
  26. skip-locking
  27. key_buffer = 512M
  28. max_allowed_packet = 1M
  29. table_cache = 512
  30. sort_buffer_size = 4M
  31. read_buffer_size = 4M
  32. read_rnd_buffer_size = 16M
  33. myisam_sort_buffer_size = 128M
  34. thread_cache_size = 12
  35. query_cache_size = 48M
  36. # Try number of CPU's*2 for thread_concurrency
  37. thread_concurrency = 12

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

  45. # Replication Master Server (default)
  46. # binary logging is required for replication
  47. #log-bin=mysql-bin

  48. # required unique id between 1 and 2^32 - 1
  49. # defaults to 1 if master-host is not set
  50. # but will not function as a master if omitted
  51. server-id = 1

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

  106. # Point the following paths to different dedicated disks
  107. #tmpdir = /tmp/
  108. #log-update = /path-to-dedicated-directory/hostname

  109. # Uncomment the following if you are using BDB tables
  110. #bdb_cache_size = 384M
  111. #bdb_max_lock = 100000

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

  126. [mysqldump]
  127. quick
  128. max_allowed_packet = 16M

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

  133. [isamchk]
  134. key_buffer = 256M
  135. sort_buffer_size = 320M
  136. read_buffer = 4M
  137. write_buffer = 4M

  138. [myisamchk]
  139. key_buffer = 256M
  140. sort_buffer_size = 320M
  141. read_buffer = 4M
  142. write_buffer = 4M

  143. [mysqlhotcopy]
  144. interactive-timeout
  145. ghhhj#
复制代码
发表于 2009-5-16 20:26:41 | 显示全部楼层
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2024-5-5 00:32 , Processed in 0.033488 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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