zoukankan      html  css  js  c++  java
  • mysql cpu 占用高

    vi /etc/my.cnf

    [mysqld]
    tmp_table_size=200M

    mysql> show global status like ‘created_tmp%‘;

    +——————————–+———+

    | Variable_name   | Value |

    +———————————-+———+

    | Created_tmp_disk_tables | 21197 |

    | Created_tmp_files   | 58  |

    | Created_tmp_tables  | 1771587 |

    +——————————–+———–+

    每次创建临时表,Created_tmp_tables增加,如果临时表大小超过tmp_table_size,则是在磁盘上创建临时表,Created_tmp_disk_tables也增加,Created_tmp_files表示MySQL服务创建的临时文件文件数,比较理想的配置是:

    Created_tmp_disk_tables / Created_tmp_tables * 100% <= 25%比如上面的服务器Created_tmp_disk_tables / Created_tmp_tables * 100% =1.20%,应该相当好了

    默认为16M,可调到64-256最佳,线程独占,太大可能内存不够I/O堵塞

  • 相关阅读:
    [洛谷P2184]贪婪大陆
    [BJOI2006]狼抓兔子
    [JSOI2007]重要的城市(x)
    [NOIP2011提高组]Mayan游戏
    gitee 使用
    部分激光打印机清零方法
    django2.0内置分页
    django上下文处理器
    jquery键盘事件
    类视图装饰器
  • 原文地址:https://www.cnblogs.com/hei-hei-hei/p/6866910.html
Copyright © 2011-2022 走看看