I have a setup wherein one "master" Linux system communicates with 3 "slave" systems also running Linux on a dedicated Ethernet interface(just the master & the 3 slaves). The slaves send data to the master via UDP every 5 ms or so. In addition, the master has apps that continuously pull files from all 3 slaves via FTP, SCP, etc. protocols.
The UDP packets need to be collected by the master as fast as possible, preferably within 3-4 ms. When I run the setup with just the UDP reception app running on the master, I see that this condition is easily met. However, when the FTP/SCP/etc. apps are also left running, there are spikes in the reception time. The size of the files being transferred is pretty less but a new file is retrieved from each slave about every second or so.
The fact that the results are good when running the setup without the file transfer apps active tells that Linux network "queuing/scheduling" seems to be giving similar priority to both UDP & the other protocols. Maybe it's even holding off UDP if a FTP is going on?
Is there a way to tell Linux (programmatically/commands) to give highest priority to UDP communication & "pause" other things like file transfer when a UDP message is ready for reception?
Edit 1: I added these to control the traffic based on the protocol type (UDP is protocol 17)
tc qdisc add dev eth0 root handle 10: prio tc filter add dev eth0 parent 10: protocol ip prio 1 u32 match ip protocol 17 0xff flowid 10:1 tc filter add dev eth0 parent 10: prio 3 protocol all u32 match u32 0 0 flowid 10:3
The 3rd one is what I think is an "all match filter". However, this made no difference. I still get the same spikes.