When the speed of light is too slow

I'm currently working on a Real Time Bidding system. Basically, when someone visits a Web page, that page may cause a bid request to be sent out to multiple ad bidders and they bid on who gets to place the ad. For my system, I have to respond withing 100 milliseconds to be eligible to participate in the auction. That's when life gets interesting.

Currently my code evaluates a bid request, selects an appropriate creative (advertisement) and responds within 1 to 3 milliseconds. Given that I need to respond within 100 milliseconds, that should be fine.


You see, I like to make sure that my code actually works (silly me). The company we're working with has a data center in Amsterdam, but their closest data center with a sandbox is in New York City. Given that the speed of light travels at roughly 300,000 km/s and New York and Paris (where our our servers are) are almost 6,000 kilometers apart and have a round-trip speed of light travel time of roughly 40 milliseconds, you might think I still have plenty of time to respond.

Unfortunately, that speed of light is the speed of light in a vacuum. My response is going over fiber, is not going in a straight line and is passing through multiple bits of hardware.

Despite my responding in 1 to 3 milliseconds, my responses are taking around 250 to 500 milliseconds to reach the New York sandbox. It is simply not possible for me to submit a winning bid from our servers in Paris. As a result, while I can demonstrate that my code can talk to their code, I cannot run a successful test. Until this company sets up a sandbox in Amsterdam, we're going to have to spend money to set up a server in the US.

We've considered an Amazon cloud instance, though I think a cheap Linux box with root access should be fine. I'm not sure yet of the pros and cons. Suggestions welcome.


Linode has a datacenter in Newark, NJ and it costs $20/month to have a VPS. I use it and like it.

I suspect that other factors kick in in addition to speed of light, e.g. latency in intermediate network elements. This is something that might be difficult to factor out even if you're geographically closer, although you're going to have savings in the pure physical transmission part of course.

Additionally, Amazon/RackSpace virtual boxes are paid as you go (with a resolution of one hour, I think); you might activate the box only when you actually have to run tests. This actually depends on your testing pattern.

Perhaps rather than communicate via photons you should consider switching to the state-of-the-art neutrino! Problem solved. :-P

(I'm a physicist, I couldn't help myself, sorry)

I'll second linode. Cheap, no hassles, fast and seems to using pretty decent network. And their NJ datacenter should be plenty close to NYC for your needs.

The first thing I remember about all my electronics work in grad school is "One foot equals one nanosecond". Our problem was mostly normalizing electrical paths, so we had sections of one, two, and three foot cables to add nanoseconds to signal times if one path was too short.

The financial types who do the fast trading actually buy connections into the target servers and either put their machines in the same building or across the street.

Even if Linode is cheap and geographically close, check how far it has to travel through its network to get to the network you want to get into. I know you know that, but other people reading this might not.

Video of Grace Hopper talking about nanoseconds


The maximum distance that light or electricity can travel in a nanosecond is 11.8 inches.

The maximum distance that light or electricity can travel in a microsecond is 984 feet.

It's a pity that networks work much slower than the speed of light.

About Ovid

user-pic Freelance Perl/Testing/Agile consultant and trainer. See http://www.allaroundtheworld.fr/ for our services. If you have a problem with Perl, we will solve it for you. And don't forget to buy my book! http://www.amazon.com/Beginning-Perl-Curtis-Poe/dp/1118013840/