skip to Main Content

I use Maria DB. Where can I set the innodb_buffer_pool_size parameter.

I looked in /etc/mysql/mariadb.conf.d/50-server.cnf and
/etc/mysql/my.cnf, but I can’t find the parameter there.

But anywhere the parameter must be set, because I get a result, if I use:

show variables like ‘innodb_buffer_pool%’;

2

Answers


  1. You can set the innodb_buffer_pool_size dynamically from the command line.

    mysqld> set global innodb_buffer_pool_size = XX
    

    Replace XX with value to suit your database needs. To verify that the variable has been changed:

    mysqld> show global variables like 'innodb_buffer_pool_size'
    

    To continue your search for where it is maybe look in your system logs (usually in /var/log/mysql or similar) for entries indicating MariaDB was started with the innodb_buffer_pool_size option.

    I hope this helps. For more info on tuning InnoDB checkout this article.

    Login or Signup to reply.
  2. If no entry exist in the "my.cnf" configuration file, the default value will be used, as i know.

    See: InnoDB System Variables

    The above suggestion with SET GLOBAL will work, until the server is restarted.

    To set the value permanently, set the variable in your my.cnf config file. Don’t forget to restart the server after that.

    Check the value, by using the system variable in a select command:

    select @@innodb_buffer_pool_size;
    

    The value is represented in bytes. For "human readable", use instead

    select @@innodb_buffer_pool_size/1024/1024/1024;
    
    +------------------------------------------+
    | @@innodb_buffer_pool_size/1024/1024/1024 |
    +------------------------------------------+
    |                           4.000000000000 |
    +------------------------------------------+
    1 row in set (0.000 sec)
    

    In this example, you see, my server is running with a buffer pool size of 4GB

    The represented value in the variable will be depended on your settings, of course. Take a look on the above link. There are plenty recommendation for optimize this (and other) values.

    Edit: to set the value in the configuration file, add this entry in the my.cnf file:

    innodb_buffer_pool_size=[PUT_YOUR_VALUE_HERE]:

    innodb_buffer_pool_size=4096M
    

    will use a buffer_pool_size of 4294967296 bytes.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search