|
d482ddbc
»
|
gabriel |
2008-03-27 |
adding mysql recipes/templa... |
1 |
# |
| |
2 |
# my.cnf.innodb_1024 |
| |
3 |
# |
| |
4 |
# This is a MySQL 5.x configuration file designed for the typical |
| |
5 |
# webapp, running on a 1GB server that is also the app and |
| |
6 |
# httpd server. The below configuration dedicates about half of |
| |
7 |
# the system resources to MySQL. It is InnoDB-specific, and |
| |
8 |
# will not perform well with many MyISAM tables. It supports |
| |
9 |
# limited ACID and referential integrity. It does not support |
| |
10 |
# replication. |
| |
11 |
# |
| |
12 |
# By Evan Weaver |
| |
13 |
# http://blog.evanweaver.com/articles/2007/04/30/top-secret-tuned-mysql-configurations-for-rails |
| |
14 |
# |
| |
15 |
# Copyright 2007, Cloudburst, LLC |
| |
16 |
# Licensed under the Academic Free License v. 3.0 |
| |
17 |
# http://blog.evanweaver.com/files/mysql/LICENSE |
| |
18 |
# |
|
423eb511
»
|
gabriel |
2008-04-02 |
upping max-allowed-packet f... |
19 |
# Modified by: gabrielh@gmail.com (http://ducktyper.com) |
| |
20 |
# |
|
d482ddbc
»
|
gabriel |
2008-03-27 |
adding mysql recipes/templa... |
21 |
|
| |
22 |
[client] |
| |
23 |
port = <%= db_port %> |
| |
24 |
socket = <%= db_socket %> |
|
5d48aec2
»
|
gabriel |
2008-03-27 |
commenting out max packet s... |
25 |
#max_allowed_packet = 32M |
|
d482ddbc
»
|
gabriel |
2008-03-27 |
adding mysql recipes/templa... |
26 |
|
| |
27 |
[mysqld] |
| |
28 |
######### engine and access interfaces |
| |
29 |
skip-networking |
| |
30 |
skip-locking |
| |
31 |
skip-bdb |
| |
32 |
|
| |
33 |
port = <%= db_port %> |
| |
34 |
socket = <%= db_socket %> |
| |
35 |
default-storage-engine = innodb |
| |
36 |
|
| |
37 |
######### character sets |
| |
38 |
character_set_server = utf8 |
| |
39 |
collation_server = utf8_general_ci |
| |
40 |
|
| |
41 |
######### innodb options |
| |
42 |
innodb_additional_mem_pool_size = 16M |
| |
43 |
# buffer pool size is most critical for innodb's performance and memory usage |
| |
44 |
innodb_buffer_pool_size = 256M |
| |
45 |
innodb_data_file_path = ibdata1:10M:autoextend |
| |
46 |
innodb_data_home_dir = /var/lib/mysql |
| |
47 |
innodb_file_io_threads = 4 |
| |
48 |
innodb_thread_concurrency = 4 |
| |
49 |
# 2 is fastest but slightly less reliable than 0 or 1, if you don't trust your hard disks |
| |
50 |
innodb_flush_log_at_trx_commit = 2 |
| |
51 |
|
| |
52 |
innodb_log_buffer_size = 64M |
| |
53 |
# innodb_log_file_size * innodb_log_files_in_group < buffer_pool_size |
| |
54 |
innodb_log_file_size = 80M |
| |
55 |
innodb_log_files_in_group = 3 |
| |
56 |
# use a secondary volume if possible for a concurrent read/write speed boost |
| |
57 |
innodb_log_group_home_dir = /var/lib/mysql |
| |
58 |
|
| |
59 |
innodb_max_dirty_pages_pct = 90 |
| |
60 |
innodb_lock_wait_timeout = 120 |
| |
61 |
|
| |
62 |
######### myisam |
| |
63 |
# innodb still requires the myisam engine for mysql's internal metadata table |
| |
64 |
key_buffer_size = 16M |
| |
65 |
|
| |
66 |
######### general |
| |
67 |
connect_timeout = 10 |
| |
68 |
back_log = 50 |
| |
69 |
# you can't have more mongrels or fastcgi processes than the max_connections setting |
| |
70 |
max_connections = 96 |
| |
71 |
max_connect_errors = 10 |
| |
72 |
table_cache = 2048 |
| |
73 |
max_allowed_packet = 32M |
| |
74 |
|
| |
75 |
open_files_limit = 1024 |
| |
76 |
# this is the in-memory tmp table max size |
| |
77 |
max_heap_table_size = 64M |
| |
78 |
# below are per-connection and per-sub-query |
| |
79 |
join_buffer_size = 4M |
| |
80 |
read_buffer_size = 4M |
| |
81 |
sort_buffer_size = 8M |
| |
82 |
read_rnd_buffer_size = 8M |
| |
83 |
|
| |
84 |
thread_cache_size = 8 |
| |
85 |
thread_concurrency = 8 |
| |
86 |
|
| |
87 |
# query_cache_size is a global setting |
| |
88 |
query_cache_size = 128M |
| |
89 |
query_cache_limit = 2M |
| |
90 |
thread_stack = 192K |
| |
91 |
transaction_isolation = READ-COMMITTED |
| |
92 |
# this is the on-disk max size |
| |
93 |
tmp_table_size = 128M |
| |
94 |
tmpdir = /tmp |
| |
95 |
|
| |
96 |
|
| |
97 |
# You can log slow queries to the mysql log directory to help isolate performance problems |
| |
98 |
log_slow_queries |
| |
99 |
long_query_time = 3 |
| |
100 |
log_long_format |
| |
101 |
|
| |
102 |
[mysqldump] |
| |
103 |
quick |
|
423eb511
»
|
gabriel |
2008-04-02 |
upping max-allowed-packet f... |
104 |
max_allowed_packet = 32M |
|
d482ddbc
»
|
gabriel |
2008-03-27 |
adding mysql recipes/templa... |
105 |
|
| |
106 |
[mysql] |
| |
107 |
no-auto-rehash |
| |
108 |
|
| |
109 |
[myisamchk] |
| |
110 |
# not used except when repairing the database at startup |
| |
111 |
key_buffer = 64M |
| |
112 |
sort_buffer_size = 64M |
| |
113 |
read_buffer = 2M |
| |
114 |
write_buffer = 2M |
| |
115 |
|
| |
116 |
[mysqlhotcopy] |
| |
117 |
interactive-timeout |
| |
118 |
|
| |
119 |
[mysqld_safe] |
| |
120 |
open-files-limit = 8192 |
| |
121 |
|
| |
122 |
# PS. Do not under any circumstances enable binlog |