mysql 런타임 상태 질문 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

mysql 런타임 상태 질문 정보

mysql 런타임 상태 질문

본문

phpmyadmin의 런타임 상태 보기를 보니 빨간색으로 된 수치가 몇개 보입니다.
수치가 좀 심상치 않게 높아보이네요.
mysql의 어느부분인가의 설정이 잘못된 것 같은데 어떤 수치를 어떻게 조절해야 하는지 조언 부탁드립니다.


Handler_read_rnd 12 M
The number of requests to read a row based on a fixed position. This is high if you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan whole tables or you have joins that don't use keys properly.
Handler_read_rnd_next 116 M
The number of requests to read the next row in the data file. This is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.
Qcache_lowmem_prunes 19 k
The number of queries that have been removed from the cache to free up memory for caching new queries. This information can help you tune the query cache size. The query cache uses a least recently used (LRU) strategy to decide which queries to remove from the cache.
Opened_tables 19 k
The number of tables that have been opened. If opened tables is big, your table cache value is probably too small.
Table_locks_waited 7,262
The number of times that a table lock could not be acquired immediately and a wait was needed. If this is high, and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.

댓글 전체

Handler_read_rnd 와 Handler_read_rnd_next 는 index를 타지않는 쿼리가 있어서 증가하는것이라고 이해 하시면 되시고,

대응은, 사용하시는 쿼리에 explain 을 붙여서 인덱스가 적절하게 타고 있는지 쿼리 또는 스키마를 수정해야 할것 같네요.

3번째와 4번째는 사용되는 캐시 용량및 캐시 사용후 반환관련된 문제로 보입니다.
대응은, SQL 사용후 time_wait 같은 설정값 또는 PHP단에서 mysql_close()로 접속끝음으로 해결할 수 있습니다.

Table_locks_waited 의 경우도 위와 유사한 내용인데 인덱스 타지 못한 쿼리의 실행이 반복되어
테이블 락된채 대기되는 수입니다.

전반적으로,  mysql 캐시 설정, 쿼리 최적화 (인덱스가 걸리는지) 등을 검사하시면 위의 값들이 변경될겁니다.

전반적인 slow_query 가있는지 my.cnf 파일에 슬로우쿼리 로그를 남겨 확인하시고,
슬로우 쿼리에 대한 최적화 시켜주시면 될듯 싶네요
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT