首页 > 代码库 > mysql查看连接数排查问题

mysql查看连接数排查问题

#mysql查看连接数
SHOW VARIABLES LIKE ‘%max_connections%‘;
# max_connections 最大连接数

SHOW VARIABLES LIKE ‘%connection%‘;
# PROCESSLIST;

# 通过观察sql来判断。
SHOW FULL PROCESSLIST
SHOW PROCESSLIST;

SHOW STATUS;
SHOW PROCESSLIST
#show extended-status;


SHOW STATUS LIKE ‘%connect%‘; # 1219
# Connections 试图连接到(不管是否成功)MYSQL服务器的连接总数
# Threads_connected 当前的连接数
# Max_used_connections 服务器启动后已经同时使用过的连接最大数量(并发)

 

日志分析,请求接口:

cat statxx.2017-04-01.*.log | grep -C 5 ‘ReqUri:/vx/chx/supx‘;
cat auxx-2017-04-01-*.log | grep -C 5 ‘/vx/chx/support‘;
cat auxx-error.2017-04-01.*.log | grep -C 5 ‘/vx/chx/supx‘;


auxx-2017-04-01 新的日志
2017-04-01 08:33:28.414 [http-nio-7064-exec-7] INFO com.auxx.filter.VerxFilter#doFilter [line:52] - User-Agent:Autoyol_49:Android_23|
640BB43DC8FFE2A7323718CA9BE10674D30C3E3031DD223D3333333333, ReqUri:/vx/chx/supx (‘POST‘ from 118.255.29.100)


statxx.2017-04-01 老的日志
2017-04-01 11:57:32.698 [http-nio-7065-exec-7] INFO c.a.interceptor.DefaultInterceptor#preHandle [line:126] - User-Agent:Autoyol_48:iPhone_10.2.1|
98C82A94F57AD7CAE1CBADC404B9BF1D3EA5EDEAAA657A6117F426D42FD108C6A030B76B4B8E69, ReqUri:/traxx/v7x/reqxx (‘POST‘ from 59.42.108.63)
2017-04-01

 

mysql查看连接数排查问题