programing

mysql (mariadb) 튜닝 및 성능 테스터

css3 2023. 11. 1. 22:32

mysql (mariadb) 튜닝 및 성능 테스터

my.cnf config 파일을 편집하여 mysql(mariadb) 서버에 가장 적합한 성능을 내는 방법을 잘 모르겠습니다.샘플 my-hug.ini를 기준으로 값을 변경했습니다.이것은 제 서버에 대한 최선의 선택이 아니라고 생각합니다.

구성:

  • 인텔 Xeon CPU 3.00GHz(+하이퍼 쓰레드) 2배
  • 4GB RAM
  • 2x scsi HDD 300gb(미러)

애플리케이션이 최고의 성능을 발휘할 수 있기 때문에 My ISAM을 선호합니다.mysql을 실행하기 위한 서버를 기반으로 해서 정말 좋게 만들고 싶습니다 :) 쿼리 통계: 65% 선택, 30% 업데이트

누가 나에게 정말 좋은 구성을 추천해 줄 수 있습니까?서버에서 벤치마크를 만들고 변경해야 할 옵션을 제안할 수 있는 방법이나 소프트웨어가 있습니까?

#
# The MySQL database server configuration file.
#
# You can copy this 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
skip-external-locking

key_buffer_size     = 384M
max_allowed_packet   = 1M
table_open_cache     = 512
sort_buffer_size     = 2M
read_buffer_size     = 2M
read_rnd_buffer_size     = 8M
myisam_sort_buffer_size  = 64M
thread_cache_size    = 8
query_cache_size     = 32M
thread_concurrency   = 4

# Error log - should be very few entries.
log_error = /var/log/mysql/error.log

# Here you can see queries with especially long duration
#slow_query_log_file = /var/log/mysql/mysql-slow.log
#slow_query_log      = 1
#long_query_time = 2
#log_queries_not_using_indexes


# 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
#log_bin            = /var/log/mysql/mysql-bin.log
expire_logs_days    = 10
max_binlog_size         = 100M
#binlog_do_db       = include_database_name
#binlog_ignore_db   = include_database_name

[mysqldump]
quick
max_allowed_packet   = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size      = 256M
sort_buffer_size     = 256M
read_buffer  = 2M
write_buffer     = 2M

[mysqlhotcopy]
interactive-timeout

[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/

언급URL : https://stackoverflow.com/questions/30291671/mysql-mariadb-tuning-and-performance-tester