Skip to main content

MySQL 5.6, table_open_cache & swapping

Comments

9 comments

  • kernow
    ......but they don't always seem to provide good information, even after 24 hours of mysql uptime.
    This just isn't long enough. You should wait at least 48 hours before making further edits. I would trust tuning-primer rather than mysqltuner.pl with mysql 5.6 And if you have not given control of innodb_buffer_pool_size to cpanel then you might want to double innodb_buffer_pool_size to 8GB. But I say again, make edits, wait 48 hours before running the tuning script again and making further changes. It can take a week before you get the optimum settings.
    0
  • cPanelMichael
    Hello :) I've moved this thread to our "Optimization" forum. Thank you.
    0
  • wrender
    Thanks. I will wait 48 hours and provide the output from the tuning-primer script.
    0
  • wrender
    I came across this post about setting the correct table_open_cache. [url=http://www.techinfobest.com/optimize-mysql-table_open_cache/]Optimize MySQL table_open_cache - Place of all Tech Info (It might be helpful but not too sure, ... not sure if this is correct advice for setting it). Just made adjustments to our system and going to wait another 48 hours, and run the tuning programs again.
    0
  • wrender
    I've finally let MySQL run for more than 2 days. If anyone can provide some recommendations on our configuration it would be greatly appreciated! I found that if I increase the query cache, it actually ends up slowing things down after about a day. It seems to cause issues with mysql inserts becoming very slow. For this reason I am really hesitant to increase any values that are recommended by the tuning scripts. Also, it appears as though MySQLTuner-perl always says to increase values for Table Cache. Also, noticed that MariaDB is now included with the new cPanel 11.48.x. Once it is moved to "release" tier we will most likely upgrade to that as have heard that it has many performance improvements. Had a hard time finding documentation on what performance improvements MariaDB provides. Sounds like maybe it only provides performance improvements on systems that have over 16 processor cores and handles threads better? Here is my running configuration:
    [mysqld_safe] log-error="/var/log/mysqld.log" [mysqld] socket="/var/lib/mysql/mysql.sock" max_allowed_packet=268435456 max_connections=150 open_files_limit=140000 #InnoDB Settings default-storage-engine=InnoDB innodb_file_per_table=1 innodb_buffer_pool_size=8G innodb_flush_method=O_DIRECT #Query Cache Settings query_cache_size=16M query_cache_type=1 join_buffer_size=1M tmp_table_size=32M max_heap_table_size=32M table_open_cache=70000 table_definition_cache=12000
    Here is tuning-primer output after running for over 48 hours:
    MySQL Version 5.6.22 x86_64 Uptime = 2 days 16 hrs 18 min 34 sec Avg. qps = 137 Total Questions = 31749524 Threads Connected = 12 Server has been running for over 48hrs. It should be safe to follow these recommendations To find out more information on how each of these runtime variables effects performance visit: http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html Visit http://www.mysql.com/products/enterprise/advisors.html for info about MySQL's Enterprise Monitoring and Advisory Service SLOW QUERIES The slow query log is NOT enabled. Current long_query_time = 10.000000 sec. You have 0 out of 31749545 that take longer than 10.000000 sec. to complete Your long_query_time seems to be fine BINARY UPDATE LOG The binary update log is NOT enabled. You will not be able to do point in time recovery See http://dev.mysql.com/doc/refman/5.6/en/point-in-time-recovery.html WORKER THREADS Current thread_cache_size = 9 Current threads_cached = 6 Current threads_per_sec = 0 Historic threads_per_sec = 0 Your thread_cache_size is fine MAX CONNECTIONS Current max_connections = 150 Current threads_connected = 13 Historic max_used_connections = 37 The number of used connections is 24% of the configured maximum. Your max_connections variable seems to be fine. INNODB STATUS Current InnoDB index space = 933 M Current InnoDB data space = 2.78 G Current InnoDB buffer pool free = 49 % Current innodb_buffer_pool_size = 8.00 G Depending on how much space your innodb indexes take up it may be safe to increase this value to up to 2 / 3 of total system memory MEMORY USAGE Max Memory Ever Allocated : 8.10 G Configured Max Per-thread Buffers : 281 M Configured Max Global Buffers : 8.03 G Configured Max Memory Limit : 8.31 G Physical Memory : 41.13 G Max memory limit seem to be within acceptable norms KEY BUFFER Current MyISAM index space = 15 M Current key_buffer_size = 8 M Key cache miss rate is 1 : 475 Key buffer free ratio = 71 % Your key_buffer_size seems to be fine QUERY CACHE Query cache is enabled Current query_cache_size = 16 M Current query_cache_used = 14 M Current query_cache_limit = 1 M Current Query cache Memory fill ratio = 90.14 % Current query_cache_min_res_unit = 4 K However, 3694046 queries have been removed from the query cache due to lack of m emory Perhaps you should raise query_cache_size MySQL won't cache query results that are larger than query_cache_limit in size SORT OPERATIONS Current sort_buffer_size = 256 K Current read_rnd_buffer_size = 256 K Sort buffer seems to be fine JOINS Current join_buffer_size = 1.00 M You have had 10063 queries where a join could not use an index properly You should enable "log-queries-not-using-indexes" Then look for non indexed joins in the slow query log. If you are unable to optimize your queries you may want to increase your join_buffer_size to accommodate larger joins in one pass. Note! This script will still suggest raising the join_buffer_size when ANY joins not using indexes are found. OPEN FILES LIMIT Current open_files_limit = 140160 files The open_files_limit should typically be set to at least 2x-3x that of table_cache if you have heavy MyISAM usage. Your open_files_limit value seems to be fine TABLE CACHE Current table_open_cache = 70000 tables Current table_definition_cache = 12000 tables You have a total of 10740 tables You have 10816 open tables. The table_cache value seems to be fine TEMP TABLES Current max_heap_table_size = 32 M Current tmp_table_size = 32 M Of 753565 temp tables, 29% were created on disk Perhaps you should increase your tmp_table_size and/or max_heap_table_size to reduce the number of disk-based temporary tables Note! BLOB and TEXT columns are not allow in memory tables. If you are using these columns raising these values might not impact your ratio of on disk temp tables. TABLE SCANS Current read_buffer_size = 128 K Current table scan ratio = 16 : 1 read_buffer_size seems to be fine TABLE LOCKING Current Lock Wait ratio = 1 : 280663 Your table locking seems to be fine
    Here is output from MySQLTuner-perl
    >> MySQLTuner 1.4.0 - Major Hayden >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering [OK] Currently running supported MySQL version 5.6.22 [OK] Operating on 64-bit architecture -------- Storage Engine Statistics ------------------------------------------- [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM [--] Data in MyISAM tables: 63M (Tables: 109) [--] Data in InnoDB tables: 2G (Tables: 10533) [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52) [--] Data in MEMORY tables: 0B (Tables: 17) [!!] Total fragmented tables: 229 -------- Security Recommendations ------------------------------------------- [OK] All database users have passwords assigned -------- Performance Metrics ------------------------------------------------- [--] Up for: 2d 16h 28m 29s (31M q [137.107 qps], 250K conn, TX: 118B, RX: 16B) [--] Reads / Writes: 80% / 20% [--] Total buffers: 8.1G global + 1.9M per thread (150 max threads) [OK] Maximum possible memory usage: 8.3G (20% of installed RAM) [OK] Slow queries: 0% (0/31M) [OK] Highest usage of available connections: 24% (37/150) [OK] Key buffer size / total MyISAM indexes: 8.0M/15.7M [OK] Key buffer hit rate: 99.8% (6M cached / 13K reads) [OK] Query cache efficiency: 66.6% (18M cached / 27M selects) [!!] Query cache prunes per day: 1379018 [OK] Sorts requiring temporary tables: 0% (211 temp sorts / 801K sorts) [!!] Joins performed without indexes: 10111 [!!] Temporary tables created on disk: 41% (315K on disk / 755K total) [OK] Thread cache hit rate: 99% (1K created / 250K connections) [!!] Table cache hit rate: 0% (10K open / 8M opened) [OK] Open file limit used: 0% (272/140K) [OK] Table locks acquired immediately: 99% (13M immediate / 13M locks) [OK] InnoDB buffer pool / data size: 8.0G/2.8G [OK] InnoDB log waits: 0 -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance 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 without LIMIT clauses Increase table_open_cache gradually to avoid file descriptor limits Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C Variables to adjust: query_cache_size (> 16M) join_buffer_size (> 1.0M, or always use indexes with joins) tmp_table_size (> 32M) max_heap_table_size (> 32M) table_open_cache (> 70000)
    0
  • cPanelMichael
    ]Also, noticed that MariaDB is now included with the new cPanel 11.48.x. Once it is moved to "release" tier we will most likely upgrade to that as have heard that it has many performance improvements.

    Hello :) cPanel version 11.48 is now available on the "Release" build tier if you want to update to this version. Thank you.
    0
  • wrender
    ]Hello :) cPanel version 11.48 is now available on the "Release" build tier if you want to update to this version. Thank you.

    Amped for ModSecurity and MariaDB!!!
    0
  • wrender
    Came across an issue when upgrading to MariaDB via WHM interface: "Your server"s MySQL/MariaDB MAX_USER_CONNECTIONS value is larger then 2147483647" I've tried adding "max_user_connections=30" in my.cnf and restarting, but still will not load.
    0
  • cPanelMichael
    ]Came across an issue when upgrading to MariaDB via WHM interface: "Your server"s MySQL/MariaDB MAX_USER_CONNECTIONS value is larger then 2147483647" I've tried adding "max_user_connections=30" in my.cnf and restarting, but still will not load.

    Please see this thread: [Case 159129] Upgrade to MariaDB MAX_USER_CONNECTIONS problem Thank you.
    0

Please sign in to leave a comment.