🕰️
2020.12.15 06:07
Ubuntu 16.04에서 MariaDB 튜닝 최적화하기. my.cnf
조회 수 205 추천 수 0 댓글 0
여기서 마리아db 공식홈페이지를 들어가니 설정이 다 되어있어서 그대로 따라함. MariaDB 튜닝 sudo pico /etc/mysql/my.cnf # MariaDB database server configuration file. # # You can copy this file to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set user-specific options. # # One can use all long options that the program supports. # Run program with --help to get a list of available options and with # --print-defaults to see which it would actually understand and use. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html # This will be passed to all mysql clients # It has been reported that passwords should be enclosed with ticks/quotes # escpecially if they contain "#" chars... # Remember to edit /etc/mysql/debian.cnf when changing the socket location. [client] port = 3306 socket = /var/run/mysqld/mysqld.sock # Here is entries for some specific programs # The following values assume you have at least 32M ram # This was formally known as [safe_mysqld]. Both versions are currently parsed. [mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] # # * Basic Settings # user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc_messages_dir = /usr/share/mysql lc_messages = en_US skip-external-locking # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. #bind-address = 127.0.0.1 # # * Fine Tuning # max_connections = 1000 connect_timeout = 5 wait_timeout = 600 max_allowed_packet = 16M thread_cache_size = 128 sort_buffer_size = 4M bulk_insert_buffer_size = 16M tmp_table_size = 32M max_heap_table_size = 32M # # * MyISAM # # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched. On error, make copy and try a repair. myisam_recover_options = BACKUP key_buffer_size = 128M #open-files-limit = 2000 table_open_cache = 400 myisam_sort_buffer_size = 512M concurrent_insert = 2 read_buffer_size = 2M read_rnd_buffer_size = 1M # # * Query Cache Configuration # # Cache only tiny result sets, so we can fit more in the query cache. query_cache_limit = 128K query_cache_size = 64M # for more write intensive setups, set to DEMAND or OFF #query_cache_type = DEMAND # # * Logging and Replication # # Both location gets rotated by the cronjob. # Be aware that this log type is a performance killer. # As of 5.1 you can enable the log at runtime! #general_log_file = /var/log/mysql/mysql.log #general_log = 1 # # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. # # we do want to know about network errors and such log_warnings = 2 # # Enable the slow query log to see queries with especially long duration #slow_query_log[={0|1}] slow_query_log_file = /var/log/mysql/mariadb-slow.log long_query_time = 10 #log_slow_rate_limit = 1000 log_slow_verbosity = query_plan #log-queries-not-using-indexes #log_slow_admin_statements # # The following can be used as easy to replay backup logs or for replication. # note: if you are setting up a replication slave, see README.Debian about # other settings you may need to change. #server-id = 1 #report_host = master1 #auto_increment_increment = 2 #auto_increment_offset = 1 log_bin = /var/log/mysql/mariadb-bin log_bin_index = /var/log/mysql/mariadb-bin.index # not fab for performance, but safer #sync_binlog = 1 expire_logs_days = 10 max_binlog_size = 100M # slaves #relay_log = /var/log/mysql/relay-bin #relay_log_index = /var/log/mysql/relay-bin.index #relay_log_info_file = /var/log/mysql/relay-bin.info #log_slave_updates #read_only # # If applications support it, this stricter sql_mode prevents some # mistakes like inserting invalid dates etc. #sql_mode = NO_ENGINE_SUBSTITUTION,TRADITIONAL # # * InnoDB # # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. # Read the manual for more InnoDB related options. There are many! default_storage_engine = InnoDB # you can't just change log file size, requires special procedure #innodb_log_file_size = 50M innodb_buffer_pool_size = 11G innodb_change_buffer_max_size = 50 innodb_buffer_pool_chunk_size=1073741824 innodb_log_buffer_size = 8M innodb_file_per_table = 1 innodb_open_files = 400 innodb_io_capacity = 400 innodb_flush_method = O_DIRECT # # * Security Features # # Read the manual, too, if you want chroot! # chroot = /var/lib/mysql/ # # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". # # ssl-ca=/etc/mysql/cacert.pem # ssl-cert=/etc/mysql/server-cert.pem # ssl-key=/etc/mysql/server-key.pem # # * 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 [mysqldump] quick quote-names max_allowed_packet = 16M [mysql] #no-auto-rehash # faster start of mysql but no tab completion [isamchk] key_buffer = 16M # # * IMPORTANT: Additional settings that can override those from this file! # The files must end with '.cnf', otherwise they'll be ignored. # !includedir /etc/mysql/conf.d/ 출처: https://tristan91.tistory.com/310 [개발모음집]
번호 | 분류 | 제목 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | 유머 | 🚨(뉴비필독) 전체공지 & 포인트안내 12 | 2024.11.04 | 26962 |
공지 | 이슈 | URL만 붙여넣으면 끝! 임베드 기능 | 2025.01.21 | 21280 |
380192 | 의류 |
네이버 1+1 강아지옷 메쉬 농구옷 50%할인한다 5500원 무배
1 ![]() ![]() |
2025.06.24 | 91 |
380191 | 잡담 |
전체적인 여드름관리
1 ![]() |
2025.06.24 | 95 |
380190 | 의류 |
[네이버] 1+1 드라이 기능성 긴바지 20,000원 배송비 3,000원
![]() ![]() |
2025.06.24 | 107 |
380189 | 생활용품 |
시크릿데이 입는 오버나이트 무료이벤트
![]() ![]() |
2025.06.24 | 110 |
380188 |
이제 저녁시간인데
![]() |
2025.06.24 | 105 | |
380187 |
영어나 외국어를 교재와 MP3파일로 공부할 때 어플과 AI도구를 이용해 공부 효율을 올리는 꿀 팁
![]() ![]() |
2025.06.24 | 115 | |
380186 |
CU편의점 택배 보낼일 있으면 참고해!
1 ![]() |
2025.06.24 | 154 | |
380185 | 기사/뉴스 |
"와 천잰데?" 놀라운 기술…'댓글 부대' 싹 잡아낸다
3 ![]() ![]() |
2025.06.24 | 130 |
380184 | 유머 |
썸남이 연애 못 해본 거 티난다는 안전벨트 해주는 방법
![]() ![]() |
2025.06.24 | 123 |
380183 |
오늘 비오는거 맞아??
1 ![]() |
2025.06.24 | 122 | |
380182 | 그 외 |
이브원더즈 암튜브 성인용 팔튜브 암링 남성, 2개 7,440원/무배
![]() ![]() |
2025.06.24 | 1751 |
380181 | 잡담 |
얼굴 작아지는 법 뭐가있을까
![]() |
2025.06.24 | 121 |
380180 | 먹거리 |
홈플러스 이번주 특가 행사 전단지 (6.26~7.2)
![]() |
2025.06.24 | 184 |
380179 | 기사/뉴스 |
올데이 프로젝트, 데뷔와 동시에 멜론 '톱100' 직행 '돌풍'
![]() |
2025.06.24 | 149 |
380178 | 화장품 |
토니모리 겟잇틴트 버터틴트 4,800원!
![]() |
2025.06.24 | 262 |
380177 | 이용권/상품권 |
쿠팡이츠 랜덤 쿠폰 1천원~최대 5만원 100% 당첨 (선착순)
1 ![]() |
2025.06.24 | 170 |
380176 | 먹거리 |
[네이버] L아르기닌 6000 고함량 15포*3개 (27,900원/무료)
![]() |
2025.06.24 | 154 |
380175 | 기사/뉴스 |
헌법 강의하다 "문재인은 간첩"‥"강의의 자유"
1 ![]() |
2025.06.24 | 157 |
380174 | 날씨 왜이래 1 | 2025.06.24 | 127 | |
380173 | 제습기 가동 2 | 2025.06.24 | 150 | |
380172 | 제습기 필요성 2 | 2025.06.24 | 144 | |
380171 | 유머 |
인스타 릴스 알고리즘 뜬 트리플에스 소속사 남돌.jpg
![]() |
2025.06.24 | 160 |
380170 | 유머 |
이병헌 때문에 이민정이랑 단 둘이 남게 된 김우빈.jpg
![]() |
2025.06.24 | 179 |
380169 |
방송대커뮤니티 홍보용 - geminin
![]() ![]() |
2025.06.24 | 183 | |
380168 |
방송대 학과 게시판 주소
![]() |
2025.06.24 | 189 | |
380167 | 먹거리 |
롯데온 세븐일레븐 아이스 아메리카노 레귤러 450원
![]() |
2025.06.24 | 208 |
380166 | 기사/뉴스 |
누군가를 사랑하는 사람을 보면 그 사람을 잘 알 수 있다. 인생에서 중요한 과제는 과거의 나를 용서하고 받아들이는 것이다.
![]() |
2025.06.24 | 200 |
380165 | 유머 |
요즘 현대인들이 가장 많이 고민하는 부분? 시간, 돈, 나이에 얽혀 사는 한국인들의 문제점
![]() |
2025.06.24 | 186 |
380164 | 맛잇는 냄새 | 2025.06.24 | 185 | |
380163 | 다들 점심 뭐 먹어? | 2025.06.24 | 187 |