database.sarang.net
UserID
Passwd
Database
DBMS
ㆍMySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MySQL Q&A 29678 게시물 읽기
No. 29678
mysql 튜닝정보인데 몇번씩 손본건데도 어렵네요..
작성자
진짜친구
작성일
2010-05-31 17:22
조회수
8,876

MYSQL PERFORMANCE TUNING PRIMER

라는 툴을 받아서 설치후에 설정파일 설정 변경해가면서 최적 값을 찾아보려고 노력중인데..

어려움이 많아서 도움좀 요청 드립니다... 프로그램 설명을 보니 색깔로 표시되는 권고사항을 신경써서 보라고 해서

값도 변경해보고 추가도 해보고 하는데... 새로 설정 변경하고 실행해봐도 저 색깔있는 내용들이 변함이 없어서요..

멀 잘못한건지... 멀 손봐야 하는건지 좀 알려주시면 정말 감사하겠습니다.. 특히 저 max_connection 관련해서 빨간색으로

나오는 부분은 멀 어떻게 하라는건지 모르겠네요.. 부탁드립니다..

 

[user@localhost ~]# ./tuning-primer.sh

        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.0.77-log x86_64

Uptime = 0 days 0 hrs 0 min 45 sec
Avg. qps = 246
Total Questions = 11112
Threads Connected = 10

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 1 sec.
You have 0 out of 11137 that take longer than 1 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 50
Current threads_cached = 7
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 300
Current threads_connected = 8
Historic max_used_connections = 16
The number of used connections is 5% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating


INNODB STATUS
Current InnoDB index space = 288 K
Current InnoDB data space = 176 K
Current InnoDB buffer pool free = 89 %
Current innodb_buffer_pool_size = 8 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 1.11 G
Configured Max Per-thread Buffers : 1.94 G
Configured Max Global Buffers : 1.00 G
Configured Max Memory Limit : 2.95 G
Physical Memory : 3.84 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 1.50 G
Current key_buffer_size = 1.00 G
Key cache miss rate is 1 : 302
Key buffer free ratio = 80 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_size


SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

OPEN FILES LIMIT
Current open_files_limit = 2358 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.

Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 1024 tables
You have a total of 543 tables
You have 565 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 32 M
Of 647 temp tables, 11% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 4 M
Current table scan ratio = 2668 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 2842
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform
frequent updates consider setting 'low_priority_updates=1'
If you have a high concurrency of inserts on Dynamic row-length tables
consider setting 'concurrent_insert=2'.
 

이 글에 대한 댓글이 총 1건 있습니다.

1. max_connections 관련

메세지를 직역하면, '설정된 max_connections에 비해 10% 미만만 쓰고 있다. 값을 낮추는 것이 과다한 메모리의 할당을 피할 수 있게 해줄 것이다' 입니다. 따라서, max_connections를 낮추고 남은 메모리를 쿼리캐쉬나 키버퍼, 조인/소트 버퍼에 할당하면 더 좋은 성능을 기대할 수 있습니다.

 

2. Query cache

쿼리 캐쉬가 왜 disable되어 있을까요? 데이터의 변화가 없을 때, 대상 데이터(테이블)에 같은 SELECT 요청에 대해서는 쿼리를 수행하지 않고, 캐싱되어 있는 결과를 보여주도록 하는 것이 쿼리 캐쉬입니다. 설정해 두시는 것이 좋겠습니다.

 

3. Table lock

현재 Lock wait ratio가 1:2842로 나쁘게 나타나고 있는데, 인덱스를 타고 있지 않아, 지나치게 오래 걸리는 쿼리의 존재를 예상해볼 수 있습니다. log_slow_queries 옵션을 주어, 어떤 쿼리가 느리게 수행되는지 확인해보시는 것이 좋겠습니다. ( 메세지의 앞부분은 table-level-lock의 MyISAM보다 row-level-lock의 InnoDB를 쓰는 것이 도움이 될 것 같다는 얘기입니다. )

 

 

박현우(lqez)님이 2010-06-03 05:08에 작성한 댓글입니다.
이 댓글은 2010-06-03 05:49에 마지막으로 수정되었습니다.
[Top]
No.
제목
작성자
작성일
조회
29682mysql 바이너리 설치시 이런상황 어떻게 받아 들어야 하나요? [1]
우째~
2010-06-01
8168
29681Windows XP Home edition 에 MySQL 콘솔 설치 [1]
투다리
2010-06-01
7357
29679복수개 삭제 delete문 [1]
SQL대딩
2010-05-31
6958
29678mysql 튜닝정보인데 몇번씩 손본건데도 어렵네요.. [1]
진짜친구
2010-05-31
8876
29677중국어 입력문제입니다. 알려주세요 [1]
김종수
2010-05-31
6832
29672group by 또는 distinct 질문드려요~~ [1]
초보쟁이
2010-05-27
7114
29671사용자별로 최신글 몇 개씩 뽑아오기 [1]
박상길
2010-05-27
8173
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.018초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다