High Frequency Trading and NoSQL. Peter Lawrey CEO, Principal Consultant Higher Frequency Trading



Similar documents
Low level Java programming With examples from OpenHFT

Deep Dive: Maximizing EC2 & EBS Performance

SAP HANA - Main Memory Technology: A Challenge for Development of Business Applications. Jürgen Primsch, SAP AG July 2011

Datacenter Operating Systems

Distributed File System. MCSN N. Tonellotto Complements of Distributed Enabling Platforms

Boost SQL Server Performance Buffer Pool Extensions & Delayed Durability

D1.2 Network Load Balancing

Benchmarking Cassandra on Violin

Introduction Page 2. Understanding Bandwidth Units Page 3. Internet Bandwidth V/s Download Speed Page 4. Optimum Utilization of Bandwidth Page 8

Lecture 5: GFS & HDFS! Claudia Hauff (Web Information Systems)! ti2736b-ewi@tudelft.nl

D. SamKnows Methodology 20 Each deployed Whitebox performs the following tests: Primary measure(s)

Agility Database Scalability Testing

BigMemory & Hybris : Working together to improve the e-commerce customer experience

Direct NFS - Design considerations for next-gen NAS appliances optimized for database workloads Akshay Shah Gurmeet Goindi Oracle

Getting Started with SandStorm NoSQL Benchmark

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems

RAMCloud and the Low- Latency Datacenter. John Ousterhout Stanford University

In Memory Accelerator for MongoDB

Sitecore Health. Christopher Wojciech. netzkern AG. Sitecore User Group Conference 2015

Accelerating Enterprise Applications and Reducing TCO with SanDisk ZetaScale Software

Unit Storage Structures 1. Storage Structures. Unit 4.3

Cloud Computing with Microsoft Azure

Operating Systems and Networks Sample Solution 1

Accelerating Server Storage Performance on Lenovo ThinkServer

Bandwidth Service Overview

A Study of Application Performance with Non-Volatile Main Memory

Transactions and ACID in MongoDB

Unstructured Data Accelerator (UDA) Author: Motti Beck, Mellanox Technologies Date: March 27, 2012

Can the Elephants Handle the NoSQL Onslaught?

Whitepaper: performance of SqlBulkCopy

Performance Monitoring AlwaysOn Availability Groups. Anthony E. Nocentino

Amadeus SAS Specialists Prove Fusion iomemory a Superior Analysis Accelerator

BigMemory: Providing competitive advantage through in-memory data management

PERFORMANCE TUNING ORACLE RAC ON LINUX

Cloud Computing Is In Your Future

Cognos Performance Troubleshooting

VI Performance Monitoring

Introduction to Hadoop. New York Oracle User Group Vikas Sawhney

GraySort and MinuteSort at Yahoo on Hadoop 0.23

MEASURING WORKLOAD PERFORMANCE IS THE INFRASTRUCTURE A PROBLEM?

Configuring Apache Derby for Performance and Durability Olav Sandstå

Achieving Real-Time Business Solutions Using Graph Database Technology and High Performance Networks

ZooKeeper. Table of contents

Minimum Hardware Configurations for EMC Documentum Archive Services for SAP Practical Sizing Guide

CS2510 Computer Operating Systems

CS2510 Computer Operating Systems

OPTIMIZE DMA CONFIGURATION IN ENCRYPTION USE CASE. Guillène Ribière, CEO, System Architect

Hadoop: Embracing future hardware

Tuning Your GlassFish Performance Tips. Deep Singh Enterprise Java Performance Team Sun Microsystems, Inc.

3 Examples of Reliability Testing. Dan Downing, VP Testing Services MENTORA GROUP

Building an efficient and inexpensive PACS system. OsiriX - dcm4chee - JPEG2000

SAN/iQ Remote Copy Networking Requirements OPEN iscsi SANs 1

Scaling Analysis Services in the Cloud

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

MADOCA II Data Logging System Using NoSQL Database for SPring-8

Backup architectures in the modern data center. Author: Edmond van As Competa IT b.v.

Performance Tuning best pracitces and performance monitoring with Zabbix

Distributed File Systems

Removing Failure Points and Increasing Scalability for the Engine that Drives webmd.com

Tuning Tableau Server for High Performance

Comparison of Hybrid Flash Storage System Performance

FAWN - a Fast Array of Wimpy Nodes

Performance of VMware vcenter (VC) Operations in a ROBO Environment TECHNICAL WHITE PAPER

The Bus (PCI and PCI-Express)

Configuring Apache Derby for Performance and Durability Olav Sandstå

Big Data Analytics - Accelerated. stream-horizon.com

Bellwether metrics for diagnosing

Eloquence Training What s new in Eloquence B.08.00

AKAMAI WHITE PAPER. Delivering Dynamic Web Content in Cloud Computing Applications: HTTP resource download performance modelling

Sage 200 Online. System Requirements and Prerequisites

Kentico CMS 6.0 Performance Test Report. Kentico CMS 6.0. Performance Test Report February 2012 ANOTHER SUBTITLE

Hardware Performance Optimization and Tuning. Presenter: Tom Arakelian Assistant: Guy Ingalls

VirtualCenter Database Performance for Microsoft SQL Server 2005 VirtualCenter 2.5

Scaling out a SharePoint Farm and Configuring Network Load Balancing on the Web Servers. Steve Smith Combined Knowledge MVP SharePoint Server

Performance Guideline for syslog-ng Premium Edition 5 LTS

Jeffrey D. Ullman slides. MapReduce for data intensive computing

Performance Test Report KENTICO CMS 5.5. Prepared by Kentico Software in July 2010

Flash for Databases. September 22, 2015 Peter Zaitsev Percona

Parallel Processing and Software Performance. Lukáš Marek

Contents Introduction... 5 Deployment Considerations... 9 Deployment Architectures... 11

Enhancing SQL Server Performance

Benchmarking Couchbase Server for Interactive Applications. By Alexey Diomin and Kirill Grigorchuk

Introduction to Big Data Training

Symantec Endpoint Protection 11.0 Architecture, Sizing, and Performance Recommendations

White paper. QNAP Turbo NAS with SSD Cache

COLO: COarse-grain LOck-stepping Virtual Machine for Non-stop Service

Kepware Technologies Optimizing KEPServerEX V5 Projects

Analysis of VDI Storage Performance During Bootstorm

Lecture 6 Cloud Application Development, using Google App Engine as an example

Mass Storage Structure

Mike Canney. Application Performance Analysis

About Me: Brent Ozar. Perfmon and Profiler 101

Agenda. Enterprise Application Performance Factors. Current form of Enterprise Applications. Factors to Application Performance.

InfiniteGraph: The Distributed Graph Database

MySQL Cluster New Features. Johan Andersson MySQL Cluster Consulting johan.andersson@sun.com

Secure Cloud Storage and Computing Using Reconfigurable Hardware

This talk is mostly about Data Center Replication, but along the way we'll have to talk about why you'd want transactionality arnd the Low-Level API.

Performance Counters. Microsoft SQL. Technical Data Sheet. Overview:

Transcription:

High Frequency Trading and NoSQL Peter Lawrey CEO, Principal Consultant Higher Frequency Trading

Agenda Who are we? Brief introduction to OpenHFT. What does a typical trading system look like What requirements do these systems have OpenHFT performance.

Who are we Higher Frequency Trading is a small consulting and software development house specialising in Low latency, high throughput software 8 developers in Europe and USA. Sponsor HFT related open source projects Core Java engineering

Who am I? Peter Lawrey - CEO and Principal Consultant - 3rd on Stackoverflow for Java, most Java Performance answers. - Founder of the Performance Java User's Group - An Australian, based in the U.K.

What is our OSS Key OpenHFT projects Chronicle, low latency logging, event store and IPC. (record / log everything) HugeCollections, cross process embedded persisted data stores. (only need the latest) Millions of operations per second. Micro-second latency.

With other NoSQL databases Uses with NoSQL Off heap cache of data from a DB. Low latency queue for persisting to a DB Map which replicates only the latest values. Supports very high update rates by only replicating the latest value.

What is HFT? No standard definition. Trading faster than a human can see. Being fast can make the difference between making and losing money. For different systems this means typical latencies of between 10 micro-seconds and 10 milli-second. (Latencies external to the provider)

Time scales every developer should know. Operation Latency In human terms L1 Cache hit 1 ns A blink of an eye (~20 ms) L2 Cache hit 3 ns Noticeable flicker L3 Cache hit 10 20 ns Time to say A Main memory 70 100 ns Time to say a ten word sentence Signal down a 200m fibre cable 1 μsec One slide (speaking quickly) SSD access 5 25 μsec Time to reheat a meal (3 mins) HDD access 8 msec Time to flight around the world. (1.8 days) Network packet from Germany to the USA 45 msec Waiting for a 7 working day delivery

Simple Trading System

Event driven processing Trading system use event driven processing to minimise latency in a system. Any data needed should already be loaded in memory, not go off to a slow SQL database. Each input event triggers a response, unless there is a need to limit the output.

Critical Path A trading system is designed around the critical path. This has to be as short in terms of latency as possible. Critical path has a tight latency budget which excludes many traditional databases. Even the number of network hops can be minimised. Non critical path can use tradition databases

Critical Path databases Time Series databases Kdb, kona InfluxDB OpenTSDB Designed for millions of writes per second. Column based database => 100 Million operations per second e.g. sum a column.

Critical Path Databases

Critical Path data store HFT strategies are; described using graphs. handle events in real time ~10 100 μsec. cache state rather than query a database. all custom written libraries AFAIK.

Critical Path data store Logging is performed by appending to memory mapped files. OpenHFT's Java Chronicle makes this easier to do in Java in a GC-free, off heap, lock less way. Such low level coding is relatively easy in C or C++.

Non-critical Datastore Configuration management ZooKeeper, etcd Plain files with Version control LDAP Any distributed key-value store. e.g. MongoDB

Big Data Back testing a HFT system is critical and a number of solutions are available Hadoop Matlab Time series R

Operational Infrastructure Control and management infrastructure JMS, JMX Tibco RV, LBM Terracotta MongoDB

Reliable persistence Trades and Orders are high value data and less voluminous than Market data or strategy results. Typically SQL Database. Sometimes multiple databases for different applications.

Why use more exotic database? Mostly for high throughput. Million per second in one node. Often for low latency. Latencies well below a milli-second.

Why wouldn't you use exotic DB Not easy to learn, high knowledge investment. (!R)@&{&/x!/:2_!x}'!R Often harder to use. Less management tools. Not designed to work with web applications. More sensitive to the details of the hardware and what else is running on the same machine.

Low latency at high throughput Java Chronicle is designed as a low latency logger and IPC. At one million small messages per second Almost zero garbage Latency between processes around 1 microsecond Concurrent readers and writers Supports bursts of 10 million messages/sec.

Chronicle and replication Replication is point to point (TCP) Server A records an event replicates to Server B Server B reads local copy B processes the event Server B stores the result. replicates to Server A Server A replies. Round trip 25 micro-seconds 99% of the time GC-free Lock less Off heap Unbounded

HugeCollections HugeCollections provides key-value storage. Persisted (by the OS) Embedded in multiple processes Concurrent reads and writes Off heap accessible without serialization.

HugeCollections and throughput SharedHashMap tested on a machine with 128 GB, 16 cores, 32 threads. String keys, 64-bit long values. 10 million key-values updated at 37 M/s 500 million key-values updated at 23 M/s On tmpfs, 2.5 billion key-values at 26 M/s

HugeCollections and latency For a Map of small key-values (both 64-bit longs) With an update rate of 1 M/s, one thread. Percentile 100K entries 1 M entries 10 M entries 50% (typical) 0.1 μsec 0.2 μsec 0.2 μsec 90% (worst 1 in 10) 0.4 μsec 0.5 μsec 0.5 μsec 99% (worst 1 in 100) 4.4 μsec 5.5 μsec 7 μsec 99.9% 9 μsec 10 μsec 10 μsec 99.99% 10 μsec 12 μsec 13 μsec worst 24 μsec 29 μsec 26 μsec

Bonus topic: Units A peak times an application writes 49 mb/s to a disk which supports 50 mb/s and is replicated over a 100 mb/s network. What units were probably intended and where would you expect buffering if any?

Bonus topic: Units A peak times an application writes 49 MiB/s to a disk which supports 50 MB/s and is replicated over a 100 Mb/s network. MiB = 1024^2 bytes MB = 1000^2 bytes Mb = 125,000 bytes The 49 MiB/s is the highest rate and 100 Mb/s is the lowest.

Bonus topic: Units Unit bandwidth Used for mb - miili-bit mb/s milli-bits per second? mb - milli-byte mb/s milli-bytes per second? kb kilo-bit (1000) kb/s kilo-bits (baud) per second Dial up bandwidth kb kilo-byte (1000) kb/s kilo-bytes per second? Mb mega-bit (1000^2) Mb/s mega-bits (baud) per second Cat 5 ethernet MB - mega-byte (1000^2) MB/s mega bytes per second Disk bandwidth Mib mibi-bit (1024^2) Mib Mibi-bits per second? MiB mibi-byte (1024^2) MiB Mibi-bytes per second Memory bandwidth Gb giga-bit (1000^3) Gb/s giga-bit (baud) per second High speed networks GB giga-byte (1000^3) GB/s giga-byte per second - Gib gibi-bit (1024^3) Gib/s gibi-bit per second - GiB gibi-byte (1024^3) GiB/s gibi-byte per second. Memory Bandwidth

Q & A https://github.com/openhft/openhft @PeterLawrey peter.lawrey@higherfrequencytrading.com