Forum Moderators: phranque
There's your reason right there. Maybe time to upgrade your hosting, or move some sites to a different server.
Before that, do make sure that all of your code is as optimised as possible. Poor PHP and/or mySQL code may be creating more work than is necessary.
Further details :
Hardware
Processor Intel Core2Duo
2x 2.33+ GHz
3 Mo L2 - FSB 1066 MHz
Architecture64 bits
Memory 2 Go DDR2
hard disc 2x 500 Go
type SATA2 - RAID 0/1
i have run the script you adviced here is the output :
General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.44
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated -InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 534M (Tables: 2169)
[!] Total fragmented tables: 101
-------- Performance Metrics -------------------------------------------------
[--] Up for: 23d 5h 30m 8s (2B q [1K qps], 1M conn, TX: 892B, RX: 370B)
[--] Reads / Writes: 91% / 9%
[--] Total buffers: 58.0M global + 1.6M per thread (100 max threads)
[OK] Maximum possible memory usage: 219.7M (11% of installed RAM)
[OK] Slow queries: 0% (42K/2B)
[!] Highest connection usage: 100% (101/100)
[OK] Key buffer size / total MyISAM indexes: 16.0M/92.8M
[OK] Key buffer hit rate: 99.7% (15B cached / 50M reads)
[!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (879K temp sorts / 1B sorts)
[!] Joins performed without indexes: 169473
[OK] Temporary tables created on disk: 0% (554K on disk / 991M total)
[!] Thread cache is disabled
[!] Table cache hit rate: 0% (64 open / 5M opened)
[OK] Open file limit used: 11% (117/1K)
[OK] Table locks acquired immediately: 99% (3B immediate / 3B locks)
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Enable the slow query log to troubleshoot bad queries
Reduce or eliminate persistent connections to reduce connection usage
Adjust your join queries to always utilize indexes
Set thread_cache_size to 4 as a starting value
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
max_connections (> 100)
wait_timeout (< 28800)
interactive_timeout (< 28800)
query_cache_size (>= 8M)
join_buffer_size (> 128.0K, or always use indexes with joins)
thread_cache_size (start at 4)
table_cache (> 64)
thanks
Make a copy of your my.cnf file and make some changes. Either edit or add the following:
[mysqld]
thread_cache_size = 4
key_buffer = 100M
table_cache = 640
query_cache_size = 32M
Restart mysql and run the test again after 5 mins to check the following:
[--] Total buffers: 58.0M global + 1.6M per thread (100 max threads)
[OK] Maximum possible memory usage: 219.7M (11% of installed RAM)
What we want to do is to give mysql more of the available RAM but not too much such that other services on the server suffer.
Run the test again a day later and check the thread cache, connections, timeouts etc.
I would look at increasing further the thread_cache_size and the query_cache_size.
table_cache = 4096
thread_cache_size = 64
key_buffer = 64M
query_cache_size = 64M
join_buffer_size = 256K
I made the changes you adviced me, restarted mysql and run again the mysqltuner.pl file here is the output :
>> MySQLTuner 1.0.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at [mysqltuner.com...]
>> Run with '--help' for additional options and output filtering
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.44
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated -InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 579M (Tables: 2179)
[!] Total fragmented tables: 112
-------- Performance Metrics -------------------------------------------------
[--] Up for: 2h 54m 17s (27M q [2K qps], 11K conn, TX: 13B, RX: 4B)
[--] Reads / Writes: 91% / 9%
[--] Total buffers: 174.0M global + 1.6M per thread (100 max threads)
[OK] Maximum possible memory usage: 335.7M (16% of installed RAM)
[OK] Slow queries: 0% (1/27M)
[OK] Highest usage of available connections: 9% (9/100)
[OK] Key buffer size / total MyISAM indexes: 100.0M/103.5M
[OK] Key buffer hit rate: 100.0% (97M cached / 27K reads)
[OK] Query cache efficiency: 52.8% (13M cached / 26M selects)
[!] Query cache prunes per day: 126299
[OK] Sorts requiring temporary tables: 0% (6K temp sorts / 12M sorts)
[!] Joins performed without indexes: 1937
[OK] Temporary tables created on disk: 0% (4K on disk / 12M total)
[OK] Thread cache hit rate: 98% (150 created / 11K connections)
[OK] Table cache hit rate: 98% (469 open / 475 opened)
[OK] Open file limit used: 60% (837/1K)
[OK] Table locks acquired immediately: 99% (25M immediate / 25M locks)
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Enable the slow query log to troubleshoot bad queries
Adjust your join queries to always utilize indexes
Variables to adjust:
query_cache_size (> 32M)
join_buffer_size (> 128.0K, or always use indexes with joins)