MySQL Optimization

Job ID: 36775763

Budget: $30 – $250 USD

My server provider used mysql tuner and came up with the following result.

MySQL working on other queries, or locking the tables could be an issue. When I run a mysql tuner I see

[OK] Maximum reached memory usage: 22.0G (68.69% of installed RAM)
[!!] Maximum possible memory usage: 198.1G (619.16% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (3K/31M)
[OK] Highest usage of available connections: 10% (304/3000)
[OK] Aborted connections: 0.03% (901/3384551)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[OK] Query cache is disabled by default due to mutex contention on multiprocessor machines.
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 3M sorts)
[!!] Joins performed without indexes: 2808598
[!!] Temporary tables created on disk: 97% (3M on disk / 3M total)
[OK] Thread cache hit rate: 91% (293K created / 3M connections)
[OK] Table cache hit rate: 30% (1K hits / 3K requests)
[!!] table_definition_cache(1000) is lower than number of tables(1333)
[OK] Open file limit used: 1% (267/15K)
[OK] Table locks acquired immediately: 100% (39M immediate / 39M locks)

max_connections=3000 - this is too high for the amount of ram.

I adjusted my.cnf to
max_connections=500
max_user_connections=400
skip-name-resolve
table_open_cache = 1300
table_definition_cache = 1300



However the most concerning is [!!] Joins performed without indexes: 2808598
The mysql uptime is 26 hours. That is a lot of queries that do not have indexes and getting index's will speed up mysql. Too many queries with out could result in mysql being slow (and hang waiting for other queries)


I need help in fixing this so as to improve mysql performance
Related categories: PHP Linux Apache MySQL Database Administration