5 ms·
We have a Java application that trades in the financial markets. Latency is important to us; we are continually trying to improve latency, increase throughput a
by cperciva 17y ago
We have a Java application that trades in the financial markets. Latency is important to us; we are continually trying to improve latency, increase throughput and reduce jitter.
Seriously? You want low latency but you're using Java?
If you want low latency, you really want to avoid anything which does garbage collection.
- hga 17y agoWell, that depends on the periods they're talking about. If it's in the 10 ms plus or minus range, yeah, a conventional JVM is an issue, but there are hard real time GCs and a demand for this in Java. Then again, satisfying hard real time may cut against throughput. Wikipedia's list of JVM implementations points out these ones for the embedded market: This one claims to do hard real time: http://en.wikipedia.org/wiki/JamaicaVM http://en.wikipedia.org/wiki/JamaicaVM And this is for "real time" but they do too much dancing around for me to believe they have a hard real time JVM, they mostly claim very fast and "5-9s": http://www.aonix.com http://www.aonix.com What are your latency and jitter requirements and desires?
- cperciva 17y agoIf it's in the 10 ms plus or minus range High frequency financial trading requirements are closer to 10 microseconds than 10 milliseconds.
- hga 17y agoREALLY??? Could you provide some pointers? What I've been reading in the last year or so wasn't to my memory less than 2-3.5 ms. 10 us would be a whole different ball game!
- sophacles 17y agoDepends. 10us is a target for the entire messaging stack. See for instance zeromq.org. Other things, with calculations have different time targets. So determining timing requirements from something as vague as "Low latency trading app" is a bit difficult. I have a friend working for a company that does this, and his job is essentially "shaving microseconds" to quote him.
- hga 17y agoWow. 13.4 us "end-to-end latencies and up to 4,100,000 messages a second today", but then again, it was something attractive enough that iMatix (for whom I have a lot of respect) bought the company, so the only surprise is that they were able to get it that fast. Thanks for the info and pointer!
- profquail 17y agoI don't know about the JVM, but Gen0 and Gen1 garbage collections on .NET are generally under that. Gen0 is fast enough to even be in the 10's of ns range. Also, remember that he's trading over an internet connection, and there's going to be some non-zero latency there that will overshadow all but the slowest garbage collections.
- hga 17y agoYour last point is an "it depends": a lot of companies set up stuff next to the computers of the exchange(s) they're interested in, so that latency is very low and largely bounded.
- HockeyPlayer 17y agoAgreed; anyone serious is sub-ms
- wmf 17y agoIt's possible: http://www-01.ibm.com/software/webservers/realtime/description.html http://www-01.ibm.com/software/webservers/realtime/descripti... HockeyPlayer, try contacting the Metronome team directly. http://domino.research.ibm.com/comm/research_projects.nsf/pages/metronome.index.html http://domino.research.ibm.com/comm/research_projects.nsf/pa...
- HockeyPlayer 17y agoThere are times during the app's runtime that it is perfectly safe to collect all generations, and times when we would rather not do a GC.