您的应用程序没有正确关闭 MySQL 连接

您的应用程序没有正确关闭 MySQL 连接

当我运行 mysqltuner 时,它显示标题中的错误。请帮我解决它。

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.61-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 1G (Tables: 1413)
[--] Data in InnoDB tables: 4M (Tables: 199)
[!!] Total fragmented tables: 257

-------- Security Recommendations  -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 4h 33m 39s (17M q [1K qps], 1M conn, TX: 16B, RX: 1B)
[--] Reads / Writes: 92% / 8%
[--] Total buffers: 1.0G global + 2.7M per thread (256 max threads)
[OK] Maximum possible memory usage: 1.7G (11% of installed RAM)
[OK] Slow queries: 0% (7/17M)
[OK] Highest usage of available connections: 84% (216/256)
[OK] Key buffer size / total MyISAM indexes: 8.0M/2.0G
[OK] Key buffer hit rate: 97.7% (2B cached / 68M reads)
[OK] Query cache efficiency: 76.3% (10M cached / 14M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (958 temp sorts / 475K sorts)
[OK] Temporary tables created on disk: 6% (22K on disk / 343K total)
[OK] Thread cache hit rate: 83% (188K created / 1M connections)
[OK] Table cache hit rate: 89% (3K open / 3K opened)
[OK] Open file limit used: 65% (4K/6K)
[OK] Table locks acquired immediately: 99% (4M immediate / 4M locks)
[!!] Connections aborted: 74%
[OK] InnoDB data size / buffer pool: 4.2M/8.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Your applications are not closing MySQL connections properly

答案1

嗯,您的应用程序没有正确关闭 MySQL 连接。它们是否调用过类似mysql_close($connection)(PHP)、$databaseconnection->disconnect;(Perl) 或类似的东西?我们 serverfault.com 不可能在没有看到您的应用程序源代码的情况下知道这一点。:-)

相关内容