Hi,
I have Dedicated Server with E3-1230v2, 8GB RAM, 2TB HDD SATA2 (RAID 0) for Shared Hosting. I have fewer large database ex: 200Mb - 500Mb and mysql used 43% of memory
/http://i.imgur.com/iP84nHs.png
There is result of mysqltuner.pl
There is config of my.cnf
Can you help me optimize mysql use low resource (ram, cpu) but performance still remains? Thank you.
I have Dedicated Server with E3-1230v2, 8GB RAM, 2TB HDD SATA2 (RAID 0) for Shared Hosting. I have fewer large database ex: 200Mb - 500Mb and mysql used 43% of memory
/http://i.imgur.com/iP84nHs.png
Code:
top - 22:27:47 up 4 days, 20:58, 1 user, load average: 3.94, 5.30, 5.06
Tasks: 256 total, 1 running, 255 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.9%us, 1.9%sy, 13.1%ni, 76.8%id, 7.2%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 8031044k total, 7318368k used, 712676k free, 112324k buffers
Swap: 0k total, 0k used, 0k free, 2616332k cached
Code:
[email protected] [~]# ./mysqltuner.pl
>> MySQLTuner 1.2.0 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at [url]http://mysqltuner.com/[/url]
>> Run with '--help' for additional options and output filtering
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.32-cll
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 1G (Tables: 2429)
[--] Data in InnoDB tables: 1G (Tables: 2119)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[--] Data in MEMORY tables: 31M (Tables: 344)
[!!] Total fragmented tables: 264
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 4d 20h 50m 54s (140M q [333.208 qps], 2M conn, TX: 886B, RX: 21B)
[--] Reads / Writes: 76% / 24%
[--] Total buffers: 962.0M global + 3.5M per thread (300 max threads)
[OK] Maximum possible memory usage: 2.0G (25% of installed RAM)
[OK] Slow queries: 2% (3M/140M)
[OK] Highest usage of available connections: 22% (68/300)
[OK] Key buffer size / total MyISAM indexes: 512.0M/259.6M
[OK] Key buffer hit rate: 100.0% (1B cached / 159K reads)
[OK] Query cache efficiency: 82.2% (100M cached / 122M selects)
[!!] Query cache prunes per day: 2457854
[OK] Sorts requiring temporary tables: 0% (10K temp sorts / 5M sorts)
[!!] Joins performed without indexes: 23267
[OK] Temporary tables created on disk: 19% (1M on disk / 7M total)
[OK] Thread cache hit rate: 99% (68 created / 2M connections)
[!!] Table cache hit rate: 3% (5K open / 144K opened)
[OK] Open file limit used: 44% (4K/10K)
[OK] Table locks acquired immediately: 99% (38M immediate / 38M locks)
[!!] InnoDB data size / buffer pool: 1.0G/256.0M
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Adjust your join queries to always utilize indexes
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
query_cache_size (> 50M)
join_buffer_size (> 1.0M, or always use indexes with joins)
table_cache (> 5000)
innodb_buffer_pool_size (>= 1G)
Code:
[mysqld]
default-storage-engine=MyISAM
innodb_file_per_table=1
local-infile=0
port=3306
socket=/var/lib/mysql/mysql.sock
max_connections=300
max_user_connections=30
max_connect_errors=15
key_buffer=512M
myisam_sort_buffer_size=64M
join_buffer_size=1M
read_buffer_size=1M
sort_buffer_size=1M
table_cache=10000
thread_cache_size=30M
wait_timeout=300
connect_timeout=10
max_allowed_packet=16M
query_cache_limit=1M
query_cache_size=50M
query_cache_type=1
tmp_table_size=128M
max_heap_table_size=128M
innodb_buffer_pool_size=256M
slow_query_log=1
slow_query_log_file=mysql-slow.log
long_query_time=0.1
log-queries-not-using-indexes
delayed_insert_timeout=1
[mysql.server]
user=mysql
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
Last edited: