본문 바로가기
Database/MYSQL

my.cnf 입니다. 4G 램 서버에서 어떻게 셋팅

by 반화넬 2007. 6. 4.
반응형
# system variable
[shared by all threads]
1. key_buffer_size -> 25% of total memory
2. join_buffer_size
3. table_cache -> check opened_table status

[per threads]
1. read_rnd_buffer_size -> improve ORDER BY
2. sort_buffer_size -> improve ORDER BY or GROUP BY


if you have lots of memory increase tmp_table_size
it will improve advanced GROUP BY 

mysql 의 memory 에는 per server 당 할당되는 메모리가 있고..
(대표적인게 key_buffer 입니다...)
per connection 당 할당되는 메모리가 있습니다...
(대표적인게 query_cache 와 sort_buffer 입니다..) 

query_cache 가 32M 이면 300 개 connection 일때
32x300=9600M  = 9G 가 넘죠..  ㅡㅡ;; 

# status
1. select_full_join
The number of joins that do not use indexes.
0 이 아니라면 인덱스를 검토하여 조정할것

2. select_range_check
The number of joins without keys that check for key usage after each row.
0 이 아니라면 인덱스를 검토하여 조정할것

cache miss rate => The Key_reads/Key_read_requests ratio should normally be less than 0.01.
The Key_writes/Key_write_requests ratio is usually near 1 if you are using mostly updates and deletes,
but might be much smaller if you tend to do updates that affect many rows at the same time or if you are using the DELAY_KEY_WRITE table option.

difference between Connections and Threads_created shows thread_cache_size
반응형