<./>.dev./hood

안녕하세요.
최근 MySQL 5.6.23 버전을 사용하다 MariaDB 10.1.38 버전으로 변경을 하게되었습니다.
그런데 오히려 서버 Memory 가 2GB가 늘었음에도 불구하고 Select 문 질의 시 시간이 오래 걸려 사이트가 너무 느려졌습니다.
기존 사용하던 엔진은 MyISAM 이어서 MariaDB로 이전하면서 활성화된 InnoDB 도 비활성화 하고 my.cnf 설정도 가장 동일하게 설정하였는데 혹시 서버자체 CPU문제일 수 있을까요? 아니면 MariaDB 컴파일설치간에 다른설정으로 인해서도 느려질 수가 있을까요?

현재 셋팅된 my.cnf 는 다음과 같습니다.
###########################################################################
# MySQL 설정 File
###########################################################################
#
# 이 파일에는 MySQL 의 전체적인 설정이 들어간다. [ client ] 설정은 각 유저
# 들의 홈디렉토리 ~user/.my.cnf 라는 파일로 만들어 설정을 할수 있다. 이 설
# 정 파일들의 퍼미션은 소유자 readonly 즉 600 을 유지해야 한다.
#

###########################################################################
# MySQL Clinet 설정
###########################################################################
[client]
#host                              = localhost
#user                              = root
#password                          = MySQL_ROOT_PASSWD
#socket                            = /tmp/mysql.sock
default-character-set              = utf8
port                                = 3306



###########################################################################
# MySQL Server 설정
###########################################################################
[mysqld]
port                                = 3306
user                                = mysql
socket                              = /tmp/mysql.sock
#skip-networking
# IPv6
#bind-address                        = ::
# IPv4
bind-address                        = 0.0.0.0


#
#MySQL에서 load_file() 함수의 경로를 제한
#
secure-file-priv                    = /var/tmp

#
# 삽질
#
connect_timeout=15
interactive_timeout=100

#
# 주석해제시 phpMyAdmin 에서 왼쪽 프레임에 테이블리스트가 나타나지 않는다
#
#skip-show-database
#secure-auth
skip-external-locking
key_buffer_size                    = 256M
# 서버가 죽어서 data 보정 작업이 일어날 경우 패킷 크기가 늘어나기 때문에 넉넉하게 설정
max_allowed_packet                  = 64M
table_open_cache                    = 512
sort_buffer_size                    = 128M
read_buffer_size                    = 10M
myisam_sort_buffer_size            = 64M
thread_cache_size                  = 8
thread_stack                        = 131072
max_connections                    = 1024
open-files-limit                    = 4096
join_buffer_size                    = 5M
max_join_size                      = 4294967295
max_connect_errors                  = 4294967295
wait_timeout                        = 30
#old_passwords                      = 1
#tmpdir                              = /dev/shm



#######################################
# MySQL Log
#######################################
# 쿼리수행타임이 3초이상이면 slow queries 로 인식하고 기록
# log-long-format 환경변수는 long_query_time 변수에 영향을 줌
#
#log-update
log-short-format
long_query_time                    = 5
general_log                        = 1
slow_query_log                      = 1
general_log_file                    = /usr/local/mysql/logs/mysql_queries.log
log-error                          = /usr/local/mysql/logs/mysql_errors.log
slow_query_log_file                = /usr/local/mysql/logs/mysql_slow_queries.log


#######################################
# sql cache 사용
#######################################
# query 캐쉬 사용 옵션
# 0 -> 사용안함
# 1 -> 사용함
# 2 -> 선택적 사용
# http://www.mysql.com/doc/en/Query_Cache_Configuration.html 참고
query_cache_type                    = 1
query_cache_size                    = 50M
query_cache_limit                  = 1M

# CPU 갯수 * 2 를 해서 설정을 한다. 1 개일 경우에는 설정 필요가 없다.
#thread_concurrency                  = 8


#######################################
# Charset 설정
#######################################
character-set-server                = utf8
init_connect                        = set collation_connection = utf8_general_ci
init_connect                        = set names utf8
character-set-client-handshake      = TRUE
skip-character-set-client-handshake
explicit_defaults_for_timestamp = on
#ignore-builtin-innodb

#
# Setting the SQL Mode
#
sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION


# 메시지 언어 선택
#language                            = /usr/local/mysql/share

# MySQL 의 리플리케이션 기능을 사용하기 위한 binary log 설정
#server-id                          = 1



#######################################
# InnoDB 테이블 설정
#######################################
#innodb                            = ON
#innodb_file_per_table
#innodb_data_file_path              = ibdata1:100M;ibdata2:100M:autoextend:max:10000M
#innodb_log_files_in_group          = 2
#innodb_log_file_size              = 32M
#innodb_log_buffer_size            = 8M
#innodb_buffer_pool_size            = 256M
##innodb_additional_mem_pool_size    = 20M
#innodb_flush_log_at_trx_commit    = 0
#innodb_thread_concurrency          = 8
#innodb_lock_wait_timeout          = 50
##innodb_log_archive                = 0
##innodb_autoextend_increment      = 8388608
##innodb_force_recovery = 4


#
# MySQL 기본 엔진
# innodb 를 사용하지 않을 경우에는 아래를 설정한다.
default-storage-engine              = MyISAM
default-tmp-storage-engine          = MyISAM



###########################################################################
# MySQL dump 설정
###########################################################################
[mysqldump]
quick
default-character-set                = utf8
max_allowed_packet                  = 32M

###########################################################################
# MySQL
###########################################################################
[mysql]
default-character-set                = utf8
no-auto-rehash

###########################################################################
# Isamchk
###########################################################################
[isamchk]
key_buffer                          = 256M
sort_buffer_size                    = 256M
read_buffer                        = 2M
write_buffer                        = 2M

###########################################################################
# Myisamchk
###########################################################################
[myisamchk]
key_buffer                          = 256M
sort_buffer_size                    = 256M
read_buffer                        = 2M
write_buffer                        = 2M

###########################################################################
# Mysqlhotcopy
###########################################################################
[mysqlhotcopy]
interactive-timeout



기존 서버와 다른 설정이라고는 bind-address 부분뿐이며, 혹시 위 정보로도 부족하다면 show status 정보도 올려드리도록 하겠습니다.

감사합니다.

 

'DB > MySQL - MariaDB' 카테고리의 다른 글

Mysql 쿼리 튜닝 1  (0) 2023.11.27
자주 쓰는 Mysql 쿼리문  (0) 2023.11.14
Mysql 세팅  (0) 2020.05.08
mysql 로그 기록 설정  (0) 2020.01.07
DB 권한  (0) 2019.04.28