Extra Form
PHP PHP 7.2
CMS XpressEngine

mariadb.jpg

 

안녕하세요.

서버를 새로구입해서 셋팅을 하였습니다.

메모리 8기가고 느릴만한 사양은 아닌데

 

mariadb에서 엄청난 부하가 있는 것 같습니다.

더 안좋은 사양의 서버에서는 사이트가 빠릿빠릿하게 떳는데이제는 부하가 너무심해서 로딩하는데 한참이 걸릴지경입니다. 원격 SSH의 경우에도 제 타이핑속도를 못따라 올정도로 부하가 심합니다.

 

예전에는 

 

/usr/share/mysql/my-huge.cnf
/usr/share/mysql/my-large.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-small.cnf

 

이런파일들로 메모리 설정을 해주었던 것 같은데 마리아디비 10.3에서는 해당 파일이 없을뿐더러

 

 

아래 셋팅처럼 아무 기본 셋팅 값이 없어서 다운이 발생하는것 같습니다.

[root@localhost my.cnf.d]# vi server.cnf

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
datadir=/home/mysql

# This group is only read by MariaDB-10.3 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.3]


# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
[mysqld]
max_allowed_packet=256M
character-set-server=utf8mb4
collation-server=utf8mb4_bin
lower_case_table_names=1

#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
datadir=/home/mysql

# This group is only read by MariaDB-10.3 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.3]
 

 

혹시 마리아  DB 10.3 기본 설정방법 같은게 있을까요?

혹은 부하의 원일을 찾는 가장 좋은 방법은 어떤게 있을지 궁금합니다.

  • profile

    지난 며칠간 올라온 글들만 좀 검색해 보셔도 될 것 같은데요...

    https://xetown.com/questions/1252236

    https://xetown.com/questions/1251491

    https://xetown.com/questions/1250230

     

    그런데 이 서버는 파이어폭스(Web Content)가 램을 어마어마하게 많이 먹고 있어서 MariaDB에게 줄 램이 남아 있질 않네요. 심지어 root 권한으로 파이어폭스를 실행하고 계신 것 같은데요;;; 위험한 도박을 즐기시는군요 ㅋㅋ

     

    서버 튜닝의 1순위는 X-Window와 불필요한 GUI 프로그램들을 삭제하는 것입니다. 얘네들은 램 사용량 변동이 너무 심해요. 아무때나 몇 기가씩 떼어줘도 될 만큼 넉넉한 사양이라면 모를까, 지금은 파이어폭스가 램을 너무 많이 써서 스왑까지 거의 다 잡아먹은 상황입니다. 느릴 수밖에요...

  • profile profile

    헉 TOP만 보고도 파폭인걸 아시는건가요? ㅎㅎ 저는 보고도 mysqld 가 100프로 CPU 넘었길래 부하로 봣는데

    보내주신 링크보니 코어가 여러개인 CPU라서 CUP 사용량이 100프로가 넘어도 문제 없다는걸 또 깨달았습ㄴ디ㅏ. ㅎㅎ

     

    근데 진짜 신기한게 재부팅 하고 X-Windows에서 파폭 안켰더니 ㅋㅋ 사이트가 무지 빠르네요.

     

    sql_mode = NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

    도 적용해줬습니다. 뿌듯한 마음으로 자러갑니다 감사합니다. ㅎㅎ

  • profile profile
    아무래도 초보 유저에게는 X윈도우 만한게 없어서 이전 centos6 에서도 항상 X윈도우 썻는데
    뭔가 7버전이 더 무거운 것 같네요.
  • profile profile
    항상 친절한 답변 감사드립니다!!
    보내주신글들 하고 구글링을 좀더 해보고 셋팅값을 찾아내 봐야겠네요.

    기본 셋팅이

    [root@localhost etc]# vi my.cnf
    #
    # This group is read both both by the client and the server
    # use it for options that affect everything
    #
    [client-server]

    #
    # include all files from the config directory
    #
    !includedir /etc/my.cnf.d

    이렇게 되어있고

    /etc/my.cnf.d 안을 봐도 따로 아무 셋팅이 안되어있고
    3개사이트중 2개는 MyISAM이고 하나는 InnoDB 인것같아서 것도 또 참 셋팅하기가 애매했네요.