NexusFi: Find Your Edge


Home Menu

 





How to measure data feed latencies between continents?


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one Koepisch with 22 posts (5 thanks)
    2. looks_two Big Mike with 18 posts (6 thanks)
    3. looks_3 artemiso with 11 posts (1 thanks)
    4. looks_4 gomi with 7 posts (21 thanks)
      Best Posters
    1. looks_one gomi with 3 thanks per post
    2. looks_two Fat Tails with 3 thanks per post
    3. looks_3 Big Mike with 0.3 thanks per post
    4. looks_4 Koepisch with 0.2 thanks per post
    1. trending_up 28,269 views
    2. thumb_up 48 thanks given
    3. group 8 followers
    1. forum 66 posts
    2. attach_file 15 attachments




 
Search this Thread

How to measure data feed latencies between continents?

  #31 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518

I don't want to discuss the pro + con of using VPS here - thats obvious and it's mentioned many times at BM. It's a thread about measuring latencies with the emphasis of getting the most accurate wall time on a windows system.

Getting the time from an local attached stratum 1 source can be done with sub ms precision. Getting the time from within Windows (7) is a more complex issue. But with the combined use of the system timer and the performance counter this can be solved.

See here: https://www.windowstimestamp.com/description

Starting with Windows 8 there is no need for that, because some kernel functions were added and the function GetSystemTimePreciseAsFileTime makes all of the stuff for us.

You can also using Linux to get an accurate system time.

Thanks to artemiso, to flash that topic. Using an hosted OS brings more timing problems ahead, because the guest can't share the hosts timing system 1:1.

See Here: Timekeeping in VMWare

The following latency test's are planned (each test is running a few days):
Common: Local attached stratum 1 (GPS) based time reference with NTP Server (+-500us)
* Test on Win7 (clock controlled by Microsecond Resolution Time Services for Windows solution)
* Test on Win8
* Test on Linux
* Test on Win7 + VMWare Win7
* Test on Win Server 2012 (currently no license for that)


EDIT: Some test are dispensable, because i have an better idea to grab the OS differences (See Post #48). With my main Setup i will run the R|API test to measure the Overall latencies. To get a better feeling about the plattform dependend latencies (just for interest - not for this project) i apply the local stack test.

I make some more tests to see if it is easier to get the current time direct from the stratum 1 source (without utilizing the clock control). An optimized UDP path the the stratum device should have a sub ms RTT.

If anyone want to buy me a SolarFlare NIC, i include this in my tests!

Koepisch

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
33 thanks
Just another trading journal: PA, Wyckoff & Trends
28 thanks
Tao te Trade: way of the WLD
23 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #32 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425

With regard to timing anything in these areas it is definitely worth being aware of scheduling issues, these two PDF's are worth a lunchtime read.

As a multi-decade veteran of OS scheduling I would be interested to hear how people handle this on current VPS boxes, e.g. by tweaking settings, limiting access, etcetera.

If it's too off-topic then please accept my apologies.

Travel Well
Attached Thumbnails
How to measure data feed latencies between continents?-measuring-processor-utilization-windows.pdf   How to measure data feed latencies between continents?-vmware-esx3_ready_time.pdf  
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #33 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518



ratfink View Post
With regard to timing anything in these areas it is definitely worth being aware of scheduling issues, these two PDF's are worth a lunchtime read.

As a multi-decade veteran of OS scheduling I would be interested to hear how people handle this on current VPS boxes, e.g. by tweaking settings, limiting access, etcetera.

If it's too off-topic then please accept my apologies.

You are welcome. For my tests i can only do the following to reduce context switches:

1. Stripe down / disable OS Services
2. Test program is attached to one cpu core and thread
3. Switch cpu power management off
4. Run test program at higher priority

If anybody has other recommendations, feel free to explain. BUT the thread belongs to get precise wall time and not to reduce lag within the system. The cost of implementing sophisticated solutions (there are many of them) doesn't fit to the possible gains in my trading account.

Started this thread Reply With Quote
Thanked by:
  #34 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


Big Mike View Post
I don't have all the libraries installed, post compiled code for Windows and x64 linux and I'll post my results from a VPS vs dedicated.

Mike

For Linux X64.

Success requires no deodorant! (Sun Tzu)
Attached Files
Elite Membership required to download: LatencyTest.gz
Follow me on Twitter Reply With Quote
Thanked by:
  #35 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,444 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608


sam028 View Post
For Linux X64.

Running on a production machine with a high load right now in the middle of the cash session, so keep that in mind:





Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #36 (permalink)
 artemiso 
New York, NY
 
Experience: Beginner
Platform: Vanguard 401k
Broker: Yahoo Finance
Trading: Mutual funds
Posts: 1,152 since Jul 2012
Thanks Given: 784
Thanks Received: 2,685


Big Mike View Post
Running on a production machine with a high load right now in the middle of the cash session, so keep that in mind:





Mike

You may need to include time.h.

I am getting anywhere between 2 to 26 milliseconds on my VPS, averaging about 8 ms, as predicted. This is a fresh install with practically no load, but these two factors are not the focal point. I expect it's another order of magnitude larger on EC2.



EDIT> The moral of the story is that most people don't need to make any kind of sub-second latency measurement. Here's an algorithm: They just need to determine their budget based on their returns, find options with a steady internet connection and power supply (it's true that a server at a data center generally qualifies), then do the elementary ping and bandwidth tests to choose the best option amongst those available at that budget. At the end of the day, 99% (I'm generalizing) of people extract no measurable value from their $150/month dedicated servers and are actually better off with getting a better internet service for their home computers.

Reply With Quote
  #37 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,444 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608


artemiso View Post
You may need to include time.h.

I am getting anywhere between 2 to 26 milliseconds on my VPS, averaging about 8 ms, as predicted.

I haven't run it on a VPS. The only VPS that I use is Windows based and I don't have g++ installed.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #38 (permalink)
 artemiso 
New York, NY
 
Experience: Beginner
Platform: Vanguard 401k
Broker: Yahoo Finance
Trading: Mutual funds
Posts: 1,152 since Jul 2012
Thanks Given: 784
Thanks Received: 2,685


artemiso View Post
Cross-compiled, not sure if it will work. .exe's seem to be disabled so I will upload it in .cpp, rename to get it working. Will try it out in a second...

Doesn't work, let me fix it.

Reply With Quote
  #39 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518


artemiso View Post
Cross-compiled, not sure if it will work. .exe's seem to be disabled so I will upload it in .cpp, rename to get it working. Will try it out in a second...

@artemiso: Why do you scramble your code with the DEFINEs?

Started this thread Reply With Quote
  #40 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,444 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608



artemiso View Post
Cross-compiled, not sure if it will work. .exe's seem to be disabled so I will upload it in .cpp, rename to get it working. Will try it out in a second...

Just zip it first for exe. Let me know when you are ready.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on February 17, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts