Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 32 additions & 26 deletions low-memory-my.cnf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html

[mysqld]
#
Expand Down Expand Up @@ -31,34 +31,40 @@ log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


#### These optimize the memory use of MySQL
#### Reduces the memory usage of MySQL by setting values to their minimum
#### http://www.tocker.ca/2014/03/10/configuring-mysql-to-use-minimal-memory.html
innodb_buffer_pool_size=5M
innodb_log_buffer_size=256K
query_cache_size=0
max_connections=10
key_buffer_size=8
thread_cache_size=0
host_cache_size=0
innodb_ft_cache_size=1600000
innodb_ft_total_cache_size=32000000

# per thread or per operation settings
thread_stack=131072
sort_buffer_size=32K
read_buffer_size=8200
read_rnd_buffer_size=8200
max_heap_table_size=16K
tmp_table_size=1K
bulk_insert_buffer_size=0
join_buffer_size=128
net_buffer_length=1K
innodb_sort_buffer_size=64K
#### Tip: Doing this is hacky. Optimizing values will result in better performance.
#### If you have time consider a script like MySQLTuner to start learning about optimization
#### See: https://github.com/major/MySQLTuner-perl. [ And change: performance_schema = on ]

#settings that relate to the binary log (if enabled)
binlog_cache_size=4K
binlog_stmt_cache_size=4K
## Global values
innodb_buffer_pool_size=5M #MySQL 8 default: 134217728 (128M)
innodb_log_buffer_size=256K #MySQL 8 default: 16777216 (16M)
query_cache_size=0 #MySQL 8 default: REMOVED in 8. Deprecated in MySQL 5.7.20
max_connections=10 #MySQL 8 default: 151
key_buffer_size=8 #MySQL 8 default: 8388608 (8M)
thread_cache_size=0 #MySQL 8 default: (autosized)
host_cache_size=0 #MySQL 8 default: (autosized)
innodb_ft_cache_size=1600000 #MySQL 8 default: 8000000
innodb_ft_total_cache_size=32000000 #MySQL 8 default: 640000000

#### from https://mariadb.com/de/node/579
## Per thread or per operation values
thread_stack=131072 #MySQL 8 default: 1048576 (1M) Default increased in MySQL 8.0.27 by 4x
sort_buffer_size=32K #MySQL 8 default: 262144 (256K)
read_buffer_size=8200 #MySQL 8 default: 131072 (128K)
read_rnd_buffer_size=8200 #MySQL 8 default: 262144 (256K)
max_heap_table_size=16K #MySQL 8 default: 16777216 (16M)
tmp_table_size=1K #MySQL 8 default: 16777216 (16M)
bulk_insert_buffer_size=0 #MySQL 8 default: 8388608 (8M)
join_buffer_size=128 #MySQL 8 default: 262144 (256K)
net_buffer_length=1K #MySQL 8 default: 16384 (16K)
innodb_sort_buffer_size=64K #MySQL 8 default: 1048576 (1M)

## Settings that relate to the binary log (if enabled)
binlog_cache_size=4K #MySQL 8 default: 32768 (32K)
binlog_stmt_cache_size=4K #MySQL 8 default: 32768 (32K)

#### Turn off monitoring. Reduces memory usage
performance_schema = off