Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best OS to deploy a low latency Java application?

We have a low latency trading system (feed handlers, analytics, order entry) written in Java. It uses TCP and UDP extensively, it does not use Infiniband or other non-standard networking.

Can anyone comment on the tradeoffs of various OSes or OS configurations to deploy this system? While throughput is obviously important to keep up with modern price feeds, latency is our #1 priority.

Solaris seems like a natural candidate since they created Java; should I use Sparc or x64 processors?

I've heard good things about RHEL and SLERT, are those the right versions of Linux to use in our benchmarking.

Has anyone tested Windows against the above OSes? Or is it assumed to not keep up?

I'd like to leave the Java vs C++ debate for a different thread.

like image 743
Ted Graham Avatar asked Dec 23 '09 15:12

Ted Graham


3 Answers

Vendors love this kind of benchmark. You have code, right?

IBM, Sun/Oracle, HP will all love to run your app on their gear to demonstrate their advantages.

Make them do this. If you have code, make the vendors run a demonstration on their gear to show which is best for your needs.

It's easy, painless, free, and factual. The final decision will be easy and obvious. And you will know how to install and tune to maximize performance.


What I hate doing is predicting this kind of thing before the code is written. Too many customers have asked for a H/W and OS recommendation before we've finished identifying all the use cases. Asking for that kind of precognition is simple craziness.

But you have code. You can produce test cases that exercise your code. That's perfect.

like image 116
S.Lott Avatar answered Oct 05 '22 00:10

S.Lott


For a trading environment, in addition to low latency you are probably concerned about consistency as well as latency so focusing on reducing the impact of GC pauses as much as possible may well give you more benefit than differnt OS choices.

  • The G1 garbage collector in recent versions of Suns Hotspot VM improves stop the world pauses a lot, in a similar way to the JRockit VM
  • For real performance guarantees though, Azul Systems version of the Hotspot compiler on their Java Appliance delivers the lowest guaranteed pauses available - also it scales to a massive size - 100s of GB stack and 100s of cores.
  • I'd discount Java Realtime - although you'd get guarantees of response, you'd sacrifice throughput to get those guarantees

However, if your planning on using your trading system in an environment where every microsecond counts, you're really going to have to live with the lack of consistency you will get from the current generation of VM's - none of them (except realtime) guarantees low microsecond GC pauses. Of course, at this level your going to run into the same issues from OS activity (process pre-emption, interrupt handling, page faults, etc.). In this case one of the real time variants of Linux is going to help you.

like image 36
Robert Christie Avatar answered Oct 04 '22 23:10

Robert Christie


I wouldn't rule out Windows from this just because it's Windows. My expirience over the last few years has been that the Windows versions of the Sun JVM was usually the most mature performance wise in contrast to Linux or Soaris x86 on the same hardware. The JVM for Solaris SPARC may be good too, but I guess with Windows on x86 you'll get more power for less money.

like image 20
x4u Avatar answered Oct 05 '22 01:10

x4u