Hello,
We have 4 GB RAM & 4.8 GHz Total CPU based Linux VPS. Since last 1 month, we have encountered "No Such directory" , "Mysql gone away" , "InnoDB tables not found" errors just about everyday. It seems that MySQL is consuming lot of resources and hence our website is going down.
We have done the mysqltuner.pl, results are:-
Please let me know, what can we do further to reduce the issues.
We have 4 GB RAM & 4.8 GHz Total CPU based Linux VPS. Since last 1 month, we have encountered "No Such directory" , "Mysql gone away" , "InnoDB tables not found" errors just about everyday. It seems that MySQL is consuming lot of resources and hence our website is going down.
We have done the mysqltuner.pl, results are:-
Code:
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 215M (Tables: 268)
[--] Data in InnoDB tables: 4G (Tables: 3338)
[--] Data in MEMORY tables: 0B (Tables: 153)
[!!] Total fragmented tables: 3379
-------- Security Recommendations -------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] There is no basic password file list!
-------- Performance Metrics -------------------------------------------------
[--] Up for: 1m 41s (58K q [577.267 qps], 168 conn, TX: 191M, RX: 14M)
[--] Reads / Writes: 92% / 8%
[--] Binary logging is disabled
[--] Total buffers: 2.2G global + 6.4M per thread (500 max threads)
[OK] Maximum reached memory usage: 2.5G (66.85% of installed RAM)
[!!] Maximum possible memory usage: 5.3G (143.21% of installed RAM)
[OK] Slow queries: 0% (516/58K)
[OK] Highest usage of available connections: 8% (42/500)
[OK] Aborted connections: 0.00% (0/168)
[OK] Query cache efficiency: 90.9% (51K cached / 57K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 1K sorts)
[!!] Joins performed without indexes: 2
[!!] Temporary tables created on disk: 39% (423 on disk / 1K total)
[OK] Thread cache hit rate: 75% (42 created / 168 connections)
[OK] Table cache hit rate: 97% (261 open / 268 opened)
[OK] Open file limit used: 0% (59/10K)
[OK] Table locks acquired immediately: 100% (11K immediate / 11K locks)
-------- MyISAM Metrics -----------------------------------------------------
[!!] Key buffer used: 18.8% (6M used / 33M cache)
[!!] Key buffer size / total MyISAM indexes: 32.0M/45.5M
[!!] Read Key buffer hit rate: 92.1% (2K cached / 190 reads)
[OK] Write Key buffer hit rate: 95.8% (142 cached / 6 writes)
-------- InnoDB Metrics -----------------------------------------------------
[--] InnoDB is enabled.
[!!] InnoDB buffer pool / data size: 2.0G/4.1G
[!!] InnoDB buffer pool instances: 1
[!!] InnoDB Used buffer: 3.32% (4350 used/ 131071 total)
[OK] InnoDB Read buffer efficiency: 99.06% (438813 hits/ 442966 total)
[!!] InnoDB Write buffer efficiency: 0.00% (0 hits/ 1 total)
[OK] InnoDB log waits: 0.00% (0 waits / 175 writes)
-------- AriaDB Metrics -----------------------------------------------------
[--] AriaDB is disabled.
-------- Replication Metrics -------------------------------------------------
[--] No replication slave(s) for this server.
[--] This is a standalone server..
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Reduce your overall MySQL memory footprint for system stability
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
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
join_buffer_size (> 128.0K, or always use indexes with joins)
tmp_table_size (> 128M)
max_heap_table_size (> 128M)
key_buffer_size (> 45.5M)
innodb_buffer_pool_size (>= 4G) if possible.
innodb_buffer_pool_instances(=2)
Our my.cnf is:-
max_connections=500
max_user_connections=250
default-storage-engine=MyISAM
innodb_thread_concurrency=2
innodb_file_per_table=0
innodb_buffer_pool_size=2GB
wait_timeout = 28800
connect_timeout=120
max_allowed_packet=268435456
thread_cache_size = 1024
sort_buffer_size = 2M
bulk_insert_buffer_size = 4M
tmp_table_size = 128M
table_cache=1800
max_heap_table_size = 128M
key_buffer_size = 32M
myisam_sort_buffer_size = 128M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
query_cache_limit = 80M
query_cache_size = 64M
#query_cache_type = 2M
table_open_cache=4000
#open_files_limit=10000
open_files_limit=10000
slow_query_log=1
slow_query_log_file= /var/log/mysql_slow_queries.log
long_query_time = 1
log-queries-not-using-indexes=1