Updating our latency optimized trading servers

Automated trading. Money without a human. But it requires a server – or more than one server. Trading-Robots.com does automated trading and our infrastructure is starting to age – time to plan an upgrade to our trading servers. Let us have a look what on where we are and where we can go.

Our focus: low latency automated trading

We do not do HFT – and we do not collocate with an exchange. Our servers are in a data center in the same city, which normally gives us a below 1ms latency. Good enough for us. It puts is in front of every trader that tries to trade from home, from a cloud provider (which normally is somewhere in the middle of nowhere with a really big data center). It means we are not competitive with anyone collocating at the exchange – but we do not have to be. All our algorithms are optimized for real trading, where speed is good (for stops and exits) but not our trading edge. It is not why we make money.

Our infrastructure – time to start thinking about a replacement

Our infrastructure right now is rented from a provider. Physical – we do not like virtual machines where we do not know how loaded they are. We run Windows Server on it, with Hyper-V and then virtual machines for trading. We route all traffic through a virtual router on the machine. Thanks to a very low load on the host there simply is no artificial delay. The Operating System is Windows Server 2012 R2 – and the CPU is a Phenom II with six cores. AMD. Aging. Today one can get a lot more powerful processors. And machines with more than the 16 GB ram that our servers have.

Why we will replace it – simply because it is aging.

A new computer will give us more leeway and more performance – but also means new hardware. After some years the chance of a failure simply starts to fail. On top, the price we pay is fixed from the start. We can now get the same standard server we run cheaper and still more powerful. Saving money, getting more reliability and performance at the same time, without investment (remember, we rent – so there is no capital requirement, although we may consider buying this time).

What will replace it? That is a good question and time is critical.

Yes, that is the old question: what to buy (or rent). And we likely will do some waiting here – our timeframe is not “now” but it is “up to 6 months”. Our hardware is not broken, it is aging – and we do have some time. Our focus this time will be to move all SSD, in line with our current company strategy. We moved all databases and performance stores to SSD some month ago and never will look back. Replacing the hard discs on our servers in our small server room has made a really big difference. Our storage needs on the trading side are not extraordinarily high – a 400 to 480 GB SSD should be enough in every server. We prefer some space there because we really like to buffer some months of trade data as an external copy. We also prefer running Hyper-V – our private cloud. But it’s possible that with this rework, and the new trading server, we may go physical with a small number of machines – to optimize out the last latency delay that Hyper-V is adding. Undecided yet.

If possible, I would wait for the new Broadwell processors to come. But then, if we do not go for Broadwell now – we will in some years anyway. Not really worth the wait. Same with the new next generation Windows Server coming in 2015. The move to a current Intel processor will provide a good boost in performance already. And allow us to move to a full SSD setup – definitely not a small change. And if you wait for “the next processor” or “the next operating system” – then you always wait. Forever. There always is the next version around. Unless one does high frequency trading – which we actively avoid – there is no reason to go crazy about the latest in processing.

But every couple of years, and upgrade is not worthless. It allows one to use a lot better functionality – for example the IPMI remote control systems have undergone major upgrades in the last years. A more modern motherboard is a lot more comfortable in this area. SSD, more RAM (our current servers are limited to 16 GB). And, more physical stability – servers do age.

New Trading Servers – this is our goal Looking at the current servers available – we will go for Intel based machines, 32 GB of memory. That is a lot of reserve for our secondary virtual machines – for example the web server running this website. A nice hex core will allow us to either go with 6 cores – no hyper threading. Or to use 12 virtual cores. Intel based 1 gigabit network uplinks will transport the data fast enough for our needs. We add a 480 GB SSD – for the operating system and the images of the small number of virtual machines we will run. Our policies ask for full core allocations (1 physical core for 1 core in a virtual machine). Given most of our virtual machines re not really busy – that is plenty of processing power. But it is still a valid policy because it helps to reduce latency. There simply is never an occasion where a virtual machine has to wait for a core to become free from work it has to do for another virtual machine. For high availability, we go with 2 machines minimum. It is too bad the next Windows Server is not available right now – it brings real time high availability to the disc subsystem by allowing replication on the block level. And we will try to stay with Swiftway, our current server provider. Our experiences with them are top – so there is no need to change.

Our high speed trading server – is a totally normal server

This may look like a surprise to most, but it is the simple truth. The time where normal trading – outside of the realms of high frequency trading – required the most modern machines possible are simply over for a long time. Low latency trading is about putting a decent server close to the exchange. It avoids the cost of exchange colocation. It avoids technical risks (like the international internet failing – the risk is a lot lower when there is a direct connection, or one is in the same city). But it is not about very special or high end hardware anymore. It has not been about this for quite many years. For all except those that live in the technological rat race that is high frequency trading.

Obviously this is different in back testing and optimization – because there, raw processing power is needed. Optimizations take often hours in our nearly 200 computer core grid. But – the trading itself is as optimized as we can make it and strategies do not run super complicated mathematical models. At least our strategies do not.

A faster trading server – possible but with side effects.

We do not need it, but there are multiple ways one can improve this build. The obvious one is to skip on the virtualization – no Hyper-V is one less latency source. The second area is overclocking – though that often comes with a big burden. A server lives in a colocation center. This means – no physical fast access. Most server motherboards support good remote management – via the already mentioned IPMI functionality. This basically means you can boot the server, reset it, and install the operating system (via a mounted ISO file) from home. And sadly non-server motherboards have limited functionality here. The best you could get is likely in the area of an ASUS ROG motherboard – Republic of Gamers. Comes with a totally useless (for a trader) sound card (in the server room no one hears you scream). But it comes with a latency optimized network card and – the possibility for extreme overclocking. How much this will bring – it is a good question. Shaving off a little may pay off. This is your choice – the price and convenience are factors to take into account. For our trading it is not relevant – so we stick to a tried and tested standard reliable server. Oh, and with money – suppliers even sell you nice overclocked servers to start with. SuperMicro for example offers overclocked servers. Once the offers are upgraded to the current v3 chips that will be quite nice machines. For a price. And to make real use of them – you need exchange colocation. And strategies that need that.