Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] 大家看看 windows2003 四核 4g内存 my.ini 优化设置是否正确

[复制链接]
秋叶321 发表于 2009-12-24 09:17:06 | 显示全部楼层 |阅读模式
  1. # MySQL Server Instance Configuration File
  2. # ----------------------------------------------------------------------
  3. # Generated by the MySQL Server Instance Configuration Wizard
  4. #
  5. #
  6. # Installation Instructions
  7. # ----------------------------------------------------------------------
  8. #
  9. # On Linux you can copy this file to /etc/my.cnf to set global options,
  10. # mysql-data-dir/my.cnf to set server-specific options
  11. # (@localstatedir@ for this installation) or to
  12. # ~/.my.cnf to set user-specific options.
  13. #
  14. # On Windows you should keep this file in the installation directory
  15. # of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
  16. # make sure the server reads the config file use the startup option
  17. # "--defaults-file".
  18. #
  19. # To run run the server from the command line, execute this in a
  20. # command line shell, e.g.
  21. # mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
  22. #
  23. # To install the server as a Windows service manually, execute this in a
  24. # command line shell, e.g.
  25. # mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
  26. #
  27. # And then execute this in a command line shell to start the server, e.g.
  28. # net start MySQLXY
  29. #
  30. #
  31. # Guildlines for editing this file
  32. # ----------------------------------------------------------------------
  33. #
  34. # In this file, you can use all long options that the program supports.
  35. # If you want to know the options a program supports, start the program
  36. # with the "--help" option.
  37. #
  38. # More detailed information about the individual options can also be
  39. # found in the manual.
  40. #
  41. #
  42. # CLIENT SECTION
  43. # ----------------------------------------------------------------------
  44. #
  45. # The following options will be read by MySQL client applications.
  46. # Note that only client applications shipped by MySQL are guaranteed
  47. # to read this section. If you want your own MySQL client program to
  48. # honor these values, you need to specify it as an option during the
  49. # MySQL client library initialization.
  50. #
  51. [client]

  52. port=3306

  53. [mysql]

  54. default-character-set=latin1


  55. # SERVER SECTION
  56. # ----------------------------------------------------------------------
  57. #
  58. # The following options will be read by the MySQL Server. Make sure that
  59. # you have installed the server correctly (see above) so it reads this
  60. # file.
  61. #
  62. [mysqld]

  63. # The TCP/IP Port the MySQL Server will listen on
  64. port=3306


  65. #Path to installation directory. All paths are usually resolved relative to this.
  66. basedir="c:/mysql/"

  67. #Path to the database root
  68. datadir="c:/mysql/Data/"

  69. # The default character set that will be used when a new schema or table is
  70. # created and no character set is defined
  71. default-character-set=latin1

  72. # The default storage engine that will be used when create new tables when
  73. default-storage-engine=INNODB

  74. # Set the SQL mode to strict
  75. sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

  76. # The maximum amount of concurrent sessions the MySQL server will
  77. # allow. One of these connections will be reserved for a user with
  78. # SUPER privileges to allow the administrator to login even if the
  79. # connection limit has been reached.
  80. max_connections=100

  81. # Query cache is used to cache SELECT results and later return them
  82. # without actual executing the same query once again. Having the query
  83. # cache enabled may result in significant speed improvements, if your
  84. # have a lot of identical queries and rarely changing tables. See the
  85. # "Qcache_lowmem_prunes" status variable to check if the current value
  86. # is high enough for your load.
  87. # Note: In case your tables change very often or if your queries are
  88. # textually different every time, the query cache may result in a
  89. # slowdown instead of a performance improvement.
  90. query_cache_size=8M

  91. # The number of open tables for all threads. Increasing this value
  92. # increases the number of file descriptors that mysqld requires.
  93. # Therefore you have to make sure to set the amount of open files
  94. # allowed to at least 4096 in the variable "open-files-limit" in
  95. # section [mysqld_safe]
  96. table_cache=2048

  97. # Maximum size for internal (in-memory) temporary tables. If a table
  98. # grows larger than this value, it is automatically converted to disk
  99. # based table This limitation is for a single table. There can be many
  100. # of them.
  101. tmp_table_size=256M


  102. # How many threads we should keep in a cache for reuse. When a client
  103. # disconnects, the client's threads are put in the cache if there aren't
  104. # more than thread_cache_size threads from before.  This greatly reduces
  105. # the amount of thread creations needed if you have a lot of new
  106. # connections. (Normally this doesn't give a notable performance
  107. # improvement if you have a good thread implementation.)
  108. thread_cache_size=120

  109. #*** MyISAM Specific options

  110. # The maximum size of the temporary file MySQL is allowed to use while
  111. # recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
  112. # If the file-size would be bigger than this, the index will be created
  113. # through the key cache (which is slower).
  114. myisam_max_sort_file_size=100G

  115. # If the temporary file used for fast index creation would be bigger
  116. # than using the key cache by the amount specified here, then prefer the
  117. # key cache method.  This is mainly used to force long character keys in
  118. # large tables to use the slower key cache method to create the index.
  119. myisam_max_extra_sort_file_size=100G

  120. # If the temporary file used for fast index creation would be bigger
  121. # than using the key cache by the amount specified here, then prefer the
  122. # key cache method.  This is mainly used to force long character keys in
  123. # large tables to use the slower key cache method to create the index.
  124. myisam_sort_buffer_size=64M

  125. # Size of the Key Buffer, used to cache index blocks for MyISAM tables.
  126. # Do not set it larger than 30% of your available memory, as some memory
  127. # is also required by the OS to cache rows. Even if you're not using
  128. # MyISAM tables, you should still set it to 8-64M as it will also be
  129. # used for internal temporary disk tables.
  130. key_buffer_size=256M

  131. # Size of the buffer used for doing full table scans of MyISAM tables.
  132. # Allocated per thread, if a full scan is needed.
  133. read_buffer_size=8m
  134. read_rnd_buffer_size=32m

  135. # This buffer is allocated when MySQL needs to rebuild the index in
  136. # REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE
  137. # into an empty table. It is allocated per thread so be careful with
  138. # large settings.
  139. sort_buffer_size=212K


  140. #*** INNODB Specific options ***


  141. # Use this option if you have a MySQL server with InnoDB support enabled
  142. # but you do not plan to use it. This will save memory and disk space
  143. # and speed up some things.
  144. #skip-innodb

  145. # Additional memory pool that is used by InnoDB to store metadata
  146. # information.  If InnoDB requires more memory for this purpose it will
  147. # start to allocate it from the OS.  As this is fast enough on most
  148. # recent operating systems, you normally do not need to change this
  149. # value. SHOW INNODB STATUS will display the current amount used.
  150. innodb_additional_mem_pool_size=8M

  151. # If set to 1, InnoDB will flush (fsync) the transaction logs to the
  152. # disk at each commit, which offers full ACID behavior. If you are
  153. # willing to compromise this safety, and you are running small
  154. # transactions, you may set this to 0 or 2 to reduce disk I/O to the
  155. # logs. Value 0 means that the log is only written to the log file and
  156. # the log file flushed to disk approximately once per second. Value 2
  157. # means the log is written to the log file at each commit, but the log
  158. # file is only flushed to disk approximately once per second.
  159. innodb_flush_log_at_trx_commit=0

  160. # The size of the buffer InnoDB uses for buffering log data. As soon as
  161. # it is full, InnoDB will have to flush it to disk. As it is flushed
  162. # once per second anyway, it does not make sense to have it very large
  163. # (even with long transactions).
  164. innodb_log_buffer_size=4M

  165. # InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
  166. # row data. The bigger you set this the less disk I/O is needed to
  167. # access data in tables. On a dedicated database server you may set this
  168. # parameter up to 80% of the machine physical memory size. Do not set it
  169. # too large, though, because competition of the physical memory may
  170. # cause paging in the operating system.  Note that on 32bit systems you
  171. # might be limited to 2-3.5G of user level memory per process, so do not
  172. # set it too high.
  173. innodb_buffer_pool_size=8M

  174. # Size of each log file in a log group. You should set the combined size
  175. # of log files to about 25%-100% of your buffer pool size to avoid
  176. # unneeded buffer pool flush activity on log file overwrite. However,
  177. # note that a larger logfile size will increase the time needed for the
  178. # recovery process.
  179. innodb_log_file_size=10M

  180. # Number of threads allowed inside the InnoDB kernel. The optimal value
  181. # depends highly on the application, hardware as well as the OS
  182. # scheduler properties. A too high value may lead to thread thrashing.
  183. innodb_thread_concurrency=18
复制代码
感觉此设置主要是针对双核+2g内存的 哪位高手帮助配置一下,谢谢
Discuz_Safe 发表于 2009-12-24 09:32:49 | 显示全部楼层
本帖最后由 Discuz_Safe 于 2009-12-24 15:31 编辑

用2003简直是浪费硬件.而且跑不出极限数据
-------------------------------------------------
换操作平台 2008 R2
IIS 7.5
PHP5.2.12
MySQL 5.1.X
回复

使用道具 举报

 楼主| 秋叶321 发表于 2009-12-24 15:08:27 | 显示全部楼层
回复

使用道具 举报

 楼主| 秋叶321 发表于 2009-12-25 10:16:27 | 显示全部楼层
eeeeeeeeeeeeeeee
回复

使用道具 举报

wpf20001216 发表于 2010-1-3 18:46:55 | 显示全部楼层
100G    64M
用的上innodb?
连接数直接开到1024吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-17 00:48 , Processed in 0.025752 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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