› MySQL 5.5 Community Server
› MySQL 5.6 Community Server
› Percona Configuration Wizard
› XtraBackup 搭建主从复制
Great Sites on MySQL
› Percona
› MySQL Performance Blog
› Severalnines
推荐管理工具
› Sequel Pro
› phpMyAdmin
推荐书目
› MySQL Cookbook
MySQL 相关项目
› MariaDB
› Drizzle
参考文档
› http://mysql-python.sourceforge.net/MySQLdb.html
xlzyxxn
V2EX  ›  MySQL

数据库 TMC 了怎么办

  •  
  •   xlzyxxn · Jan 12, 2021 · 2753 views
    This topic created in 2087 days ago, the information mentioned may be changed or developed.

    使用的 spring cloud, mybatis ;本来正常使用,昨天开始数据库突然报错 too many connection.在不同的微服务模块下写了同一个 mapper.selectCount.会是这个原因吗

    zengzizhao
        1
    zengzizhao  
       Jan 12, 2021
    my.conf 里改 max_connections = x x x x,重启
    zxyroy
        2
    zxyroy  
       Jan 12, 2021
    难道不用先检查下是不是有 bug 导致 connection 没有 close 吗?
    xlzyxxn
        3
    xlzyxxn  
    OP
       Jan 12, 2021
    @zxyroy 使用 show full processlist 有大量 sleep,剩 3 个就超过最大连接数了;这种情况正常吗
    zxyroy
        4
    zxyroy  
       Jan 12, 2021
    @xlzyxxn 有机会是设置问题,线程池 size 太大或者 mysql max_connections 太小。你看看每个微服务的线程池设到多大,加起来有没有超过 mysql 的 max_connections,如果差不多或者超过就很大机会是设置问题,如果还差的很远就要考虑是不是有什么 bug
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1448 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 16:21 · PVG 00:21 · LAX 09:21 · JFK 12:21
    ♥ Do have faith in what you're doing.