0

We have an application that uses two types of socket, a listening UDP socket and an active SCTP socket.

At certain time we have scripts running on the same machine that have high IO activities (such as "dd, tar, ..."), most of the time when these IO heavy applications run we seem to have the following problems:

  • The UDP socket closes
  • The SCTP socket is still alive and we can see it in /proc/net/sctp/assocs however no traffic is received anymore from this socket (until we restart the application)

Why are these I/O operations affecting the network based application in such a way?
Is there any kernel configurations to avoid these problems?
I would have expected some packets to be lost on the UDP and some retries on the SCTP socket but not this behavior.

The application is running on a server with 64-bits 4 quad core CPU and RHEL OS

# uname -a
Linux server1 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
4

3 回答 3

1

当您说 UDP 套接字关闭时,您到底是什么意思?你尝试send它失败了?

对于 SCTP,您能否在这些 I/O 操作运行时收集 wireshark 或 pcap 跟踪信息(最好在对等方上运行 wireshark)?我的猜测是(没有看代码的有根据的猜测),当这些 I/O 操作出现时,您的进程会因 CPU 时间而变得匮乏。另一端发送SCTP Heartbeat messages它没有得到答复。或者,如果数据正在流动,则对端没有收到任何数据,SACKS因为它们尚未被您端的 SCTP 堆栈处理。

因此,对等方在内部中止关联并停止向您发送数据(因为它看到所有路径都没有发送 ABORT。在这种情况下,您的 SCTP 堆栈仍会认为关联是活动的)。尝试确认Heartbeat timeout, RTO timeout,SACK timeout, maximum Path retransmission & max Association retransmission对端的值是什么。我没有使用过内核 SCTP,但 sysctl 应该能够为您提供这些值。

无论哪种方式,当您观察到此问题时收集 pcap 跟踪将使我们更好地了解问题所在。我希望它有所帮助。

于 2010-06-27T13:25:10.703 回答
0

以下是我要研究的一些事情:

当脚本未运行时,UDP 套接字上加载了什么?是连续的还是突发的?当脚本未运行时,套接字是否会自发关闭?从套接字读取的数据发生了什么?有多少从套接字生成的数据(原始数据或已处理数据)被写入磁盘?您能否监控 CPU、网络和磁盘 IO 利用率以查看它们是否处于饱和状态?运行 IO 操作的脚本能否以较低的优先级运行,或者相反,运行 UDP 套接字的进程能否以较高的优先级运行?

于 2010-06-27T14:09:28.440 回答
0

很多人不检查的一件事是发送时的返回值,并且他们不检查像EINTRon recv's 这样的错误条件。也许繁重的 IO 负载导致您的某些send' 或recv' 被中断,并且您的应用程序将错误视为硬错误并关闭套接字,而您没有意识到错误是暂时的。

我已经看到这种事情发生了,您绝对应该通过提高日志级别并查看您的应用程序是否意外调用关闭来检查它。

于 2010-06-27T14:23:48.637 回答