슬로우 쿼리 설정 방법
본문
구글에서 슬로우 쿼리 설정 관련 글을 모두 보고 다 해봤는데 로그가 쌓이질 않습니다...
제 버전은 php7.3 centos7 마리아DB 10 입니다.
혹시 슬로우 쿼리 설치 방법에 대해 자세한 내용이 있는 사이트를 아시는 분 계실까요?
구글에서 CENTOS7 슬로우 쿼리 설정 방법 등등에 대한것들은 모두 해봤습니다..ㅠㅠ
그래도 로그가 쌓이질 않네요
MYSQL 등등 모두 리스타트 해놓았구요
답변 2
다음 사항들을 확인해 보세요
my.cnf 파일 확인
다음과 같은 설정이 포함되어 있는지 확인해 보세요
포함되어 있지 않다면 추가
slow_query_log = 1
slow_query_log_file = /var/log/mariadb/slow_query.log
long_query_time = 2
로그 디렉토리 확인:
slow_query_log_file에 지정된 경로가 존재 여부 확인
슬로우 쿼리 로그를 강제로 생성
SET GLOBAL slow_query_log = 'ON';
SELECT SLEEP(3);
로그 파일 권한 확인, MariaDB 재시작, SELinux 확인, 로그 레벨 확인, 에러 로그 확인, 버전 호환성 확인
!-->!-->
long_query_time = 2 2초면 슬로우쿼리 실행속도보다 저장할려는 속다가 작기때문에 넘어가버리죠 즉
로그가 저장이 않될수 있습니다. 10초이상 늘려주세요
답변을 작성하시기 전에 로그인 해주세요.