mysql的线程池、锁事务、链接数量的解决

1.
SHOW VARIABLES LIKE '%max_allowed_packet%';
SET GLOBAL max_allowed_packet = 2*1024*1024*10 ;

2.查看连接情况
SHOW STATUS LIKE 'Threads%';
SHOW VARIABLES LIKE 'thread%';

SHOW PROCESSLIST

SHOW GLOBAL VARIABLES LIKE 'max_conn%';
SHOW GLOBAL STATUS LIKE 'Max_used_connections';
SHOW GLOBAL STATUS LIKE 'Connections';
#加大链接数量
SET GLOBAL max_connections=30000 ;
SET GLOBAL max_connect_errors=1000 ;
#加大线程池
SET GLOBAL thread_cache_size=64;
#查看是否有锁
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
#锁等待500秒
SET innodb_lock_wait_timeout = 500

 

备注:以上语句直接执行即可,但是重启会失效,除非写在配置文件中

猜你喜欢

转载自www.cnblogs.com/hcroom/p/10884861.html
0条评论
添加一条新回复