netstat -ano输出中的ESTABLISHED off
今天,我们性能测试的环境出现个奇怪现象,通过oci direct load回库的进程似乎僵死了,应用端cpu 200%(两个线程在跑,一个是一直在ocidirectload没反应,另外一个是正在sem_trywait),如下:
oracle服务器端从一开始收到请求并执行完成之后,就没有反应了,也没有等待事件,session状态为inactive(这没有任何副作用),ash中在此之后就没有这个session的任何记录了,多个分库都是一样的现象(比较坑的是,这个动态库是我们研发中心开发的,代码不open)。
目前问题还没有时间查,主要怀疑可能是表空间满,今天又出来了,不同的位置,但是内部都是在调用oci direct load的逻辑没有正常返回结果码的问题,经测试,不是这个问题。今天的异常如下:
继续查看了各服务器到数据库的网络连接状态,oracle服务器节点都是keepalived。但是应用端为off,如下:
输出各列的含义如下:
以前都是等待超时之类的,off的状态网上介绍也比较少。它是通过-o选项出来的,也就是网络计时器。经仔细查找,off的含义如下:
keepalive
- when the keepalive timer is ON for the socketon
- when the retransmission timer is ON for the socketoff
- none of the above is ON
如上述所示,Recv-Q Send-Q 都是0。man也没有写timer的含义。所以这个问题基本上推测就在Timer身上。ss上可以看到非establish off状态的很多连接上也可能有定时器,如下:
timer列的定义为:
timer:(<timer_name>,<expire_time>,<retrans>)
timer:(keepalive,30sec,0)
共有五种类型的tcp timer,如下:
- on : means one of these timers: TCP retrans timer(也称为Time out timer), TCP early retrans timer and tail loss probe timer
- keepalive: tcp keep alive timer,默认为7200秒,超过后会每隔75秒发送10次探测,超过后服务器会关闭连接。用于识别死连接,其机制为When a TCP connection on a routing device is idle for too long, the device sends a TCP keepalive packet to the peer with only the Acknowledgment (ACK) flag turned on. If a response packet (a TCP ACK packet) is not received after the device sends a specific number of probes, the connection is considered dead and the device initiating the probes frees resources used by the TCP connection.。
- timewait: timewait stage timer
- persist: zero window probe timer
- unknown: none of the above timers
连接状态转换图(它们都可以体现在netstat中)如下:
参考:
https://superuser.com/questions/240456/how-to-interpret-the-output-of-netstat-o-netstat-timers
https://github.com/netty/netty/issues/7292
https://dashdash.io/8/ss 作为nestat的代替品出现,包含了比netstat更多的信息。
windows/linux/aix各平台keepalive优化(默认值通常不合理) https://www.veritas.com/support/en_US/article.100028680
TCP Keepalive Timer相关的参考,https://tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/
相关文章
- 如何设置 DeepStream 输出 RTSP 流
- 【嵌入式开发】树莓派+官方摄像头模块+VLC串流实时输出网络视频流
- IntelliJ IDEA修改Output输出缓存区大小【应对:too much output to process】
- C语言:冒泡排序法:将若干字符串按字母顺序(由小到大)排序输出
- 系统观察命令sar经常使用输出选项说明
- 【C语言】字符串的输入和输出 控制用户输入长度 fgets()函数
- JAVA byte数组转化为16进制字符串输出
- Linux 利用宏和printf定义特殊的输出(转载)
- moviepy音视频剪辑:使用VideoFileClip、AudioFileClip和write_videofile、write_audiofile进行音视频的加载和输出
- Java Spring JDBC 调用存储过程(Stored Procedure) 输入(In)输出(Out)参数
- quartz 关闭不断输出的batch acquisition of 0 triggers ?