kernel 3.2 - tcpip stack latency
Added by Patrice Bastiaens about 4 years ago
We've built an application receiving messages from two devices at a rate of 1 message of 1440 bytes every 10 ms in a thread schedule in SCHED_RR priority 70. This is the higher priority user thread in the system.
A network traffic analysis show that each message is sent with the right timing by both devices.
However in the receiving thread, we're facing some latency ranging from 40 to 250 ms on 1 device while the the traffic from the other is received with the normal timing. The latency is shown on both devices but not at the same time.
The thread use a select on the socket to wait for the incoming data.
Have someone already faced this issue ?
RE: kernel 3.2 - tcpip stack latency - Added by Gregory Gluszek about 4 years ago
Since you are using SCHED_RR I am assuming you are using CONFIG_PREEMPT in your kernel config, correct?
Does your design have any sort of network traffic shaping or advanced traffic control in place? I do not think anyone here has a lot of experience with this, but if you search the kernel Documentation or Google for keywords tc and qdisc you should find information on how to shape network traffic in Linux.
Another item to consider is utilizing debug utilities, such as ftrace, to find out why you are experiencing latency.
RE: kernel 3.2 - tcpip stack latency - Added by Patrice Bastiaens about 4 years ago
Than you for your feedback.
Indeed, flag CONFIG_PREEMPT is set in kernel config. As far as we can see, there is no issue on the thread itself.
We use VLAN tag to route the traffic specifically from the devices to our controller. I'll look for your suggestion to shape the traffic.
Using ftrace is the very next step we've planned in order to track our latency issue.