0

We are running a Java-based trading application, and there are certain periods where we want to prioritize outgoing network traffic as much as possible for about 10 ms. Is there a way to temporarily buffer all incoming network traffic during a short time period, either on the network card or via a process or buffer on our Redhat Linux box?

The rationale behind this is that the incoming network traffic spikes during this same period, and the application processing this traffic is stealing CPU cycles from the process we are trying to prioritize. We do not have fine-grained control over the application treating the incoming network traffic.

We're on a 1 Gbps connection so a buffer of about 1 MB should be sufficient. We would prefer not dropping the incoming traffic and requesting retransmission as this would increase load on our network during quite busy periods.

sashoalm
  • 75,001
  • 122
  • 434
  • 781
Adrian Dunn
  • 1,728
  • 1
  • 10
  • 7
  • How about using several channels for sending packets of different priorities? – Iggy Dec 24 '14 at 00:08
  • I have no control over the network traffic being received by the NIC, I need a solution that can either buffer ~ 1 MB of incoming traffic on the card itself for ~10 ms, or a low level software buffer. – Adrian Dunn Jan 05 '15 at 19:52
  • Did You tried playing with `/proc/sys/net/core` and `/proc/sys/net/ipv4`? Especially rmem_max, tcp_mem, tcp_rmem. – kestasx Jan 06 '15 at 21:49

3 Answers3

2


Possible using Qos on the router, or using trickle to control your bandwidth by a sample configuration of :

   /etc/trickled.conf.


see example in url.

issamux
  • 1,336
  • 1
  • 19
  • 35
  • Very interesting, although unfortunately does not look like it will work the applications we are running. Good answer though. – Adrian Dunn Jan 12 '15 at 20:57
  • it seem that link is dead , there is the correct link : https://linux.die.net/man/1/trickle – issamux Feb 22 '19 at 13:02
0

I am not sure whether I understand your problem correctly. Your concern is sometimes you have priority to deal with output network traffic and at this time the incoming traffic will build up and finally might cause package drop or retransmission which you don't want. Therefore, you want to buffer your incoming traffic.

If my understanding is correct and your are using TCP, try to make your tcp buffer bigger. http://kaivanov.blogspot.com/2010/09/linux-tcp-tuning.html and then Use netstat to check whether your change is effective.

qqibrow
  • 2,942
  • 1
  • 24
  • 40
  • Thanks qqibrow. My concern isn't packet drops, it's allocating the bulk of the machine's resources to some mission critical outgoing transmissions for a brief 20 ms period, and delaying the processing of any received traffic. As I have no control over the applications treating the incoming traffic, I thought that simply preventing them from consuming this data for a brief period would be the easiest solution. – Adrian Dunn Jan 12 '15 at 20:45
0

Adrian, have you tried setting the priority of your outgoing communication process to be higher than that of the process receiving the incoming data? Using the nice command this can be achieved. Note that in Unix/Linux the lower the number the higher the priority.

Otherwise I am not sure this is possible without having a direct tie in between the two applications that are sending / receiving, allowing you to effectively ignore the incoming connections that are ready to read from until any data you have is sent out.

iterator
  • 53
  • 8
  • Thanks iterator. It isn't so much the communications process that is consuming system resources, but rather the applications that are consuming the network data tying up systems resources, and in some cases even locking some of the outgoing traffic originating from these same applications. – Adrian Dunn Jan 12 '15 at 20:51
  • That was where I was hoping the priority setting may give you some relief. It should give preference, and more CPU time, to the higher priority process (in this instance, the one you're trying to allow to communicate out). If you experimented and it did help some, you could easily have one script to change the priority and another to change it back afterward. – iterator Jan 12 '15 at 22:11