Skip to content

Commit

Permalink
reduce MySQL memory usage
Browse files Browse the repository at this point in the history
* add informations about innodb_buffer tweaking
  • Loading branch information
VirtuBox committed Jan 12, 2019
1 parent d85e2b6 commit a12772f
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions etc/mysql/my.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@ max_connections = 100
connect_timeout = 5
wait_timeout = 60
max_allowed_packet = 16M
thread_cache_size = 128
thread_cache_size = 128
sort_buffer_size = 4M
bulk_insert_buffer_size = 16M
tmp_table_size = 64M
max_heap_table_size = 64M
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 = 500000
table_open_cache = 500000
myisam_sort_buffer_size = 512M
concurrent_insert = 2
read_buffer_size = 2M
read_rnd_buffer_size = 1M
key_buffer_size = 64M
open-files-limit = 500000
table_open_cache = 500000
myisam_sort_buffer_size = 256M
concurrent_insert = 2
read_buffer_size = 2M
read_rnd_buffer_size = 1M
#
# * Query Cache Configuration
#
Expand Down Expand Up @@ -129,9 +129,14 @@ log_slow_verbosity = query_plan
# 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 = 256M
innodb_buffer_pool_size = 2G
innodb_log_buffer_size = 512M

# innodb_log_file_size = innodb_buffer_pool_size / 8
innodb_log_file_size = 128M
# innodb_buffer_pool_size = RAM / 2
innodb_buffer_pool_size = 1G
# innodb_log_buffer_size = innodb_buffer_pool_size / 4
innodb_log_buffer_size = 256M

innodb_file_per_table = 1
innodb_open_files = 500000
innodb_io_capacity = 500000
Expand Down

0 comments on commit a12772f

Please sign in to comment.