2014-08-07, 02:06 AM
Ok so I've been having issues with max_user_connections errors on my dedicated server recently. The setting is set to 100 so it should be high enough. When this occurs and I take a look at htop I see alot of requests just chilling there...
Also when I run mysqltuner I get:
I also read a comment here: http://dev.mysql.com/doc/refman/5.5/en/t...tions.html
about turning off persistent connections if your having too_many_connections errors.
So I looked up mysql connections and found out I can turn it off in php.ini. What exactly is mysql persistent connections and is it safe to turn off?
Also when I run mysqltuner I get:
>> 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.6.17
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 811M (Tables: 382)
[--] Data in InnoDB tables: 2G (Tables: 672)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52)
[--] Data in MEMORY tables: 372K (Tables: 9)
[!!] Total fragmented tables: 489
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 14d 23h 0m 13s (194M q [150.816 qps], 11M conn, TX: 2686B, RX: 46B)
[--] Reads / Writes: 80% / 20%
[--] Total buffers: 1.1G global + 1.1M per thread (175 max threads)
[OK] Maximum possible memory usage: 1.3G (34% of installed RAM)
[OK] Slow queries: 0% (62K/194M)
[!!] Highest connection usage: 100% (176/175)
[OK] Key buffer size / total MyISAM indexes: 32.0M/382.3M
[OK] Key buffer hit rate: 99.6% (3B cached / 16M reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (76K temp sorts / 39M sorts)
[!!] Joins performed without indexes: 69591
[OK] Temporary tables created on disk: 7% (567K on disk / 7M total)
[OK] Thread cache hit rate: 97% (246K created / 11M connections)
[!!] Table cache hit rate: 0% (768 open / 192K opened)
[OK] Open file limit used: 2% (389/16K)
[OK] Table locks acquired immediately: 99% (183M immediate / 184M locks)
[!!] InnoDB buffer pool / data size: 512.0M/2.1G
[OK] InnoDB log waits: 0
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Reduce or eliminate persistent connections to reduce connection usage
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:
max_connections (> 175)
wait_timeout (< 10)
interactive_timeout (< 10)
query_cache_type (=1)
join_buffer_size (> 256.0K, or always use indexes with joins)
table_cache (> 768)
innodb_buffer_pool_size (>= 2G)
In specific it states to "Reduce or eliminate persistent connections to reduce connection usage" under "General Recommendations".I also read a comment here: http://dev.mysql.com/doc/refman/5.5/en/t...tions.html
about turning off persistent connections if your having too_many_connections errors.
So I looked up mysql connections and found out I can turn it off in php.ini. What exactly is mysql persistent connections and is it safe to turn off?