From the April 2014 issue of Futures Magazine • Subscribe!

Trading on the cutting edge

Consider the cloud

Much of the focus in the technology world is on the cloud. The cloud is more than just storage, however. It promises to provide computational power on demand. Services such as Amazon’s EC2 and Microsoft’s Azure promise to provide computational cycles without having to invest in your own server farm.

This is good for businesses because you only pay for what you use. If you need to compute a large result you can launch many “instances” (essentially virtual computers) to compute the result and then terminate them once they’re done. Although this sounds revolutionary, in practice it doesn’t live up to its promises. To see why, we need to explore more about the infrastructure behind cloud computing.

Amazon offers multiple instance types. You can pay for everything from single-thread machines with just a little over 600MB of RAM, all the way up to heavily compute-optimized instances. The single-thread machines are cheap, but aren’t suited for financial computations. For most of our calculations, we would need instances with many cores. Amazon rates each instance by computational power. They call each “unit” of computation an ECU which is defined as providing “the equivalent CPU capacity of a 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor.”

Each instance varies primarily by the number of virtual CPUs, memory and “ECU power.” The ECU power means, in theory, that the virtual server, once launched, will provide the equivalent of that many 1.0-1.2 GHz old Xeon processors. It’s worth noting that Xeons are excellent for server applications but tend to be less optimized for numerically intensive computational tasks. 

There are a range of pricing structures, but as an example, for $3.73 per hour, you can launch a 32 virtual CPU Windows server with 108 “ECUs,” 60 GB of RAM, and 640 GB of hard-disk storage. This sounds, at first, to be the bargain of a lifetime. For less than $4 an hour, we can harness the equivalent of 108 Xeons. 

As a basic test of this solution, a simple program was built that would do 200,000 math operations on a parallel “for loop” over all available threads. Initial results were promising. A new i7 4700-MQ laptop did that loop in one minute. A 14 ECU instance took two minutes and a 28 ECU instance took one minute. The eight virtual CPU instance seemed to resemble the computational power of the eight cores in the laptop processor. Further results, though, were disappointing.

TradersStudio was loaded on four Amazon EC2 instances and a trading system (the Parabolic SAR system, which is notoriously computationally intensive) was run using 100 optimizations over three stocks. The results are as follows:

  • Time on laptop: 42 seconds.
  • Time on EC2 large (4 vCPUs): 1:52 @ $0.466/hr.
  • Time on EC2 2xlarge (8 vCPUs): 1:04 @ $0.932/hr.
  • Time on EC2 4xlarge (16 vCPUs): 0:46 @ $1.864/hr.
  • Time on EC2 8xlarge (32 vCPUs): 0:25 @ $3.728/hr.

Amazon’s computation capabilities start to break down. It took the 16 vCPU instance on Amazon to match the laptop. That system costs $1.86 per hour. If you’re looking at doing five hours of calculations per day, 200 days of the year, that would be about $1,800 per year. Even going up to 32 vCPUs doesn’t result in much of an improvement, producing the calculation result in about 60% of the time as the laptop for a whopping $3.73 an hour.

Unfortunately, this result was not an outlier. Further tests were also weak. In short, the two largest cloud computing providers weren’t able to beat a modern laptop quad-core processor, which is less powerful than a desktop quad-core and also probably less powerful than the average middle of the road home PC.

The reason for this poor performance is both Amazon and Windows Azure are sensitive to throttling. Many virtual servers are running on one physical server. That is, one machine in the real world is running many virtual machines for many clients. That physical machine only has so much processing power. If we ping the CPU and ask it to perform complex calculations, it can slow down other servers. To protect against this, large companies throttle users’ CPU usage. If we try and use the server for complex calculations, we trigger this throttling, which slows our speed dramatically. 

Cloud computing seems to be best suited for two groups of people: those that have light server applications (web and database servers) and those that have deep pockets and are willing to pay relatively large amounts of money for the flexibility of being able to add and remove computational power as necessary. Individual traders typically don’t fall into either of those two categories. Maybe in the future, the gains will add up for traders, but for now it seems as though the cloud is still not quite ready for the heavy duty computations that trading research requires.

<< Page 2 of 5 >>
Comments
comments powered by Disqus