xuancong6000
Verified User
- Joined
- Oct 12, 2012
- Messages
- 79
I do this command: perl mysqltuner.pl and it show overload RAM
this is my my.cnf
it have some problem:
My VPS had 2GB of RAM and 4 Core of CPU E3-1270 V2 @ 3.50GHz
could you please help me Optimize MySQL
thanks alot
Code:
[root@server ~]# perl mysqltuner.pl
>> MySQLTuner 1.2.0 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.29
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 34M (Tables: 1451)
[--] Data in InnoDB tables: 52M (Tables: 449)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[--] Data in MEMORY tables: 2M (Tables: 23)
[!!] Total fragmented tables: 481
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 5m 4s (1K q [5.572 qps], 68 conn, TX: 8M, RX: 217K)
[--] Reads / Writes: 77% / 23%
[--] Total buffers: 276.0M global + 40.2M per thread (100 max threads)
[!!] Maximum possible memory usage: 4.2G (210% of installed RAM)
[OK] Slow queries: 0% (0/1K)
[OK] Highest usage of available connections: 1% (1/100)
[OK] Key buffer size / total MyISAM indexes: 100.0M/9.6M
[OK] Key buffer hit rate: 97.2% (3K cached / 94 reads)
[OK] Query cache efficiency: 57.9% (760 cached / 1K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 52 sorts)
[OK] Temporary tables created on disk: 4% (1 on disk / 22 total)
[OK] Thread cache hit rate: 98% (1 created / 68 connections)
[!!] Table cache hit rate: 4% (256 open / 5K opened)
[OK] Open file limit used: 2% (198/8K)
[OK] Table locks acquired immediately: 100% (825 immediate / 825 locks)
[OK] InnoDB data size / buffer pool: 52.5M/128.0M
-------- 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
Enable the slow query log to troubleshoot bad queries
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
table_cache (> 256)
[root@server ~]#
Code:
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-external-locking
max_connections = 100
interactive_timeout = 100
wait_timeout = 100
connect_timeout = 10
thread_cache_size = 128
key_buffer_size = 100M
join_buffer = 1M
join_buffer_size = 32M
table_open_cache = 256
sort_buffer_size = 2M
read_buffer_size = 2M
max_connect_errors=10
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 32M
query_cache_size= 16M
thread_concurrency = 8
[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
[mysqldump]
quick
max_allowed_packet = 2M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 4M
write_buffer = 4M
[myisamchk]
query_cache_limit = 2M
table_cache = 256
max_heap_table_size = 32M
tmp_table_size = 128M
[mysqlhotcopy]
interactive-timeout
Code:
[!!] Total fragmented tables: 481
[!!] Maximum possible memory usage: 4.2G (210% of installed RAM)
[!!] Table cache hit rate: 4% (256 open / 5K opened)
could you please help me Optimize MySQL
thanks alot