Spring 日志解释: completed tasks 和 CONNECT 帧的含义
Spring 日志解释: completed tasks 和 CONNECT 帧的含义
在 Spring 日志中,'completed tasks' 代表的是已完成的任务数,而不是连接数。'CONNECT(2125)' 代表的是已处理的 STOMP CONNECT 帧的数量,也不是连接数。连接数可以通过其他参数进行查看,比如 WebSocketSession 中的 'total' 参数。
具体参数解释:
- WebSocketSession[9 current WS(8)-HttpStream(1)-HttpPoll(0), 2154 total, 16 closed abnormally (16 connect failure, 0 send limit, 447 transport error)]:表示当前有 9 个 WebSocket 连接,其中 8 个是 WebSocket 连接,1 个是 HttpStream 连接,没有 HttpPoll 连接,总共建立了 2154 个连接,其中 16 个连接异常关闭,包括 16 个连接失败,0 个发送限制错误,447 个传输错误。
- stompSubProtocol[processed CONNECT(2125)-CONNECTED(2108)-DISCONNECT(348)]:表示已处理 2125 个 STOMP CONNECT 帧,成功建立 2108 个连接,断开连接 348 次。
- stompBrokerRelay[null]:表示没有使用 stompBrokerRelay。
- inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 18966]:表示 inboundChannel 的线程池大小为 0,当前没有活跃线程,队列中没有任务,已完成 18966 个任务。
- outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 4618]:表示 outboundChannel 的线程池大小为 0,当前没有活跃线程,队列中没有任务,已完成 4618 个任务。
- sockJsScheduler[pool size = 4, active threads = 1, queued tasks = 10, completed tasks = 940594]:表示 sockJsScheduler 的线程池大小为 4,当前有一个活跃线程,队列中有 10 个任务,已完成 940594 个任务。
为什么 completed tasks 一直在变,但是 Tomcat 的 catalina.out 没有日志,也无法访问?
'completed tasks' 一直在变可能是因为应用程序有不断的请求和响应,导致任务数不断增加。而 Tomcat 的 catalina.out 没有日志和无法访问可能是因为配置问题或者权限问题,需要进一步排查。
建议:
- 检查 Tomcat 的日志配置,确保日志级别足够低,可以记录到详细的信息。
- 检查 Tomcat 的访问权限,确保用户有足够的权限访问 catalina.out 文件。
- 使用调试工具,比如 Spring Boot 的 Actuator,来查看应用程序的运行状态,并分析日志信息。
原文地址: https://www.cveoy.top/t/topic/nENp 著作权归作者所有。请勿转载和采集!