How to get MariaDB server memory footprint down?

From: Johann Klammer <klammerj_at_NOSPAM.a1.net>
Date: Wed, 29 Aug 2018 12:29:28 +0200
Message-ID: <pm5sij$qm2$1_at_gioia.aioe.org>



I have loaded up a Maria database with about 15KBytes of .csv. The mysqld process as installed on debian testing had more than 500 Megabytes reserved. Then I looked at their knowledge base for recommendations about turning down the mem(reserved address space) footprint. I set all the recommended configuration variables to smaller values.

[mysqld]
performance_schema=OFF
bulk_insert_buffer_size=0
key_buffer_size = 1M
max_allowed_packet = 1M
thread_stack = 192K

thread_cache_size       = 4
max_connections        = 3
query_cache_limit = 1M
query_cache_size        = 1M

innodb_buffer_pool_size=0

(..somewhere in /etc/mysql/mariadb.conf.d/50-server.cnf)

That bought the mem footprint down to around 470 Megabytes. Then I looked into /proc/<pid>/smaps
and added ulimit -s 192 at the end of /etc/default/mysql and restarted te server, which gets the footprint down to 257 Megabytes.

> 6788 mysql 20 0 247128 61164 15224 S 0.0 1.8 0:05.72 mysqld

looking into the smaps again reveals around 147MiB stack on one thread and a mapping of about 50MiB. I am not sure how to further reduce those.

Does anybody know what they store on the stack that is the bulk of those 147MiB?

> ad6a8000-b6c00000 rw-p 00000000 00:00 0 [stack:6807]
> Size: 152928 kB

..oh it grew in the meantime... Received on Wed Aug 29 2018 - 12:29:28 CEST

Original text of this message