I am using MariaDB(10.1.21) with following storage engines:

  • InnoDB
  • TokuDB
  • Spider Engine

System Configuration is :

  • 3GB RAM
  • Dual Core Processor

I have tried pt-mysql-summary tool to identify the memory usage and it shows 90% of innodb buffer pool size is filled,when no process is running on server.

I have also tried restarting the MariaDB server and this reduces memory for about 1-2 hours only and after that it eats up memory.

Any clue why it is consuming too much memory?

Sharing my configurations below:


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.
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

#table_open_cache                =16384
#table_definition_cache          =16384

# * 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
lc_messages     = en_US

#bind-address           =

max_allowed_packet= 16M
max-connect-errors = 1000000

tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 0
query-cache-size               = 0
max-connections                = 500
thread-cache-size              = 50
open-files-limit               = 65535
table-definition-cache         = 1024
table-open-cache               = 2048

log_warnings            = 2
slow_query_log          =1
log-output              = TABLE
long_query_time = 5
log_slow_verbosity      = query_plan
log-error               =/var/log/mysql/system_error.err

innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 128M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 1720M

max_allowed_packet      = 16M

#no-auto-rehash # faster start of mysql but no tab completion

key_buffer              = 16M




#spider_internal_limit          =1
spider_direct_order_limit       =1
spider_skip_default_condition   =1
spider_casual_read              =1
spider_bgs_mode                 =2
spider_direct_dup_insert        =1
spider_auto_increment_mode      =2

2 Answers 2


Your buffer pool is set to 1720M and TokuDB uses by default half of the server memory. 1.7G + 1.5G = 3.2G, which is already more than the total physical memory.

Set both values to something lower and leave at least 1G available for the OS. for example:

innodb_buffer_pool_size = 1G
tokudb_cache_size = 1G

Also, the reason why you're seeing the buffer pool filling up to 90% is that some queries might run at some point, even a backup with mysqldump could do that. Once the buffer pool is full, it will not empty even if there is no server activity.

  • Forgot mention tokudb_cache_size there. but it is set to 500M in config. Commented Aug 9, 2017 at 11:23
  • Still, too much memory allocated.
    – Rick James
    Commented Aug 17, 2017 at 4:12

It's not critical So don't worry It's a normal Behaviour of Innodb Engine.

If your data size is bigger than or equal the Buffer pool size, Innodb will fill all of buffer size at warm up time. So when you start MySQL after some hours buffer pool will full (Only Buffer pull Not all Ram's capacity)

You'are using multiply Engines in your system. It can complicate config, because you have to controll important variables (such as Memory Configs) of each Engine.

Do you have a reason to use the TokuDB? I think it's better to use one of these engines (InnoDB or TokuDB)

So if you prefer to use innodb, you can set buffer pool size to about 70% of RAM unless your data/index size is small

  • Buffer Pool is set in config. MariaDB consuming even when no database activity happening on server. Is there any way to resolve this issue? Commented Aug 9, 2017 at 9:39
  • Sorry I didn't see your server buffer pool size. Does your operating system swap? It's very important to avoid OS Swap.
    – HamoonDBA
    Commented Aug 9, 2017 at 9:56
  • Search for innodb-buffer-pool-size in My.cnf posted. Commented Aug 9, 2017 at 9:57
  • Yes,Os is using the swap space. Commented Aug 9, 2017 at 10:07
  • swappiness is recommended in mariadb documentation. Look at this link mariadb.com/kb/en/mariadb/configuring-swappiness Commented Aug 9, 2017 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.