Hello,
I'm new to mysql world and recently installed a new server with these specs:
CPU Intel(R) Xeon(R) CPU X3440 @ 2.53GHz
8 GB RAM
500 GB HDD's in Software RAID 1
Centos 6 + Cpanel
Hosting around 20 accounts, out of which probably 15 are using mysql
The websites don't get a lot of traffic. As an example, last month the server had around 250 GB of traffic usage.
I've used Percona's my.cnf tool which worked out ok, apart for some fine tuning which I did with Mysqltuner and Tuning Primer .
This is my current my.cnf:
Does anyone have any idea on how to fix this ? Besides that, should I be looking at anything else?
Thank you.
I'm new to mysql world and recently installed a new server with these specs:
CPU Intel(R) Xeon(R) CPU X3440 @ 2.53GHz
8 GB RAM
500 GB HDD's in Software RAID 1
Centos 6 + Cpanel
Hosting around 20 accounts, out of which probably 15 are using mysql
The websites don't get a lot of traffic. As an example, last month the server had around 250 GB of traffic usage.
I've used Percona's my.cnf tool which worked out ok, apart for some fine tuning which I did with Mysqltuner and Tuning Primer .
This is my current my.cnf:
Code:
[mysql]
# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
# GENERAL #
#user = mysql
default-storage-engine = InnoDB
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/server.mygms.net.pid
# MyISAM #
key-buffer-size = 128M
myisam-recover-options = FORCE,BACKUP
# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000
# DATA STORAGE #
datadir = /var/lib/mysql/
# BINARY LOGGING #
log-bin = /var/lib/mysql/mysql-bin
expire-logs-days = 14
sync-binlog = 1
# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 8M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 8M
query_cache_limit = 1M
query_cache_type = 1
max-connections = 300
thread-cache-size = 64
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 5000
table_cache = 64
join_buffer = 1M
# INNODB #
#innodb-flush-method = O_DIRECT
#innodb-log-files-in-group = 2
#innodb-log-file-size = 128M
#innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 2G
# LOGGING #
log-error = /var/lib/mysql/server.mygms.net.err
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/server-slow.log
Code:
>> MySQLTuner 1.3.0 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[OK] Currently running supported MySQL version 5.5.35-cll
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 451M (Tables: 3051)
[--] Data in InnoDB tables: 1G (Tables: 520)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 31
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 17m 14s (5K q [5.605 qps], 227 conn, TX: 2M, RX: 460K)
[--] Reads / Writes: 92% / 8%
[--] Total buffers: 2.2G global + 3.6M per thread (300 max threads)
[OK] Maximum possible memory usage: 3.2G (42% of installed RAM)
[OK] Slow queries: 4% (248/5K)
[OK] Highest usage of available connections: 1% (4/300)
[OK] Key buffer size / total MyISAM indexes: 128.0M/111.0M
[!!] Key buffer hit rate: 15.5% (90K cached / 76K reads)
[OK] Query cache efficiency: 50.4% (750 cached / 1K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 123 sorts)
[!!] Joins performed without indexes: 13
[OK] Temporary tables created on disk: 13% (164 on disk / 1K total)
[OK] Thread cache hit rate: 98% (4 created / 227 connections)
[!!] Table cache hit rate: 0% (64 open / 157K opened)
[OK] Open file limit used: 0% (21/20K)
[OK] Table locks acquired immediately: 100% (5K immediate / 5K locks)
[OK] InnoDB buffer pool / data size: 2.0G/1.4G
[OK] InnoDB log waits: 0
-------- 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
Increase table_cache gradually to avoid file descriptor limits
Read this before increasing table_cache over 64: http://bit.ly/1mi7c4C
Variables to adjust:
join_buffer_size (> 1.0M, or always use indexes with joins)
table_cache (> 64)
Does anyone have any idea on how to fix this ? Besides that, should I be looking at anything else?
Thank you.