simple guide: MySQL low memory configuration
Posted: Tue May 06, 2014 6:50 pm
I have been playing with raspberry for while. I find this forum very useful, so I decided to share some of my (limited) knowledge.
Sometimes you need to use MySQL for some project, but you need to keep memory usage low. With these settings, I managed to keep RAM usage of mysqld process under 7.5MB. Here is relevant part of /etc/mysql/my.cnf config
Please note, that this config might not be suitable for public webserver. I hope someone will find it useful.
Sometimes you need to use MySQL for some project, but you need to keep memory usage low. With these settings, I managed to keep RAM usage of mysqld process under 7.5MB. Here is relevant part of /etc/mysql/my.cnf config
Code: Select all
# The MySQL server
[mysqld]
port = 3306
socket = /var/run/mysqld/mysqld.sock
max_connections=10 #you can go lower here, but it does not have much more impact
innodb=OFF #this works for mysql 5.5+ version, you might need to use skip-innodb for older versions
default-storage-engine = myisam
query_cache_size=0
key_buffer_size=8
thread_cache_size=0
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
table_definition_cache = 1
server-id = 1