小编Tod*_*odd的帖子

MySQL 性能问题

在过去的 3 周中,我们的 MySQL 服务器一直存在瓶颈问题。我一直在使用 MonYOG 来查看进程列表,试图了解这些问题。我们知道我们在代码中运行的一些查询和进程没有得到优化,但我并不完全相信这是我们问题的主要来源。我觉得我们的服务器应该能够克服这些问题。

我们的表混合了 innodb 和 myISAM。我绝不是 DBA,也不会假装是 DBA,所以我不确定在我们当前的环境中哪种引擎是最好的。我们的阅读量很大,但也混合了大量更新和插入内容。我看到很多锁定的表,这让我认为 innodb 可能更好,因为它执行行锁而不是表锁。我将我们的一些表从 MyISAM 转换为 innodb 以利用一些可用的设置。开发人员也在使用大量复杂的连接。

这是我们在 my.cnf 中运行的内容:


[mysqld]
datadir=/var/lib/mysql
port=3306
socket=/var/lib/mysql/mysql.sock
user=mysql

key_buffer_size=512M

innodb_file_per_table
innodb_buffer_pool_size=6GB
#the following line is causing some odd errors when doing db dump
#innodb_log_file_size=128M
innodb_log_buffer_size=8M
innodb_additional_mem_pool_size=32M

max_allowed_packet=16M
join_buffer_size=8M
sort_buffer_size=8M
max_connections=500
wait_timeout=500
skip-name-resolve
thread_cache=256
table_cache=256
tmp_table_size=48M
max_heap_table_size=48M

query_cache_size=64M

#logging of slow queries
log-slow-queries=/var/log/mysql-slow-query.log

# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility …
Run Code Online (Sandbox Code Playgroud)

mysql innodb myisam performance performance-tuning

3
推荐指数
1
解决办法
1479
查看次数

标签 统计

innodb ×1

myisam ×1

mysql ×1

performance ×1

performance-tuning ×1