Changes between Version 42 and Version 57 of Ticket #555


Ignore:
Timestamp:
06/24/13 11:12:01 (3 years ago)
Author:
chris
Comment:

I think there is still potential for performance improvements via mysql tuning, however I'm reluctant to allocate additional RAM to MySQL when I'm not sure if the current allocation of 8GB to puffin (it did have 4GB) is going to be permanent.

Following is the latest result of perl /usr/local/bin/mysqltuner.pl:

 >>  MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering
[OK] Logged in using credentials from debian maintenance account.

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.31-MariaDB-1~squeeze-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB +Federated +InnoDB -ISAM -NDBCluster 
[--] Data in MyISAM tables: 104M (Tables: 2)
[--] Data in InnoDB tables: 456M (Tables: 1037)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 101

-------- Security Recommendations  -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 20h 55m 18s (5M q [67.881 qps], 130K conn, TX: 9B, RX: 841M)
[--] Reads / Writes: 82% / 18%
[--] Total buffers: 1.3G global + 14.4M per thread (100 max threads)
[OK] Maximum possible memory usage: 2.7G (33% of installed RAM)
[OK] Slow queries: 0% (24/5M)
[OK] Highest usage of available connections: 60% (60/100)
[OK] Key buffer size / total MyISAM indexes: 509.0M/93.9M
[OK] Key buffer hit rate: 98.7% (9M cached / 117K reads)
[OK] Query cache efficiency: 78.3% (3M cached / 4M selects)
[!!] Query cache prunes per day: 486359
[OK] Sorts requiring temporary tables: 2% (3K temp sorts / 109K sorts)
[!!] Joins performed without indexes: 4597
[!!] Temporary tables created on disk: 27% (37K on disk / 136K total)
[OK] Thread cache hit rate: 99% (60 created / 130K connections)
[!!] Table cache hit rate: 0% (256 open / 38K opened)
[OK] Open file limit used: 0% (6/196K)
[OK] Table locks acquired immediately: 99% (1M immediate / 1M locks)
[OK] InnoDB data size / buffer pool: 456.7M/509.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    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_cache gradually to avoid file descriptor limits
Variables to adjust:
    query_cache_size (> 128M)
    join_buffer_size (> 2.0M, or always use indexes with joins)
    tmp_table_size (> 128M)
    max_heap_table_size (> 256M)
    table_cache (> 256)

And this is the result of the /usr/local/bin/tuning-primer.sh script, found via, http://www.day32.com/MySQL/

        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.5.31-MariaDB-1~squeeze-log x86_64

Uptime = 0 days 20 hrs 57 min 38 sec
Avg. qps = 67
Total Questions = 5123458
Threads Connected = 3

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.5/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 enabled.
Current long_query_time = 5.000000 sec.
You have 25 out of 5123512 that take longer than 5.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.5/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 128
Current threads_cached = 58
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 2
Historic max_used_connections = 60
The number of used connections is 60% of the configured maximum.
Your max_connections variable seems to be fine.

INNODB STATUS
Current InnoDB index space = 177 M
Current InnoDB data space = 457 M
Current InnoDB buffer pool free = 0 %
Current innodb_buffer_pool_size = 509 M
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 : 1.97 G
Configured Max Per-thread Buffers : 1.40 G
Configured Max Global Buffers : 1.13 G
Configured Max Memory Limit : 2.53 G
Physical Memory : 7.98 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 93 M
Current key_buffer_size = 509 M
Key cache miss rate is 1 : 78
Key buffer free ratio = 81 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 128 M
Current query_cache_used = 78 M
Current query_cache_limit = 128 K
Current Query cache Memory fill ratio = 61.62 %
Current query_cache_min_res_unit = 4 K
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 128 K
Current read_rnd_buffer_size = 4 M
Sort buffer seems to be fine

JOINS
tuning-primer.sh: line 402: export: `2097152': not a valid identifier
Current join_buffer_size = 2.00 M
You have had 4607 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 = 196608 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 = 256 tables
Current table_definition_cache = 512 tables
You have a total of 1080 tables
You have 256 open tables.
Current table_cache hit rate is 0%
, while 100% of your table cache is in use
You should probably increase your table_cache
You should probably increase your table_definition_cache value.

TEMP TABLES
Current max_heap_table_size = 256 M
Current tmp_table_size = 128 M
Of 99254 temp tables, 27% 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 = 8 M
Current table scan ratio = 92 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 114280
Your table locking seems to be fine

The description of this ticket has been edited.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #555

    • Property Add Hours to Ticket changed from 0.75 to 0.25
    • Property Total Hours changed from 10.53 to 21.93
    • Property Summary changed from 12 mins of downtime on 29th May 2013 to Load spikes causing the TN site to be stopped for 15 min at a time
  • Ticket #555 – Description

    v42 v57  
    1 EDIT: The title of this ticket has been changed, see also ticket:563 
     1The BOA {{{/var/xdrago/second.sh}}} script is run every minute via the root crontab and if it detects a certain load level it changes the nginx config to a "high load" config which results in bots being served 503 errors when they spider the site, see ticket:563. When the load goes higher and hits another threshold the {{{second.sh}}} script kills the webserver applications, nginx and php-fpm, and waits till the load has dropped before starting them up again. This was happening once or twice a day following the increase in traffic around the launch of [https://www.transitionnetwork.org/power-just-doing-stuff The Power of Just Doing Stuff]. This has been addressed by multiplying the thresholds by 5 in {{{second.sh}}}. 
     2 
     3== Original Description == 
    24 
    35This morning at 10:19:24 I received the following alert from puffin: