Magento - correct configuration of my.cnf












1















I'm trying to tweak my MySQL config on my Magento 1.9 install, without Full Page Cache installed on the server it run's really slow and I'm pretty sure its something to do with the MySQL Config.



Could you take a look at my my.cnf file and share some recommendations - I've run mysqltuner.pl and I'll share this information too:



File: my.cnf



[client]
port=3306
socket=/var/run/mysqld/mysqld.sock

[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock

[mysqld]
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
log_error=/var/log/mysql/error.log

symbolic-links=0

skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 256M
table_open_cache = 1024
sort_buffer_size = 8M
read_buffer_size = 8M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 16M
innodb_buffer_pool_size = 7G

#innodb_use_native_aio = 0
innodb_file_per_table

max_connections=200
max_user_connections=100
wait_timeout=1800
connect_timeout=120
interactive_timeout=50
long_query_time=5

!includedir /etc/mysql/conf.d/


The mysqltuner report:



-------- Log file Recommendations ------------------------------------------------------------------
[--] Log file: /var/log/mysql/error.log(24K)
[OK] Log file /var/log/mysql/error.log exists
[OK] Log file /var/log/mysql/error.log is readable.
[OK] Log file /var/log/mysql/error.log is not empty
[OK] Log file /var/log/mysql/error.log is smaller than 32 Mb
[!!] /var/log/mysql/error.log contains 21 warning(s).
[OK] /var/log/mysql/error.log doesn't contain any error.
[--] 0 start(s) detected in /var/log/mysql/error.log
[--] 0 shutdown(s) detected in /var/log/mysql/error.log

-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
[--] Data in MyISAM tables: 10M (Tables: 14)
[--] Data in InnoDB tables: 7G (Tables: 733)
[--] Data in MEMORY tables: 3M (Tables: 34)
[!!] Total fragmented tables: 3

-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] User 'db_db@%' hasn't specific host restriction.
[!!] User 'db_db@%' hasn't specific host restriction.
[--] There are 612 basic passwords in the list.

-------- CVE Security Recommendations --------------------------------------------------------------
[OK] NO SECURITY CVE FOUND FOR YOUR VERSION

-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 4d 0h 33m 27s (275M q [793.345 qps], 528K conn, TX: 247G, RX: 112G)
[--] Reads / Writes: 99% / 1%
[--] Binary logging is disabled
[--] Physical Memory : 11.7G
[--] Max MySQL memory : 13.6G
[--] Other process memory: 326.1M
[--] Total buffers: 7.3G global + 32.5M per thread (200 max threads)
[--] P_S Max memory usage: 72B
[--] Galera GCache Max memory usage: 0B
[!!] Maximum reached memory usage: 10.5G (89.78% of installed RAM)
[!!] Maximum possible memory usage: 13.6G (116.29% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (0/275M)
[OK] Highest usage of available connections: 51% (102/200)
[OK] Aborted connections: 2.80% (14817/528902)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[!!] Query cache may be disabled by default due to mutex contention.
[!!] Query cache efficiency: 0.0% (0 cached / 271M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (476 temp sorts / 48M sorts)
[!!] Joins performed without indexes: 3032285
[!!] Temporary tables created on disk: 54% (20M on disk / 36M total)
[OK] Thread cache hit rate: 98% (7K created / 528K connections)
[!!] Table cache hit rate: 0% (400 open / 53M opened)
[OK] Open file limit used: 0% (0/1K)
[OK] Table locks acquired immediately: 99% (3M immediate / 3M locks)

-------- Performance schema ------------------------------------------------------------------------
[--] Memory used by P_S: 72B
[--] Sys schema is installed.

-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is disabled.

-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.2% (48M used / 268M cache)
[OK] Key buffer size / total MyISAM indexes: 256.0M/5.7M
[OK] Read Key buffer hit rate: 96.1% (17M cached / 667K reads)
[!!] Write Key buffer hit rate: 59.5% (722K cached / 430K writes)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[!!] InnoDB buffer pool / data size: 7.0G/7.4G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (1.33928571428571 %): 48.0M * 2/7.0G should be equal 25%
[!!] InnoDB buffer pool instances: 8
[--] Number of InnoDB Buffer Pool Chunk : 56 for 8 Buffer Pool Instance(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Read buffer efficiency: 100.00% (166321305029 hits/ 166321346229 total)
[!!] InnoDB Write Log efficiency: 86.55% (4331380 hits/ 5004636 total)
[OK] InnoDB log waits: 0.00% (0 waits / 673256 writes)

-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is disabled.

-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.

-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.

-------- RocksDB Metrics ---------------------------------------------------------------------------
[--] RocksDB is disabled.

-------- Spider Metrics ----------------------------------------------------------------------------
[--] Spider is disabled.

-------- Connect Metrics ---------------------------------------------------------------------------
[--] Connect is disabled.

-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.

-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] This is a standalone server.

-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
Control warning line(s) into /var/log/mysql/error.log file
Run OPTIMIZE TABLE to defragment tables for better performance
OPTIMIZE TABLE `db_db.log_visitor`; -- can free 66 MB
OPTIMIZE TABLE `db_db.log_visitor_info`; -- can free 101 MB
OPTIMIZE TABLE `db_db.report_event`; -- can free 55 MB
Total freed space after theses OPTIMIZE TABLE : 222 Mb
Restrict Host for user@% to user@SpecificDNSorIp
Reduce your overall MySQL memory footprint for system stability
Dedicate this server to your database for highest performance.
Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
Adjust your join queries to always utilize indexes
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries which have no LIMIT clause
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
Beware that open_files_limit (1024) variable
should be greater than table_open_cache (407)
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
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)
table_open_cache (> 407)
innodb_buffer_pool_size (>= 7G) if possible.
innodb_log_file_size * innodb_log_files_in_group should be equal to 1/4 of buffer pool size (=3G) if possible.
innodb_buffer_pool_instances(=7)


Server Spec



12 CPU's
12GB Ram










share|improve this question
















bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    1















    I'm trying to tweak my MySQL config on my Magento 1.9 install, without Full Page Cache installed on the server it run's really slow and I'm pretty sure its something to do with the MySQL Config.



    Could you take a look at my my.cnf file and share some recommendations - I've run mysqltuner.pl and I'll share this information too:



    File: my.cnf



    [client]
    port=3306
    socket=/var/run/mysqld/mysqld.sock

    [mysqld_safe]
    socket=/var/run/mysqld/mysqld.sock

    [mysqld]
    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
    log_error=/var/log/mysql/error.log

    symbolic-links=0

    skip-external-locking
    key_buffer_size = 256M
    max_allowed_packet = 256M
    table_open_cache = 1024
    sort_buffer_size = 8M
    read_buffer_size = 8M
    read_rnd_buffer_size = 16M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size = 16M
    innodb_buffer_pool_size = 7G

    #innodb_use_native_aio = 0
    innodb_file_per_table

    max_connections=200
    max_user_connections=100
    wait_timeout=1800
    connect_timeout=120
    interactive_timeout=50
    long_query_time=5

    !includedir /etc/mysql/conf.d/


    The mysqltuner report:



    -------- Log file Recommendations ------------------------------------------------------------------
    [--] Log file: /var/log/mysql/error.log(24K)
    [OK] Log file /var/log/mysql/error.log exists
    [OK] Log file /var/log/mysql/error.log is readable.
    [OK] Log file /var/log/mysql/error.log is not empty
    [OK] Log file /var/log/mysql/error.log is smaller than 32 Mb
    [!!] /var/log/mysql/error.log contains 21 warning(s).
    [OK] /var/log/mysql/error.log doesn't contain any error.
    [--] 0 start(s) detected in /var/log/mysql/error.log
    [--] 0 shutdown(s) detected in /var/log/mysql/error.log

    -------- Storage Engine Statistics -----------------------------------------------------------------
    [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
    [--] Data in MyISAM tables: 10M (Tables: 14)
    [--] Data in InnoDB tables: 7G (Tables: 733)
    [--] Data in MEMORY tables: 3M (Tables: 34)
    [!!] Total fragmented tables: 3

    -------- Security Recommendations ------------------------------------------------------------------
    [OK] There are no anonymous accounts for any database users
    [OK] All database users have passwords assigned
    [!!] User 'db_db@%' hasn't specific host restriction.
    [!!] User 'db_db@%' hasn't specific host restriction.
    [--] There are 612 basic passwords in the list.

    -------- CVE Security Recommendations --------------------------------------------------------------
    [OK] NO SECURITY CVE FOUND FOR YOUR VERSION

    -------- Performance Metrics -----------------------------------------------------------------------
    [--] Up for: 4d 0h 33m 27s (275M q [793.345 qps], 528K conn, TX: 247G, RX: 112G)
    [--] Reads / Writes: 99% / 1%
    [--] Binary logging is disabled
    [--] Physical Memory : 11.7G
    [--] Max MySQL memory : 13.6G
    [--] Other process memory: 326.1M
    [--] Total buffers: 7.3G global + 32.5M per thread (200 max threads)
    [--] P_S Max memory usage: 72B
    [--] Galera GCache Max memory usage: 0B
    [!!] Maximum reached memory usage: 10.5G (89.78% of installed RAM)
    [!!] Maximum possible memory usage: 13.6G (116.29% of installed RAM)
    [!!] Overall possible memory usage with other process exceeded memory
    [OK] Slow queries: 0% (0/275M)
    [OK] Highest usage of available connections: 51% (102/200)
    [OK] Aborted connections: 2.80% (14817/528902)
    [!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
    [!!] Query cache may be disabled by default due to mutex contention.
    [!!] Query cache efficiency: 0.0% (0 cached / 271M selects)
    [OK] Query cache prunes per day: 0
    [OK] Sorts requiring temporary tables: 0% (476 temp sorts / 48M sorts)
    [!!] Joins performed without indexes: 3032285
    [!!] Temporary tables created on disk: 54% (20M on disk / 36M total)
    [OK] Thread cache hit rate: 98% (7K created / 528K connections)
    [!!] Table cache hit rate: 0% (400 open / 53M opened)
    [OK] Open file limit used: 0% (0/1K)
    [OK] Table locks acquired immediately: 99% (3M immediate / 3M locks)

    -------- Performance schema ------------------------------------------------------------------------
    [--] Memory used by P_S: 72B
    [--] Sys schema is installed.

    -------- ThreadPool Metrics ------------------------------------------------------------------------
    [--] ThreadPool stat is disabled.

    -------- MyISAM Metrics ----------------------------------------------------------------------------
    [!!] Key buffer used: 18.2% (48M used / 268M cache)
    [OK] Key buffer size / total MyISAM indexes: 256.0M/5.7M
    [OK] Read Key buffer hit rate: 96.1% (17M cached / 667K reads)
    [!!] Write Key buffer hit rate: 59.5% (722K cached / 430K writes)

    -------- InnoDB Metrics ----------------------------------------------------------------------------
    [--] InnoDB is enabled.
    [--] InnoDB Thread Concurrency: 0
    [OK] InnoDB File per table is activated
    [!!] InnoDB buffer pool / data size: 7.0G/7.4G
    [!!] Ratio InnoDB log file size / InnoDB Buffer pool size (1.33928571428571 %): 48.0M * 2/7.0G should be equal 25%
    [!!] InnoDB buffer pool instances: 8
    [--] Number of InnoDB Buffer Pool Chunk : 56 for 8 Buffer Pool Instance(s)
    [OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
    [OK] InnoDB Read buffer efficiency: 100.00% (166321305029 hits/ 166321346229 total)
    [!!] InnoDB Write Log efficiency: 86.55% (4331380 hits/ 5004636 total)
    [OK] InnoDB log waits: 0.00% (0 waits / 673256 writes)

    -------- AriaDB Metrics ----------------------------------------------------------------------------
    [--] AriaDB is disabled.

    -------- TokuDB Metrics ----------------------------------------------------------------------------
    [--] TokuDB is disabled.

    -------- XtraDB Metrics ----------------------------------------------------------------------------
    [--] XtraDB is disabled.

    -------- RocksDB Metrics ---------------------------------------------------------------------------
    [--] RocksDB is disabled.

    -------- Spider Metrics ----------------------------------------------------------------------------
    [--] Spider is disabled.

    -------- Connect Metrics ---------------------------------------------------------------------------
    [--] Connect is disabled.

    -------- Galera Metrics ----------------------------------------------------------------------------
    [--] Galera is disabled.

    -------- Replication Metrics -----------------------------------------------------------------------
    [--] Galera Synchronous replication: NO
    [--] No replication slave(s) for this server.
    [--] This is a standalone server.

    -------- Recommendations ---------------------------------------------------------------------------
    General recommendations:
    Control warning line(s) into /var/log/mysql/error.log file
    Run OPTIMIZE TABLE to defragment tables for better performance
    OPTIMIZE TABLE `db_db.log_visitor`; -- can free 66 MB
    OPTIMIZE TABLE `db_db.log_visitor_info`; -- can free 101 MB
    OPTIMIZE TABLE `db_db.report_event`; -- can free 55 MB
    Total freed space after theses OPTIMIZE TABLE : 222 Mb
    Restrict Host for user@% to user@SpecificDNSorIp
    Reduce your overall MySQL memory footprint for system stability
    Dedicate this server to your database for highest performance.
    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
    Adjust your join queries to always utilize indexes
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries which have no LIMIT clause
    Increase table_open_cache gradually to avoid file descriptor limits
    Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
    Beware that open_files_limit (1024) variable
    should be greater than table_open_cache (407)
    Variables to adjust:
    *** MySQL's maximum memory usage is dangerously high ***
    *** Add RAM before increasing MySQL buffer variables ***
    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)
    table_open_cache (> 407)
    innodb_buffer_pool_size (>= 7G) if possible.
    innodb_log_file_size * innodb_log_files_in_group should be equal to 1/4 of buffer pool size (=3G) if possible.
    innodb_buffer_pool_instances(=7)


    Server Spec



    12 CPU's
    12GB Ram










    share|improve this question
















    bumped to the homepage by Community 4 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      1












      1








      1


      1






      I'm trying to tweak my MySQL config on my Magento 1.9 install, without Full Page Cache installed on the server it run's really slow and I'm pretty sure its something to do with the MySQL Config.



      Could you take a look at my my.cnf file and share some recommendations - I've run mysqltuner.pl and I'll share this information too:



      File: my.cnf



      [client]
      port=3306
      socket=/var/run/mysqld/mysqld.sock

      [mysqld_safe]
      socket=/var/run/mysqld/mysqld.sock

      [mysqld]
      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
      log_error=/var/log/mysql/error.log

      symbolic-links=0

      skip-external-locking
      key_buffer_size = 256M
      max_allowed_packet = 256M
      table_open_cache = 1024
      sort_buffer_size = 8M
      read_buffer_size = 8M
      read_rnd_buffer_size = 16M
      myisam_sort_buffer_size = 64M
      thread_cache_size = 8
      query_cache_size = 16M
      innodb_buffer_pool_size = 7G

      #innodb_use_native_aio = 0
      innodb_file_per_table

      max_connections=200
      max_user_connections=100
      wait_timeout=1800
      connect_timeout=120
      interactive_timeout=50
      long_query_time=5

      !includedir /etc/mysql/conf.d/


      The mysqltuner report:



      -------- Log file Recommendations ------------------------------------------------------------------
      [--] Log file: /var/log/mysql/error.log(24K)
      [OK] Log file /var/log/mysql/error.log exists
      [OK] Log file /var/log/mysql/error.log is readable.
      [OK] Log file /var/log/mysql/error.log is not empty
      [OK] Log file /var/log/mysql/error.log is smaller than 32 Mb
      [!!] /var/log/mysql/error.log contains 21 warning(s).
      [OK] /var/log/mysql/error.log doesn't contain any error.
      [--] 0 start(s) detected in /var/log/mysql/error.log
      [--] 0 shutdown(s) detected in /var/log/mysql/error.log

      -------- Storage Engine Statistics -----------------------------------------------------------------
      [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
      [--] Data in MyISAM tables: 10M (Tables: 14)
      [--] Data in InnoDB tables: 7G (Tables: 733)
      [--] Data in MEMORY tables: 3M (Tables: 34)
      [!!] Total fragmented tables: 3

      -------- Security Recommendations ------------------------------------------------------------------
      [OK] There are no anonymous accounts for any database users
      [OK] All database users have passwords assigned
      [!!] User 'db_db@%' hasn't specific host restriction.
      [!!] User 'db_db@%' hasn't specific host restriction.
      [--] There are 612 basic passwords in the list.

      -------- CVE Security Recommendations --------------------------------------------------------------
      [OK] NO SECURITY CVE FOUND FOR YOUR VERSION

      -------- Performance Metrics -----------------------------------------------------------------------
      [--] Up for: 4d 0h 33m 27s (275M q [793.345 qps], 528K conn, TX: 247G, RX: 112G)
      [--] Reads / Writes: 99% / 1%
      [--] Binary logging is disabled
      [--] Physical Memory : 11.7G
      [--] Max MySQL memory : 13.6G
      [--] Other process memory: 326.1M
      [--] Total buffers: 7.3G global + 32.5M per thread (200 max threads)
      [--] P_S Max memory usage: 72B
      [--] Galera GCache Max memory usage: 0B
      [!!] Maximum reached memory usage: 10.5G (89.78% of installed RAM)
      [!!] Maximum possible memory usage: 13.6G (116.29% of installed RAM)
      [!!] Overall possible memory usage with other process exceeded memory
      [OK] Slow queries: 0% (0/275M)
      [OK] Highest usage of available connections: 51% (102/200)
      [OK] Aborted connections: 2.80% (14817/528902)
      [!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
      [!!] Query cache may be disabled by default due to mutex contention.
      [!!] Query cache efficiency: 0.0% (0 cached / 271M selects)
      [OK] Query cache prunes per day: 0
      [OK] Sorts requiring temporary tables: 0% (476 temp sorts / 48M sorts)
      [!!] Joins performed without indexes: 3032285
      [!!] Temporary tables created on disk: 54% (20M on disk / 36M total)
      [OK] Thread cache hit rate: 98% (7K created / 528K connections)
      [!!] Table cache hit rate: 0% (400 open / 53M opened)
      [OK] Open file limit used: 0% (0/1K)
      [OK] Table locks acquired immediately: 99% (3M immediate / 3M locks)

      -------- Performance schema ------------------------------------------------------------------------
      [--] Memory used by P_S: 72B
      [--] Sys schema is installed.

      -------- ThreadPool Metrics ------------------------------------------------------------------------
      [--] ThreadPool stat is disabled.

      -------- MyISAM Metrics ----------------------------------------------------------------------------
      [!!] Key buffer used: 18.2% (48M used / 268M cache)
      [OK] Key buffer size / total MyISAM indexes: 256.0M/5.7M
      [OK] Read Key buffer hit rate: 96.1% (17M cached / 667K reads)
      [!!] Write Key buffer hit rate: 59.5% (722K cached / 430K writes)

      -------- InnoDB Metrics ----------------------------------------------------------------------------
      [--] InnoDB is enabled.
      [--] InnoDB Thread Concurrency: 0
      [OK] InnoDB File per table is activated
      [!!] InnoDB buffer pool / data size: 7.0G/7.4G
      [!!] Ratio InnoDB log file size / InnoDB Buffer pool size (1.33928571428571 %): 48.0M * 2/7.0G should be equal 25%
      [!!] InnoDB buffer pool instances: 8
      [--] Number of InnoDB Buffer Pool Chunk : 56 for 8 Buffer Pool Instance(s)
      [OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
      [OK] InnoDB Read buffer efficiency: 100.00% (166321305029 hits/ 166321346229 total)
      [!!] InnoDB Write Log efficiency: 86.55% (4331380 hits/ 5004636 total)
      [OK] InnoDB log waits: 0.00% (0 waits / 673256 writes)

      -------- AriaDB Metrics ----------------------------------------------------------------------------
      [--] AriaDB is disabled.

      -------- TokuDB Metrics ----------------------------------------------------------------------------
      [--] TokuDB is disabled.

      -------- XtraDB Metrics ----------------------------------------------------------------------------
      [--] XtraDB is disabled.

      -------- RocksDB Metrics ---------------------------------------------------------------------------
      [--] RocksDB is disabled.

      -------- Spider Metrics ----------------------------------------------------------------------------
      [--] Spider is disabled.

      -------- Connect Metrics ---------------------------------------------------------------------------
      [--] Connect is disabled.

      -------- Galera Metrics ----------------------------------------------------------------------------
      [--] Galera is disabled.

      -------- Replication Metrics -----------------------------------------------------------------------
      [--] Galera Synchronous replication: NO
      [--] No replication slave(s) for this server.
      [--] This is a standalone server.

      -------- Recommendations ---------------------------------------------------------------------------
      General recommendations:
      Control warning line(s) into /var/log/mysql/error.log file
      Run OPTIMIZE TABLE to defragment tables for better performance
      OPTIMIZE TABLE `db_db.log_visitor`; -- can free 66 MB
      OPTIMIZE TABLE `db_db.log_visitor_info`; -- can free 101 MB
      OPTIMIZE TABLE `db_db.report_event`; -- can free 55 MB
      Total freed space after theses OPTIMIZE TABLE : 222 Mb
      Restrict Host for user@% to user@SpecificDNSorIp
      Reduce your overall MySQL memory footprint for system stability
      Dedicate this server to your database for highest performance.
      Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
      Adjust your join queries to always utilize indexes
      When making adjustments, make tmp_table_size/max_heap_table_size equal
      Reduce your SELECT DISTINCT queries which have no LIMIT clause
      Increase table_open_cache gradually to avoid file descriptor limits
      Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
      Beware that open_files_limit (1024) variable
      should be greater than table_open_cache (407)
      Variables to adjust:
      *** MySQL's maximum memory usage is dangerously high ***
      *** Add RAM before increasing MySQL buffer variables ***
      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)
      table_open_cache (> 407)
      innodb_buffer_pool_size (>= 7G) if possible.
      innodb_log_file_size * innodb_log_files_in_group should be equal to 1/4 of buffer pool size (=3G) if possible.
      innodb_buffer_pool_instances(=7)


      Server Spec



      12 CPU's
      12GB Ram










      share|improve this question
















      I'm trying to tweak my MySQL config on my Magento 1.9 install, without Full Page Cache installed on the server it run's really slow and I'm pretty sure its something to do with the MySQL Config.



      Could you take a look at my my.cnf file and share some recommendations - I've run mysqltuner.pl and I'll share this information too:



      File: my.cnf



      [client]
      port=3306
      socket=/var/run/mysqld/mysqld.sock

      [mysqld_safe]
      socket=/var/run/mysqld/mysqld.sock

      [mysqld]
      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
      log_error=/var/log/mysql/error.log

      symbolic-links=0

      skip-external-locking
      key_buffer_size = 256M
      max_allowed_packet = 256M
      table_open_cache = 1024
      sort_buffer_size = 8M
      read_buffer_size = 8M
      read_rnd_buffer_size = 16M
      myisam_sort_buffer_size = 64M
      thread_cache_size = 8
      query_cache_size = 16M
      innodb_buffer_pool_size = 7G

      #innodb_use_native_aio = 0
      innodb_file_per_table

      max_connections=200
      max_user_connections=100
      wait_timeout=1800
      connect_timeout=120
      interactive_timeout=50
      long_query_time=5

      !includedir /etc/mysql/conf.d/


      The mysqltuner report:



      -------- Log file Recommendations ------------------------------------------------------------------
      [--] Log file: /var/log/mysql/error.log(24K)
      [OK] Log file /var/log/mysql/error.log exists
      [OK] Log file /var/log/mysql/error.log is readable.
      [OK] Log file /var/log/mysql/error.log is not empty
      [OK] Log file /var/log/mysql/error.log is smaller than 32 Mb
      [!!] /var/log/mysql/error.log contains 21 warning(s).
      [OK] /var/log/mysql/error.log doesn't contain any error.
      [--] 0 start(s) detected in /var/log/mysql/error.log
      [--] 0 shutdown(s) detected in /var/log/mysql/error.log

      -------- Storage Engine Statistics -----------------------------------------------------------------
      [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
      [--] Data in MyISAM tables: 10M (Tables: 14)
      [--] Data in InnoDB tables: 7G (Tables: 733)
      [--] Data in MEMORY tables: 3M (Tables: 34)
      [!!] Total fragmented tables: 3

      -------- Security Recommendations ------------------------------------------------------------------
      [OK] There are no anonymous accounts for any database users
      [OK] All database users have passwords assigned
      [!!] User 'db_db@%' hasn't specific host restriction.
      [!!] User 'db_db@%' hasn't specific host restriction.
      [--] There are 612 basic passwords in the list.

      -------- CVE Security Recommendations --------------------------------------------------------------
      [OK] NO SECURITY CVE FOUND FOR YOUR VERSION

      -------- Performance Metrics -----------------------------------------------------------------------
      [--] Up for: 4d 0h 33m 27s (275M q [793.345 qps], 528K conn, TX: 247G, RX: 112G)
      [--] Reads / Writes: 99% / 1%
      [--] Binary logging is disabled
      [--] Physical Memory : 11.7G
      [--] Max MySQL memory : 13.6G
      [--] Other process memory: 326.1M
      [--] Total buffers: 7.3G global + 32.5M per thread (200 max threads)
      [--] P_S Max memory usage: 72B
      [--] Galera GCache Max memory usage: 0B
      [!!] Maximum reached memory usage: 10.5G (89.78% of installed RAM)
      [!!] Maximum possible memory usage: 13.6G (116.29% of installed RAM)
      [!!] Overall possible memory usage with other process exceeded memory
      [OK] Slow queries: 0% (0/275M)
      [OK] Highest usage of available connections: 51% (102/200)
      [OK] Aborted connections: 2.80% (14817/528902)
      [!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
      [!!] Query cache may be disabled by default due to mutex contention.
      [!!] Query cache efficiency: 0.0% (0 cached / 271M selects)
      [OK] Query cache prunes per day: 0
      [OK] Sorts requiring temporary tables: 0% (476 temp sorts / 48M sorts)
      [!!] Joins performed without indexes: 3032285
      [!!] Temporary tables created on disk: 54% (20M on disk / 36M total)
      [OK] Thread cache hit rate: 98% (7K created / 528K connections)
      [!!] Table cache hit rate: 0% (400 open / 53M opened)
      [OK] Open file limit used: 0% (0/1K)
      [OK] Table locks acquired immediately: 99% (3M immediate / 3M locks)

      -------- Performance schema ------------------------------------------------------------------------
      [--] Memory used by P_S: 72B
      [--] Sys schema is installed.

      -------- ThreadPool Metrics ------------------------------------------------------------------------
      [--] ThreadPool stat is disabled.

      -------- MyISAM Metrics ----------------------------------------------------------------------------
      [!!] Key buffer used: 18.2% (48M used / 268M cache)
      [OK] Key buffer size / total MyISAM indexes: 256.0M/5.7M
      [OK] Read Key buffer hit rate: 96.1% (17M cached / 667K reads)
      [!!] Write Key buffer hit rate: 59.5% (722K cached / 430K writes)

      -------- InnoDB Metrics ----------------------------------------------------------------------------
      [--] InnoDB is enabled.
      [--] InnoDB Thread Concurrency: 0
      [OK] InnoDB File per table is activated
      [!!] InnoDB buffer pool / data size: 7.0G/7.4G
      [!!] Ratio InnoDB log file size / InnoDB Buffer pool size (1.33928571428571 %): 48.0M * 2/7.0G should be equal 25%
      [!!] InnoDB buffer pool instances: 8
      [--] Number of InnoDB Buffer Pool Chunk : 56 for 8 Buffer Pool Instance(s)
      [OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
      [OK] InnoDB Read buffer efficiency: 100.00% (166321305029 hits/ 166321346229 total)
      [!!] InnoDB Write Log efficiency: 86.55% (4331380 hits/ 5004636 total)
      [OK] InnoDB log waits: 0.00% (0 waits / 673256 writes)

      -------- AriaDB Metrics ----------------------------------------------------------------------------
      [--] AriaDB is disabled.

      -------- TokuDB Metrics ----------------------------------------------------------------------------
      [--] TokuDB is disabled.

      -------- XtraDB Metrics ----------------------------------------------------------------------------
      [--] XtraDB is disabled.

      -------- RocksDB Metrics ---------------------------------------------------------------------------
      [--] RocksDB is disabled.

      -------- Spider Metrics ----------------------------------------------------------------------------
      [--] Spider is disabled.

      -------- Connect Metrics ---------------------------------------------------------------------------
      [--] Connect is disabled.

      -------- Galera Metrics ----------------------------------------------------------------------------
      [--] Galera is disabled.

      -------- Replication Metrics -----------------------------------------------------------------------
      [--] Galera Synchronous replication: NO
      [--] No replication slave(s) for this server.
      [--] This is a standalone server.

      -------- Recommendations ---------------------------------------------------------------------------
      General recommendations:
      Control warning line(s) into /var/log/mysql/error.log file
      Run OPTIMIZE TABLE to defragment tables for better performance
      OPTIMIZE TABLE `db_db.log_visitor`; -- can free 66 MB
      OPTIMIZE TABLE `db_db.log_visitor_info`; -- can free 101 MB
      OPTIMIZE TABLE `db_db.report_event`; -- can free 55 MB
      Total freed space after theses OPTIMIZE TABLE : 222 Mb
      Restrict Host for user@% to user@SpecificDNSorIp
      Reduce your overall MySQL memory footprint for system stability
      Dedicate this server to your database for highest performance.
      Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
      Adjust your join queries to always utilize indexes
      When making adjustments, make tmp_table_size/max_heap_table_size equal
      Reduce your SELECT DISTINCT queries which have no LIMIT clause
      Increase table_open_cache gradually to avoid file descriptor limits
      Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
      Beware that open_files_limit (1024) variable
      should be greater than table_open_cache (407)
      Variables to adjust:
      *** MySQL's maximum memory usage is dangerously high ***
      *** Add RAM before increasing MySQL buffer variables ***
      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)
      table_open_cache (> 407)
      innodb_buffer_pool_size (>= 7G) if possible.
      innodb_log_file_size * innodb_log_files_in_group should be equal to 1/4 of buffer pool size (=3G) if possible.
      innodb_buffer_pool_instances(=7)


      Server Spec



      12 CPU's
      12GB Ram







      magento-1.9 database






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 4 '18 at 11:37









      Dhaduk Mitesh

      662218




      662218










      asked Jul 20 '17 at 23:31









      WebDevBWebDevB

      285




      285





      bumped to the homepage by Community 4 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 4 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Suggestions to consider for your my.cnf [mysqld] section to improve performance
          Lead with # spacebar the following to allow defaults vs overallocation for



          sort_buffer_size
          read_buffer_size
          read_rnd_buffer_size


          adjust the following:



          query_cache_type=0  # for NONE to disable QC
          query_cache_size=0 # from 16M
          query_cache_limit=0 # from default for max size of 1 RESULT into QC
          query_cache_min_res_unit=512 # from 4096 to conserve RAM, not used
          thread_cache_size=100 # from 256 for CAP see refman V8 to avoid OOM
          innodb_lru_scan_depth=100 # from 1024 to conserve CPU time every second
          innodb_flush_neighbors=0 # from ON to conserve CPU SSD has no rotational delay
          innodb_purge_threads=4 # from 1 to expedite purge activity
          innodb_flushing_avg_loops=10 # from 30 to reduce loop delays
          max_write_lock_count=16 # to allow RD after nn write lcks vs 4 Billion


          please post progress from time to time, more RAM is needed for your ~800 QPS



          for additional suggestions check my profile, Network profile for contact info.






          share|improve this answer
























          • @webdevb Have you made any progress? If any comments or suggestions have been helpful, please upvote/accept so we know you are making progress.

            – Wilson Hauck
            Jul 30 '18 at 1:09











          • @WebDevB Happy Holidays.

            – Wilson Hauck
            Dec 23 '18 at 20:15











          • @WebDevB Still wondering if you have been able to implement any of the Jul 4, 18 Suggestions? Were the results favorable or unfavorable? Everyone would like to know. Upvote or Accept would be appreciated. Thanks

            – Wilson Hauck
            17 hours ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f184778%2fmagento-correct-configuration-of-my-cnf%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Suggestions to consider for your my.cnf [mysqld] section to improve performance
          Lead with # spacebar the following to allow defaults vs overallocation for



          sort_buffer_size
          read_buffer_size
          read_rnd_buffer_size


          adjust the following:



          query_cache_type=0  # for NONE to disable QC
          query_cache_size=0 # from 16M
          query_cache_limit=0 # from default for max size of 1 RESULT into QC
          query_cache_min_res_unit=512 # from 4096 to conserve RAM, not used
          thread_cache_size=100 # from 256 for CAP see refman V8 to avoid OOM
          innodb_lru_scan_depth=100 # from 1024 to conserve CPU time every second
          innodb_flush_neighbors=0 # from ON to conserve CPU SSD has no rotational delay
          innodb_purge_threads=4 # from 1 to expedite purge activity
          innodb_flushing_avg_loops=10 # from 30 to reduce loop delays
          max_write_lock_count=16 # to allow RD after nn write lcks vs 4 Billion


          please post progress from time to time, more RAM is needed for your ~800 QPS



          for additional suggestions check my profile, Network profile for contact info.






          share|improve this answer
























          • @webdevb Have you made any progress? If any comments or suggestions have been helpful, please upvote/accept so we know you are making progress.

            – Wilson Hauck
            Jul 30 '18 at 1:09











          • @WebDevB Happy Holidays.

            – Wilson Hauck
            Dec 23 '18 at 20:15











          • @WebDevB Still wondering if you have been able to implement any of the Jul 4, 18 Suggestions? Were the results favorable or unfavorable? Everyone would like to know. Upvote or Accept would be appreciated. Thanks

            – Wilson Hauck
            17 hours ago
















          0














          Suggestions to consider for your my.cnf [mysqld] section to improve performance
          Lead with # spacebar the following to allow defaults vs overallocation for



          sort_buffer_size
          read_buffer_size
          read_rnd_buffer_size


          adjust the following:



          query_cache_type=0  # for NONE to disable QC
          query_cache_size=0 # from 16M
          query_cache_limit=0 # from default for max size of 1 RESULT into QC
          query_cache_min_res_unit=512 # from 4096 to conserve RAM, not used
          thread_cache_size=100 # from 256 for CAP see refman V8 to avoid OOM
          innodb_lru_scan_depth=100 # from 1024 to conserve CPU time every second
          innodb_flush_neighbors=0 # from ON to conserve CPU SSD has no rotational delay
          innodb_purge_threads=4 # from 1 to expedite purge activity
          innodb_flushing_avg_loops=10 # from 30 to reduce loop delays
          max_write_lock_count=16 # to allow RD after nn write lcks vs 4 Billion


          please post progress from time to time, more RAM is needed for your ~800 QPS



          for additional suggestions check my profile, Network profile for contact info.






          share|improve this answer
























          • @webdevb Have you made any progress? If any comments or suggestions have been helpful, please upvote/accept so we know you are making progress.

            – Wilson Hauck
            Jul 30 '18 at 1:09











          • @WebDevB Happy Holidays.

            – Wilson Hauck
            Dec 23 '18 at 20:15











          • @WebDevB Still wondering if you have been able to implement any of the Jul 4, 18 Suggestions? Were the results favorable or unfavorable? Everyone would like to know. Upvote or Accept would be appreciated. Thanks

            – Wilson Hauck
            17 hours ago














          0












          0








          0







          Suggestions to consider for your my.cnf [mysqld] section to improve performance
          Lead with # spacebar the following to allow defaults vs overallocation for



          sort_buffer_size
          read_buffer_size
          read_rnd_buffer_size


          adjust the following:



          query_cache_type=0  # for NONE to disable QC
          query_cache_size=0 # from 16M
          query_cache_limit=0 # from default for max size of 1 RESULT into QC
          query_cache_min_res_unit=512 # from 4096 to conserve RAM, not used
          thread_cache_size=100 # from 256 for CAP see refman V8 to avoid OOM
          innodb_lru_scan_depth=100 # from 1024 to conserve CPU time every second
          innodb_flush_neighbors=0 # from ON to conserve CPU SSD has no rotational delay
          innodb_purge_threads=4 # from 1 to expedite purge activity
          innodb_flushing_avg_loops=10 # from 30 to reduce loop delays
          max_write_lock_count=16 # to allow RD after nn write lcks vs 4 Billion


          please post progress from time to time, more RAM is needed for your ~800 QPS



          for additional suggestions check my profile, Network profile for contact info.






          share|improve this answer













          Suggestions to consider for your my.cnf [mysqld] section to improve performance
          Lead with # spacebar the following to allow defaults vs overallocation for



          sort_buffer_size
          read_buffer_size
          read_rnd_buffer_size


          adjust the following:



          query_cache_type=0  # for NONE to disable QC
          query_cache_size=0 # from 16M
          query_cache_limit=0 # from default for max size of 1 RESULT into QC
          query_cache_min_res_unit=512 # from 4096 to conserve RAM, not used
          thread_cache_size=100 # from 256 for CAP see refman V8 to avoid OOM
          innodb_lru_scan_depth=100 # from 1024 to conserve CPU time every second
          innodb_flush_neighbors=0 # from ON to conserve CPU SSD has no rotational delay
          innodb_purge_threads=4 # from 1 to expedite purge activity
          innodb_flushing_avg_loops=10 # from 30 to reduce loop delays
          max_write_lock_count=16 # to allow RD after nn write lcks vs 4 Billion


          please post progress from time to time, more RAM is needed for your ~800 QPS



          for additional suggestions check my profile, Network profile for contact info.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 4 '18 at 11:20









          Wilson HauckWilson Hauck

          1215




          1215













          • @webdevb Have you made any progress? If any comments or suggestions have been helpful, please upvote/accept so we know you are making progress.

            – Wilson Hauck
            Jul 30 '18 at 1:09











          • @WebDevB Happy Holidays.

            – Wilson Hauck
            Dec 23 '18 at 20:15











          • @WebDevB Still wondering if you have been able to implement any of the Jul 4, 18 Suggestions? Were the results favorable or unfavorable? Everyone would like to know. Upvote or Accept would be appreciated. Thanks

            – Wilson Hauck
            17 hours ago



















          • @webdevb Have you made any progress? If any comments or suggestions have been helpful, please upvote/accept so we know you are making progress.

            – Wilson Hauck
            Jul 30 '18 at 1:09











          • @WebDevB Happy Holidays.

            – Wilson Hauck
            Dec 23 '18 at 20:15











          • @WebDevB Still wondering if you have been able to implement any of the Jul 4, 18 Suggestions? Were the results favorable or unfavorable? Everyone would like to know. Upvote or Accept would be appreciated. Thanks

            – Wilson Hauck
            17 hours ago

















          @webdevb Have you made any progress? If any comments or suggestions have been helpful, please upvote/accept so we know you are making progress.

          – Wilson Hauck
          Jul 30 '18 at 1:09





          @webdevb Have you made any progress? If any comments or suggestions have been helpful, please upvote/accept so we know you are making progress.

          – Wilson Hauck
          Jul 30 '18 at 1:09













          @WebDevB Happy Holidays.

          – Wilson Hauck
          Dec 23 '18 at 20:15





          @WebDevB Happy Holidays.

          – Wilson Hauck
          Dec 23 '18 at 20:15













          @WebDevB Still wondering if you have been able to implement any of the Jul 4, 18 Suggestions? Were the results favorable or unfavorable? Everyone would like to know. Upvote or Accept would be appreciated. Thanks

          – Wilson Hauck
          17 hours ago





          @WebDevB Still wondering if you have been able to implement any of the Jul 4, 18 Suggestions? Were the results favorable or unfavorable? Everyone would like to know. Upvote or Accept would be appreciated. Thanks

          – Wilson Hauck
          17 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f184778%2fmagento-correct-configuration-of-my-cnf%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What other Star Trek series did the main TNG cast show up in?

          Berlina muro

          Berlina aerponto