Home > Database > Mysql Tutorial > MySQL处在高负载环境下_MySQL

MySQL处在高负载环境下_MySQL

WBOY
Release: 2016-05-31 08:49:06
Original
969 people have browsed it

MySQL处在高负载环境下,磁盘IO读写过多,肯定会占用很多资源,必然CP会U占用过高。
占用CPU过高,可以做如下考虑:
1.打开慢查询日志,查询是否是某个SQL语句占用过多资源,如果是的话,可以对SQL语句进行优化,比如优化 insert 语句、优化 group by 语句、优化 order by 语句、优化 join 语句等等;
2.考虑索引问题;
3.定期分析表,使用optimize table;
4.优化数据库对象;
5.考虑是否是锁问题;
6.调整一些MySQL Server参数,比如key_buffer_size、table_cache、innodb_buffer_pool_size、innodb_log_file_size等等;
7.如果数据量过大,可以考虑使用MySQL集群或者搭建高可用环境。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template