MySQL配置:内存使用;“危险的高”;?

MySQL配置:内存使用;“危险的高”;?,mysql,Mysql,我在一台专用服务器上运行CentOS和DirectAdmin(四核i7,内存约8Gb),我遇到了MySQL的主要问题,可以在上面找到更多详细信息 我刚刚从运行了一个PerlMySQL调谐器脚本,试图确定问题出在哪里 遗憾的是,输出对我来说没有多大意义: >> MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net> >> Bug reports, feature requests, and downloads a

我在一台专用服务器上运行CentOS和DirectAdmin(四核i7,内存约8Gb),我遇到了MySQL的主要问题,可以在上面找到更多详细信息

我刚刚从运行了一个PerlMySQL调谐器脚本,试图确定问题出在哪里

遗憾的是,输出对我来说没有多大意义:

 >>  MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:

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

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 236M (Tables: 686)
[--] Data in InnoDB tables: 226M (Tables: 199)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 312

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

-------- Performance Metrics -------------------------------------------------
[--] Up for: 18h 42m 34s (1M q [18.265 qps], 49K conn, TX: 3B, RX: 835M)
[--] Reads / Writes: 60% / 40%
[--] Total buffers: 528.0M global + 7.0M per thread (1500 max threads)
[!!] Maximum possible memory usage: 10.8G (138% of installed RAM)
[OK] Slow queries: 0% (3/1M)
[OK] Highest usage of available connections: 2% (37/1500)
[OK] Key buffer size / total MyISAM indexes: 64.0M/74.1M
[OK] Key buffer hit rate: 99.9% (8M cached / 5K reads)
[OK] Query cache efficiency: 66.9% (529K cached / 792K selects)
[!!] Query cache prunes per day: 83513
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 42K sorts)
[!!] Joins performed without indexes: 5962
[OK] Temporary tables created on disk: 5% (5K on disk / 97K total)
[OK] Thread cache hit rate: 99% (37 created / 49K connections)
[OK] Table cache hit rate: 42% (512 open / 1K opened)
[OK] Open file limit used: 10% (756/7K)
[OK] Table locks acquired immediately: 99% (513K immediate / 513K locks)
[!!] InnoDB data size / buffer pool: 226.7M/128.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Reduce your overall MySQL memory footprint for system stability
    Adjust your join queries to always utilize indexes
Variables to adjust:
  *** MySQL's maximum memory usage is dangerously high ***
  *** Add RAM before increasing MySQL buffer variables ***
    query_cache_size (> 64M)
    join_buffer_size (> 2.0M, or always use indexes with joins)
    innodb_buffer_pool_size (>= 226M)

关于如何优化MySQL安装,有人有什么建议吗?

假设您使用InnoDB,乍一看,您并不是在使用RAM让数据库嗡嗡作响。这个怎么样:

innodb_buffer_pool_size = 4G 
innodb_log_file_size = 1G

在我的书中,这看起来不正常。我想知道是否有一个错误的应用程序在两个表上做了错误的连接,创建了一个
MxN
大小的结果集。我从哪里开始诊断这样的问题@ClemensKlein Robbenhaar?也许
/var/log/mysql\u slow.log
中有什么东西(尽管它只影响三个查询,它说)。除非你能花时间和空间打开查询日志并浏览一个大的日志文件(通常是一个无法继续运行的生产系统),否则下一步将是查看使用mysql的应用程序,并与开发人员讨论使用大内存查询的可能性,以及它们使用的连接状态。
innodb_buffer_pool_size = 4G 
innodb_log_file_size = 1G