1

I'm using HP DL360p Gen8. I've installed dual-boot Windows Server 2008 R2 and RHEL7. In both systems I configured LACP and VLANs. So this is same server, same hardware, same network, same route tables etc.

I worry about latency, including network latency, because I'm using this server for HFT trading.

Now I was expecting that if I ping the same host from Windows and Linux, then Linux must be slighty better. Surprisingly it is not better at all. Actually it even ~5-10 microseconds worse, then Windows, when I ping same host.

  • i'm using hrping in Windows and ping in Linux
  • in Windows i've used HP utility for teaming, in RHEL 7 i've used built-in "teaming" (not bonding)

I was expecting Linux to be better, because:

  • i suppose RHEL 7 network implementation is faster than Windows Server 2008 R2
  • i suppose RHEL 7 teaming/LACP/VLANs implementation is faster then Windows Server 2008 R2/HP one

My questions:

  1. if such number exist: how much microseconds faster ping from RHEL 7 than Windows Server 2008 R2?
  2. if it indicates potential problem that Linux ping is 5-10 microseconds slower or I should just ignore this fact?
  3. what can I do/diagnose/troubleshoot to make Linux ping faster than Windows

Of course in real life i more care about latency of real traffic, such as TCP/UDP, but i'm using ping as a first step. Probably ping show same numbers because it "simple" but on real TCP/UDP traffic Linux will be much faster?

  • the difference could just be a reporting artifact due to differences in scheduler or clock granularity. – Barmar Oct 15 '14 at 18:19
  • Since you are trying to measure low latency, you should try installing a Linux distro with a low latency kernel. – user102598 Feb 10 '15 at 13:33
  • Note there are two kinds of ping - one which gets a response from the network layer, and one which gets a response from a process. – Thorbjørn Ravn Andersen Feb 10 '15 at 14:06
  • rhel 7 ping become faster after i used "tuned-adm" to switch to network-latency profile – javapowered Feb 11 '15 at 14:22
0

There are a number of factors. First is the machine you are running on. If windows and linux were on different hardware, the measurement is meaningless.

Of course you have to measure the average ping after many tries, the first few pings may include other delays.

The packets have to go through the kernel (ip stack and network device driver) out, and then in again when the response is received. At this stage, there could be many factors that influence the difference:

  1. what is actually timed: two different implementations of ping could do more or less boilerplate work between starting the timer and actually sending the thing (and the same on receiving path).
  2. existence o filters: firewalls and such, can introduce extra steps
  3. clock granularity: how finely are processes multiplexed by the kernel? Even among diferent linux levels, the tick length can vary greatly, or the kernel could be more or less tickless (running without interruptions if there is only one process running).
  4. process management: how quickly and in what way is the process woken up when the packet comes back? Windows and Linux do this in completely different ways.
  5. What is the rest of the system doing? Is there heavy IO happening at the same time that would make the kernel busy? Is there a change if you nice the ping to a higher priority?
  6. Frequency scaling: management of CPU frequency can vary greatly: Linux has many "governors" that do things differently. So, it is possible that linux is running at lower clock speed when idle - also, a moment of frequency switch has extra latency.
  7. The implementation and compilation of ping utility could also have some minor effects (although the in-kernel latency is probably the main contribution).

Linux kernel is known to hit the limit in network throughput at 10 gigabit level. So... it shouldn't make much of a difference at microsecond speeds. It's likely a matter of scheduling, OS latencies and so on. And the ping latency does not represent the actual performance under load. You shouldn't take this measurement as a factor when you decide anything. You need many other benchmarks, particularly under realistic loads.

And finally, linux kernel settings can greatly influence the performance - real-time projects need a dedicated kernel to perform at an optimal level. You will find more variations between different configurations (on both platforms) than you found in these two tries.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.