Mariadb配置分配的内存

时间:2017-08-23 08:23:14

标签: mariadb

我想为MariaDB服务器分配更多内存,但我找不到正确的my.cnf文件有困难。

基本上我想编辑innodb_buffer_pool_size

这是/etc/my.cnf

中my.cnf文件的内容
 [mysqld]
    bind-address = ::
    skip_name_resolve
    local-infile=0
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    # Settings user and group are ignored when systemd is used.
    # If you need to run mysqld under a different user or group,
    # customize your systemd unit file for mariadb according to the
    # instructions in http://fedoraproject.org/wiki/Systemd

    [mysqld_safe]
    log-error=/var/log/mariadb/mariadb.log
    pid-file=/var/run/mariadb/mariadb.pid

    #
    # include all files from the config directory
    !includedir /etc/my.cnf.d

所以我继续检查/etc/my.cnf.d中的文件以获取innodb_buffer_pool_size值,但大多数文件几乎都是空的。

我应该只添加我喜欢的值的字符串吗?或者我找错了地方?

使用Plesk 17.5.3#18 CentOS 7和MariaDB 10.1.25

希望有人可以帮我解决这个问题。

我按照建议将inno_db_buffer_size添加到my.cnf,但是

嗨,我调整了值并重新启动了服务,但是当我运行时: https://github.com/major/MySQLTuner-perl 它给了我以下输出:

嗨,我调整了值并重新启动了服务,但是当我运行时: https://github.com/major/MySQLTuner-perl 它给了我以下输出:

    Set thread_cache_size to 4 as a starting value
    Performance should be activated for better diagnostics
    Consider installing Sys schema from https://github.com/mysql/mysql-sys
Variables to adjust:
    query_cache_size (=0)
    query_cache_type (=0)
    query_cache_limit (> 1M, or use smaller result sets)
    join_buffer_size (> 256.0K, or always use indexes with joins)
    tmp_table_size (> 16M)
    max_heap_table_size (> 16M)
    thread_cache_size (start at 4)
    performance_schema = ON enable PFS
    innodb_buffer_pool_size (>= 139M) if possible.
    innodb_log_file_size should be (=16M) if possible, so InnoDB total log files size equals to 25% of buffer pool size.
    innodb_buffer_pool_instances (=1)

在我看来,即使我调整了价值,也没有反映出来。 我怎么检查这个?

1 个答案:

答案 0 :(得分:0)

你没有看到innodb_buffer_pool_size。大多数MySQL参数未在/etc/my.cnf中定义,数据库服务器使用默认参数。对于innodb_buffer_pool_size,它是128M 要设置此值不同,只需在[mysqld]的{​​{1}}中进行定义即可。例如/etc/my.cnf