Advertisement
Guest User

Untitled

a guest
Feb 5th, 2015
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.64 KB | None | 0 0
  1. #BEGIN CONFIG INFO
  2. #DESCR: 4GB RAM, InnoDB only, ACID, few connections, heavy queries
  3. #TYPE: SYSTEM
  4. #END CONFIG INFO
  5.  
  6. [client]
  7. port = 3306
  8. socket = /var/run/mysqld/mysqld.sock
  9.  
  10. [mysqld]
  11. port = 3306
  12. socket = /var/run/mysqld/mysqld.sock
  13. bind-address = 0.0.0.0
  14. # back_log is the number of connections the operating system can keep in
  15. # the listen queue, before the MySQL connection manager thread has
  16. # processed them. If you have a very high connection rate and experience
  17. # "connection refused" errors, you might need to increase this value.
  18. # Check your OS documentation for the maximum value of this parameter.
  19. # Attempting to set back_log higher than your operating system limit
  20. # will have no effect.
  21. back_log = 50
  22.  
  23. # Don't listen on a TCP/IP port at all. This can be a security
  24. # enhancement, if all processes that need to connect to mysqld run
  25. # on the same host. All interaction with mysqld must be made via Unix
  26. # sockets or named pipes.
  27. # Note that using this option without enabling named pipes on Windows
  28. # (via the "enable-named-pipe" option) will render mysqld useless!
  29. #skip-networking
  30.  
  31. # The maximum amount of concurrent sessions the MySQL server will
  32. # allow. One of these connections will be reserved for a user with
  33. # SUPER privileges to allow the administrator to login even if the
  34. # connection limit has been reached.
  35. max_connections = 100
  36.  
  37. # Maximum amount of errors allowed per host. If this limit is reached,
  38. # the host will be blocked from connecting to the MySQL server until
  39. # "FLUSH HOSTS" has been run or the server was restarted. Invalid
  40. # passwords and other errors during the connect phase result in
  41. # increasing this value. See the "Aborted_connects" status variable for
  42. # global counter.
  43. max_connect_errors = 10
  44.  
  45. # The number of open tables for all threads. Increasing this value
  46. # increases the number of file descriptors that mysqld requires.
  47. # Therefore you have to make sure to set the amount of open files
  48. # allowed to at least 4096 in the variable "open-files-limit" in
  49. # section [mysqld_safe]
  50. table_open_cache = 2048
  51.  
  52. # Enable external file level locking. Enabled file locking will have a
  53. # negative impact on performance, so only use it in case you have
  54. # multiple database instances running on the same files (note some
  55. # restrictions still apply!) or if you use other software relying on
  56. # locking MyISAM tables on file level.
  57. #external-locking
  58.  
  59. # The maximum size of a query packet the server can handle as well as
  60. # maximum query size server can process (Important when working with
  61. # large BLOBs). enlarged dynamically, for each connection.
  62. max_allowed_packet = 16M
  63.  
  64. # The size of the cache to hold the SQL statements for the binary log
  65. # during a transaction. If you often use big, multi-statement
  66. # transactions you can increase this value to get more performance. All
  67. # statements from transactions are buffered in the binary log cache and
  68. # are being written to the binary log at once after the COMMIT. If the
  69. # transaction is larger than this value, temporary file on disk is used
  70. # instead. This buffer is allocated per connection on first update
  71. # statement in transaction
  72. binlog_cache_size = 1M
  73.  
  74. # Maximum allowed size for a single HEAP (in memory) table. This option
  75. # is a protection against the accidential creation of a very large HEAP
  76. # table which could otherwise use up all memory resources.
  77. max_heap_table_size = 64M
  78.  
  79. # Size of the buffer used for doing full table scans.
  80. # Allocated per thread, if a full scan is needed.
  81. read_buffer_size = 2M
  82.  
  83. # When reading rows in sorted order after a sort, the rows are read
  84. # through this buffer to avoid disk seeks. You can improve ORDER BY
  85. # performance a lot, if set this to a high value.
  86. # Allocated per thread, when needed.
  87. read_rnd_buffer_size = 16M
  88.  
  89. # Sort buffer is used to perform sorts for some ORDER BY and GROUP BY
  90. # queries. If sorted data does not fit into the sort buffer, a disk
  91. # based merge sort is used instead - See the "Sort_merge_passes"
  92. # status variable. Allocated per thread if sort is needed.
  93. sort_buffer_size = 8M
  94.  
  95. # This buffer is used for the optimization of full JOINs (JOINs without
  96. # indexes). Such JOINs are very bad for performance in most cases
  97. # anyway, but setting this variable to a large value reduces the
  98. # performance impact. See the "Select_full_join" status variable for a
  99. # count of full JOINs. Allocated per thread if full join is found
  100. join_buffer_size = 8M
  101.  
  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 = 8
  109.  
  110. # This permits the application to give the threads system a hint for the
  111. # desired number of threads that should be run at the same time. This
  112. # value only makes sense on systems that support the thread_concurrency()
  113. # function call (Sun Solaris, for example).
  114. # You should try [number of CPUs]*(2..4) for thread_concurrency
  115. thread_concurrency = 8
  116.  
  117. # Query cache is used to cache SELECT results and later return them
  118. # without actual executing the same query once again. Having the query
  119. # cache enabled may result in significant speed improvements, if your
  120. # have a lot of identical queries and rarely changing tables. See the
  121. # "Qcache_lowmem_prunes" status variable to check if the current value
  122. # is high enough for your load.
  123. # Note: In case your tables change very often or if your queries are
  124. # textually different every time, the query cache may result in a
  125. # slowdown instead of a performance improvement.
  126. query_cache_size = 64M
  127.  
  128. # Only cache result sets that are smaller than this limit. This is to
  129. # protect the query cache of a very large result set overwriting all
  130. # other query results.
  131. query_cache_limit = 2M
  132.  
  133. # Minimum word length to be indexed by the full text search index.
  134. # You might wish to decrease it if you need to search for shorter words.
  135. # Note that you need to rebuild your FULLTEXT index, after you have
  136. # modified this value.
  137. ft_min_word_len = 4
  138.  
  139. # If your system supports the memlock() function call, you might want to
  140. # enable this option while running MySQL to keep it locked in memory and
  141. # to avoid potential swapping out in case of high memory pressure. Good
  142. # for performance.
  143. #memlock
  144.  
  145. # Table type which is used by default when creating new tables, if not
  146. # specified differently during the CREATE TABLE statement.
  147. default-storage-engine = MYISAM
  148.  
  149. # Thread stack size to use. This amount of memory is always reserved at
  150. # connection time. MySQL itself usually needs no more than 64K of
  151. # memory, while if you use your own stack hungry UDF functions or your
  152. # OS requires more stack for some operations, you might need to set this
  153. # to a higher value.
  154. thread_stack = 192K
  155.  
  156. # Set the default transaction isolation level. Levels available are:
  157. # READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
  158. transaction_isolation = REPEATABLE-READ
  159.  
  160. # Maximum size for internal (in-memory) temporary tables. If a table
  161. # grows larger than this value, it is automatically converted to disk
  162. # based table This limitation is for a single table. There can be many
  163. # of them.
  164. tmp_table_size = 64M
  165.  
  166. # Enable binary logging. This is required for acting as a MASTER in a
  167. # replication configuration. You also need the binary log if you need
  168. # the ability to do point in time recovery from your latest backup.
  169. log-bin=mysql-bin
  170.  
  171. # binary logging format - mixed recommended
  172. binlog_format=mixed
  173.  
  174. # If you're using replication with chained slaves (A->B->C), you need to
  175. # enable this option on server B. It enables logging of updates done by
  176. # the slave thread into the slave's binary log.
  177. #log_slave_updates
  178.  
  179. # Enable the full query log. Every query (even ones with incorrect
  180. # syntax) that the server receives will be logged. This is useful for
  181. # debugging, it is usually disabled in production use.
  182. #log
  183.  
  184. # Print warnings to the error log file. If you have any problem with
  185. # MySQL you should enable logging of warnings and examine the error log
  186. # for possible explanations.
  187. #log_warnings
  188.  
  189. # Log slow queries. Slow queries are queries which take more than the
  190. # amount of time defined in "long_query_time" or which do not use
  191. # indexes well, if log_short_format is not enabled. It is normally good idea
  192. # to have this turned on if you frequently add new queries to the
  193. # system.
  194. slow_query_log
  195.  
  196. # All queries taking more than this amount of time (in seconds) will be
  197. # trated as slow. Do not use "1" as a value here, as this will result in
  198. # even very fast queries being logged from time to time (as MySQL
  199. # currently measures time with second accuracy only).
  200. long_query_time = 2
  201.  
  202.  
  203. # *** Replication related settings
  204.  
  205.  
  206. # Unique server identification number between 1 and 2^32-1. This value
  207. # is required for both master and slave hosts. It defaults to 1 if
  208. # "master-host" is not set, but will MySQL will not function as a master
  209. # if it is omitted.
  210. server-id = 1
  211.  
  212. # Replication Slave (comment out master section to use this)
  213. #
  214. # To configure this host as a replication slave, you can choose between
  215. # two methods :
  216. #
  217. # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
  218. # the syntax is:
  219. #
  220. # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
  221. # MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
  222. #
  223. # where you replace <host>, <user>, <password> by quoted strings and
  224. # <port> by the master's port number (3306 by default).
  225. #
  226. # Example:
  227. #
  228. # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
  229. # MASTER_USER='joe', MASTER_PASSWORD='secret';
  230. #
  231. # OR
  232. #
  233. # 2) Set the variables below. However, in case you choose this method, then
  234. # start replication for the first time (even unsuccessfully, for example
  235. # if you mistyped the password in master-password and the slave fails to
  236. # connect), the slave will create a master.info file, and any later
  237. # changes in this file to the variable values below will be ignored and
  238. # overridden by the content of the master.info file, unless you shutdown
  239. # the slave server, delete master.info and restart the slaver server.
  240. # For that reason, you may want to leave the lines below untouched
  241. # (commented) and instead use CHANGE MASTER TO (see above)
  242. #
  243. # required unique id between 2 and 2^32 - 1
  244. # (and different from the master)
  245. # defaults to 2 if master-host is set
  246. # but will not function as a slave if omitted
  247. #server-id = 2
  248. #
  249. # The replication master for this slave - required
  250. #master-host = <hostname>
  251. #
  252. # The username the slave will use for authentication when connecting
  253. # to the master - required
  254. #master-user = <username>
  255. #
  256. # The password the slave will authenticate with when connecting to
  257. # the master - required
  258. #master-password = <password>
  259. #
  260. # The port the master is listening on.
  261. # optional - defaults to 3306
  262. #master-port = <port>
  263.  
  264. # Make the slave read-only. Only users with the SUPER privilege and the
  265. # replication slave thread will be able to modify data on it. You can
  266. # use this to ensure that no applications will accidently modify data on
  267. # the slave instead of the master
  268. #read_only
  269.  
  270.  
  271. #*** MyISAM Specific options
  272.  
  273.  
  274. # Size of the Key Buffer, used to cache index blocks for MyISAM tables.
  275. # Do not set it larger than 30% of your available memory, as some memory
  276. # is also required by the OS to cache rows. Even if you're not using
  277. # MyISAM tables, you should still set it to 8-64M as it will also be
  278. # used for internal temporary disk tables.
  279. key_buffer_size = 32M
  280.  
  281. # MyISAM uses special tree-like cache to make bulk inserts (that is,
  282. # INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA
  283. # INFILE) faster. This variable limits the size of the cache tree in
  284. # bytes per thread. Setting it to 0 will disable this optimisation. Do
  285. # not set it larger than "key_buffer_size" for optimal performance.
  286. # This buffer is allocated when a bulk insert is detected.
  287. bulk_insert_buffer_size = 64M
  288.  
  289. # This buffer is allocated when MySQL needs to rebuild the index in
  290. # REPAIR, OPTIMIZE, ALTER table statements as well as in LOAD DATA INFILE
  291. # into an empty table. It is allocated per thread so be careful with
  292. # large settings.
  293. myisam_sort_buffer_size = 128M
  294.  
  295. # The maximum size of the temporary file MySQL is allowed to use while
  296. # recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
  297. # If the file-size would be bigger than this, the index will be created
  298. # through the key cache (which is slower).
  299. myisam_max_sort_file_size = 10G
  300.  
  301. # If a table has more than one index, MyISAM can use more than one
  302. # thread to repair them by sorting in parallel. This makes sense if you
  303. # have multiple CPUs and plenty of memory.
  304. myisam_repair_threads = 1
  305.  
  306. # Automatically check and repair not properly closed MyISAM tables.
  307. myisam_recover
  308.  
  309. # *** INNODB Specific options ***
  310.  
  311. # Use this option if you have a MySQL server with InnoDB support enabled
  312. # but you do not plan to use it. This will save memory and disk space
  313. # and speed up some things.
  314. #skip-innodb
  315.  
  316. # Additional memory pool that is used by InnoDB to store metadata
  317. # information. If InnoDB requires more memory for this purpose it will
  318. # start to allocate it from the OS. As this is fast enough on most
  319. # recent operating systems, you normally do not need to change this
  320. # value. SHOW INNODB STATUS will display the current amount used.
  321. innodb_additional_mem_pool_size = 16M
  322.  
  323. # InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
  324. # row data. The bigger you set this the less disk I/O is needed to
  325. # access data in tables. On a dedicated database server you may set this
  326. # parameter up to 80% of the machine physical memory size. Do not set it
  327. # too large, though, because competition of the physical memory may
  328. # cause paging in the operating system. Note that on 32bit systems you
  329. # might be limited to 2-3.5G of user level memory per process, so do not
  330. # set it too high.
  331. innodb_buffer_pool_size = 2G
  332.  
  333. # InnoDB stores data in one or more data files forming the tablespace.
  334. # If you have a single logical drive for your data, a single
  335. # autoextending file would be good enough. In other cases, a single file
  336. # per device is often a good choice. You can configure InnoDB to use raw
  337. # disk partitions as well - please refer to the manual for more info
  338. # about this.
  339. innodb_data_file_path = ibdata1:10M:autoextend
  340.  
  341. # Set this option if you would like the InnoDB tablespace files to be
  342. # stored in another location. By default this is the MySQL datadir.
  343. #innodb_data_home_dir = <directory>
  344.  
  345. # Number of IO threads to use for async IO operations. This value is
  346. # hardcoded to 8 on Unix, but on Windows disk I/O may benefit from a
  347. # larger number.
  348. innodb_write_io_threads = 8
  349. innodb_read_io_threads = 8
  350.  
  351. # If you run into InnoDB tablespace corruption, setting this to a nonzero
  352. # value will likely help you to dump your tables. Start from value 1 and
  353. # increase it until you're able to dump the table successfully.
  354. #innodb_force_recovery=1
  355.  
  356. # Number of threads allowed inside the InnoDB kernel. The optimal value
  357. # depends highly on the application, hardware as well as the OS
  358. # scheduler properties. A too high value may lead to thread thrashing.
  359. innodb_thread_concurrency = 16
  360.  
  361. # If set to 1, InnoDB will flush (fsync) the transaction logs to the
  362. # disk at each commit, which offers full ACID behavior. If you are
  363. # willing to compromise this safety, and you are running small
  364. # transactions, you may set this to 0 or 2 to reduce disk I/O to the
  365. # logs. Value 0 means that the log is only written to the log file and
  366. # the log file flushed to disk approximately once per second. Value 2
  367. # means the log is written to the log file at each commit, but the log
  368. # file is only flushed to disk approximately once per second.
  369. innodb_flush_log_at_trx_commit = 1
  370.  
  371. # Speed up InnoDB shutdown. This will disable InnoDB to do a full purge
  372. # and insert buffer merge on shutdown. It may increase shutdown time a
  373. # lot, but InnoDB will have to do it on the next startup instead.
  374. #innodb_fast_shutdown
  375.  
  376. # The size of the buffer InnoDB uses for buffering log data. As soon as
  377. # it is full, InnoDB will have to flush it to disk. As it is flushed
  378. # once per second anyway, it does not make sense to have it very large
  379. # (even with long transactions).
  380. innodb_log_buffer_size = 8M
  381.  
  382. # Size of each log file in a log group. You should set the combined size
  383. # of log files to about 25%-100% of your buffer pool size to avoid
  384. # unneeded buffer pool flush activity on log file overwrite. However,
  385. # note that a larger logfile size will increase the time needed for the
  386. # recovery process.
  387. innodb_log_file_size = 256M
  388.  
  389. # Total number of files in the log group. A value of 2-3 is usually good
  390. # enough.
  391. innodb_log_files_in_group = 3
  392.  
  393. # Location of the InnoDB log files. Default is the MySQL datadir. You
  394. # may wish to point it to a dedicated hard drive or a RAID1 volume for
  395. # improved performance
  396. #innodb_log_group_home_dir
  397.  
  398. # Maximum allowed percentage of dirty pages in the InnoDB buffer pool.
  399. # If it is reached, InnoDB will start flushing them out agressively to
  400. # not run out of clean pages at all. This is a soft limit, not
  401. # guaranteed to be held.
  402. innodb_max_dirty_pages_pct = 90
  403.  
  404. # The flush method InnoDB will use for Log. The tablespace always uses
  405. # doublewrite flush logic. The default value is "fdatasync", another
  406. # option is "O_DSYNC".
  407. #innodb_flush_method=O_DSYNC
  408.  
  409. # How long an InnoDB transaction should wait for a lock to be granted
  410. # before being rolled back. InnoDB automatically detects transaction
  411. # deadlocks in its own lock table and rolls back the transaction. If you
  412. # use the LOCK TABLES command, or other transaction-safe storage engines
  413. # than InnoDB in the same transaction, then a deadlock may arise which
  414. # InnoDB cannot notice. In cases like this the timeout is useful to
  415. # resolve the situation.
  416. innodb_lock_wait_timeout = 120
  417.  
  418.  
  419. [mysqldump]
  420. # Do not buffer the whole result set in memory before writing it to
  421. # file. Required for dumping very large tables
  422. quick
  423.  
  424. max_allowed_packet = 16M
  425.  
  426. [mysql]
  427. no-auto-rehash
  428.  
  429. # Only allow UPDATEs and DELETEs that use keys.
  430. #safe-updates
  431.  
  432. [myisamchk]
  433. key_buffer_size = 512M
  434. sort_buffer_size = 512M
  435. read_buffer = 8M
  436. write_buffer = 8M
  437.  
  438. [mysqlhotcopy]
  439. interactive-timeout
  440.  
  441. [mysqld_safe]
  442. # Increase the amount of open files allowed per process. Warning: Make
  443. # sure you have set the global system limit high enough! The high value
  444. # is required for a large number of opened tables
  445. open-files-limit = 8192
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement