Wednesday 15 November 2017

Trading System Architektur Pdf


Trading Floor Architecture Trading Floor Architecture Executive Überblick Erhöhter Wettbewerb, höheres Marktdatenvolumen und neue regulatorische Anforderungen sind einige der treibenden Kräfte hinter den Industrieveränderungen. Firmen versuchen, ihre Wettbewerbsfähigkeit zu halten, indem sie ständig ihre Handelsstrategien ändern und die Geschwindigkeit des Handels erhöhen. Eine tragfähige Architektur muss die neuesten Technologien aus Netzwerk - und Anwendungsdomänen beinhalten. Es muss modular sein, um einen überschaubaren Pfad zu schaffen, um jede Komponente mit minimaler Störung des Gesamtsystems zu entwickeln. Daher basiert die von diesem Papier vorgeschlagene Architektur auf einem Dienstleistungsrahmen. Wir untersuchen Dienstleistungen wie Ultra-Low Latency Messaging, Latenzüberwachung, Multicast-, Computing-, Speicher-, Daten - und Anwendungsvirtualisierung, Trading Resiliency, Trading Mobility und Thin Client. Die Lösung für die komplexen Anforderungen der Handelsplattform der nächsten Generation muss mit einer ganzheitlichen Denkweise aufgebaut werden, die die Grenzen der traditionellen Silos wie Business und Technologie oder Anwendungen und Vernetzung überquert. Ziel dieses Hauptziels ist es, Leitlinien für den Aufbau einer Handelsplattform mit extrem niedriger Latenz zu schaffen und gleichzeitig den Rohdurchsatz und die Nachrichtenrate für Marktdaten und FIX-Handelsaufträge zu optimieren. Um dies zu erreichen, schlagen wir die folgenden Latenz-Reduktionstechnologien vor: High-Speed-InterconneconInfiniBand oder 10 Gbit / s Konnektivität für den Trading-Cluster High-Speed-Messaging-Bus Anwendungsbeschleunigung über RDMA ohne Applikations-Re-Code Echtzeit-Latenzüberwachung und Re-Richtung von Trading Traffic auf den Pfad mit minimaler Latenz Branchentrends und Herausforderungen Die nächsten Architekturarchitekturen der nächsten Generation müssen auf erhöhte Anforderungen an Geschwindigkeit, Volumen und Effizienz reagieren. Zum Beispiel wird erwartet, dass das Volumen der Optionen Marktdaten nach der Einführung von Optionen Penny Handel im Jahr 2007 verdoppeln wird. Es gibt auch regulatorische Anforderungen für die beste Ausführung, die Handling Preis-Updates mit Raten, die 1M msgsec Ansatz erfordern. Für den Austausch. Sie verlangen auch die Einsicht in die Frische der Daten und den Nachweis, dass der Kunde die bestmögliche Ausführung erhalten hat. Kurzfristig sind die Handels - und Innovationsgeschwindigkeiten wichtige Unterscheidungsmerkmale. Eine zunehmende Anzahl von Trades wird durch algorithmische Trading-Anwendungen behandelt, die so nah wie möglich an den Trade Execution Veranstaltungsort platziert werden. Eine Herausforderung mit diesen quotblack-boxquot Trading-Engines ist, dass sie die Volumenerhöhung durch die Ausgabe von Aufträgen nur, um sie zu stornieren und re-submit sie. Die Ursache für dieses Verhalten ist der Mangel an Sichtbarkeit, in welchen Veranstaltungsort die beste Ausführung bietet. Der menschliche Trader ist jetzt ein quotfinancial Ingenieur, ein quotquantquot (quantitative Analytiker) mit Programmierkenntnissen, die Handelsmodelle on-the-fly anpassen können. Unternehmen entwickeln neue Finanzinstrumente wie Wetterderivate oder Cross-Asset-Class-Trades und müssen die neuen Applikationen schnell und skalierbar einsetzen. Auf lange Sicht sollte die wettbewerbsorientierte Differenzierung aus der Analyse kommen, nicht nur Wissen. Die Star-Trader von morgen übernehmen das Risiko, erwerben wahre Klienteneinsicht und konsequent schlagen den Markt (Quelle IBM: www-935.ibmservicesusimcpdfge510-6270-trader. pdf). Die wirtschaftliche Resilienz ist seit dem 11. September 2001 ein wichtiges Anliegen der Handelsfirmen. Die Lösungen in diesem Bereich reichen von redundanten Rechenzentren, die sich in verschiedenen Geografien befinden und mit mehreren Handelsplätzen verbunden sind, um virtuelle Trader-Lösungen anzubieten, die den Krafthändlern die meisten Funktionalitäten eines Trading-Bodens bieten An einem abgelegenen standort Die Finanzdienstleistungsbranche ist eine der anspruchsvollsten IT-Anforderungen. Die Branche erlebt eine architektonische Verschiebung hin zu Services-Oriented Architecture (SOA), Web Services und Virtualisierung von IT-Ressourcen. SOA nutzt die Erhöhung der Netzwerkgeschwindigkeit, um eine dynamische Bindung und Virtualisierung von Softwarekomponenten zu ermöglichen. Dies ermöglicht die Schaffung neuer Anwendungen, ohne die Investition in bestehende Systeme und Infrastrukturen zu verlieren. Das Konzept hat das Potenzial, den Weg der Integration zu revolutionieren, was eine deutliche Reduzierung der Komplexität und Kosten einer solchen Integration ermöglicht (GigaspacesdownloadMerrilLynchGigaSpacesWP. pdf). Ein weiterer Trend ist die Konsolidierung von Servern in Rechenzentrums-Serverfarmen, während Trader-Tische nur KVM-Erweiterungen und ultradünne Clients (z. B. SunRay - und HP-Blade-Lösungen) haben. Hochgeschwindigkeits-Metro-Area-Netzwerke ermöglichen es, dass Marktdaten Multicast zwischen verschiedenen Standorten sind und die Virtualisierung des Trading-Bodens ermöglichen. High-Level-Architektur Abbildung 1 zeigt die hochrangige Architektur einer Handelsumgebung. Die Ticker-Anlage und die algorithmischen Handelsmotoren befinden sich im Hochleistungs-Handelscluster im Firmenrechenzentrum oder am Austausch. Die menschlichen Händler befinden sich im Bereich der Endbenutzeranwendungen. Funktionell gibt es zwei Anwendungskomponenten in der Unternehmenshandelsumgebung, Verlagen und Abonnenten. Der Messaging-Bus stellt den Kommunikationspfad zwischen Verlagen und Abonnenten zur Verfügung. Es gibt zwei Arten von Verkehrsspezifisch für ein Handelsumfeld: Market DataCarries Preisinformationen für Finanzinstrumente, Nachrichten und andere Wertschöpfungsinformationen wie Analytics. Es ist unidirektional und sehr latenzempfindlich, typischerweise über UDP Multicast geliefert. Es wird in updatessec gemessen. Und in Mbps. Die Marktdaten fließen von einem oder mehreren externen Futtermitteln, die von Marktdatenanbietern wie Börsen, Datenaggregatoren und ECNs stammen. Jeder Anbieter hat ein eigenes Marktdatenformat. Die Daten werden von Feed-Handlern, spezialisierten Anwendungen, die normalisieren und reinigen die Daten erhalten und dann senden sie an Datenverbraucher, wie z. B. Preis-Engines, algorithmische Trading-Anwendungen oder menschliche Händler. Sell-Side-Firmen senden auch die Marktdaten an ihre Kunden, Buy-Side-Firmen wie Investmentfonds, Hedgefonds und andere Vermögensverwalter. Einige Buy-Side-Firmen können sich entscheiden, direkte Feeds vom Austausch zu erhalten, wodurch die Latenz reduziert wird. Abbildung 1 Trading Architecture für ein Buy SideSell Side Firm Es gibt keinen Industriestandard für Marktdatenformate. Jeder Austausch hat sein eigenes Format. Finanzinvestoren wie Reuters und Bloomberg aggregieren verschiedene Quellen von Marktdaten, normalisieren sie und fügen Nachrichten oder Analysen hinzu. Beispiele für konsolidierte Futtermittel sind RDF (Reuters Data Feed), RWF (Reuters Wire Format) und Bloomberg Professional Services Data. Um niedrigere Latenz-Marktdaten zu liefern, haben beide Anbieter Echtzeit-Marktdaten-Feeds freigegeben, die weniger verarbeitet sind und weniger Analytik haben: Bloomberg B-PipeWith B-Pipe, Bloomberg entkoppelt ihren Marktdaten-Feed von ihrer Distributionsplattform, weil ein Bloomberg-Terminal Ist nicht erforderlich, um B-Pipe zu bekommen. Wombat und Reuters Feed Handler haben Unterstützung für B-Pipe angekündigt. Eine Firma kann beschließen, Feeds direkt von einer Börse zu erhalten, um die Latenz zu reduzieren. Die Übertragungsgeschwindigkeit kann zwischen 150 Millisekunden und 500 Millisekunden liegen. Diese Futter sind komplexer und teurer und die Firma muss ihre eigene Ticker-Anlage bauen und pflegen (FinancetechfeaturedshowArticle. jhtmlarticleID60404306). Trading OrdersDiese Art von Verkehr trägt die tatsächlichen Trades. Es ist bidirektional und sehr latenzempfindlich. Es wird in messagessec gemessen. Und Mbps. Die Aufträge stammen aus einer Kaufseite oder verkaufen Seitenfirma und werden an Handelsplätze wie eine Börse oder ECN zur Ausführung geschickt. Das häufigste Format für den Auftragstransport ist FIX (Financial Information eXchangefixprotocol. org). Die Anwendungen, die FIX-Nachrichten behandeln, heißen FIX-Engines und sie stellen sich mit Auftragsmanagementsystemen (OMS) zusammen. Eine Optimierung auf FIX heißt FAST (Fix Adapted for Streaming), die ein Komprimierungsschema verwendet, um die Nachrichtenlänge zu reduzieren und in der Tat die Latenz zu reduzieren. FAST zielt mehr auf die Bereitstellung von Marktdaten und hat das Potenzial, ein Standard zu werden. FAST kann auch als Komprimierungsschema für proprietäre Marktdatenformate verwendet werden. Um die Latenz zu reduzieren, können sich Unternehmen entscheiden, den Direktmarktzugang (DMA) zu etablieren. DMA ist der automatisierte Prozess der Weiterleitung eines Wertpapierauftrags direkt an einen Ausführungsort und damit die Intervention durch einen Drittanbieter (towergroupresearchcontentglossary. jsppage1ampglossaryId383). DMA erfordert eine direkte Verbindung zum Ausführungsort. Der Messaging-Bus ist Middleware-Software von Anbietern wie Tibco, 29West, Reuters RMDS oder eine Open-Source-Plattform wie AMQP. Der Messaging-Bus verwendet einen zuverlässigen Mechanismus, um Nachrichten zu liefern. Der Transport kann über TCPIP (TibcoEMS, 29West, RMDS und AMQP) oder UDPmulticast (TibcoRV, 29West und RMDS) erfolgen. Ein wichtiges Konzept in der Nachrichtenverteilung ist der quottopische Strom, der eine Untermenge von Marktdaten ist, die durch Kriterien wie Tickersymbol, Industrie oder einen bestimmten Korb von Finanzinstrumenten definiert sind. Abonnenten verbinden Themengruppen, die einem oder mehreren Unterthemen zugeordnet sind, um nur die relevanten Informationen zu erhalten. In der Vergangenheit erhielten alle Händler alle Marktdaten. Bei den laufenden Verkehrsmengen wäre das suboptimal. Das Netzwerk spielt eine wichtige Rolle im Handelsumfeld. Die Marktdaten werden in den Handelsteil getragen, wo sich die menschlichen Händler über ein Campus - oder Metro-Area-Hochgeschwindigkeitsnetz befinden. Hochverfügbarkeit und geringe Latenz sowie hoher Durchsatz sind die wichtigsten Kennzahlen. Die hochleistungsfähige Handelsumgebung hat die meisten Komponenten in der Data Center Serverfarm. Um die Latenz zu minimieren, müssen sich die algorithmischen Handelsmotoren in der Nähe der Futtermittel-Handler, FIX-Motoren und Auftragsmanagementsysteme befinden. Ein alternatives Bereitstellungsmodell hat die algorithmischen Handelssysteme, die sich an einer Börse oder einem Dienstanbieter befinden, mit einer schnellen Verbindung zu mehreren Börsen. Bereitstellungsmodelle Es gibt zwei Bereitstellungsmodelle für eine leistungsstarke Handelsplattform. Firmen können sich entscheiden, eine Mischung aus den beiden zu haben: Rechenzentrum des Handelsunternehmens (Abbildung 2) Dies ist das traditionelle Modell, in dem eine vollwertige Handelsplattform von der Firma entwickelt und gepflegt wird, mit Kommunikationsverbindungen zu allen Handelsplätzen. Latenz variiert mit der Geschwindigkeit der Links und die Anzahl der Hops zwischen der Firma und den Veranstaltungsorten. Abbildung 2 Traditionelles Deployment Model Co-Standort am Handelsplatz (Börsen, Finanzdienstleister (FSP)) (Abbildung 3) Das Handelsunternehmen setzt seine automatisierte Handelsplattform so nah wie möglich an die Ausführungsorte ein, um die Latenz zu minimieren. Abbildung 3 Hosted Deployment Model Services-orientierte Trading-Architektur Wir schlagen ein dienstleistungsorientiertes Framework für den Aufbau der Handelsarchitektur der nächsten Generation vor. Dieser Ansatz bietet einen konzeptionellen Rahmen und einen Implementierungspfad, der auf Modularisierung und Minimierung von Inter-Abhängigkeiten basiert. Dieses Framework bietet Unternehmen eine Methodik an: Auswertung ihres aktuellen Standes in Bezug auf Dienstleistungen Priorisierung von Dienstleistungen auf der Grundlage ihres Wertes für das Unternehmen Entwicklung der Handelsplattform in den gewünschten Zustand mit Hilfe eines modularen Ansatzes Die Hochleistungshandelsarchitektur beruht auf folgenden Dienstleistungen: Definiert durch das in Abbildung 4 dargestellte Dienstleistungsarchitektur-Framework. Abbildung 4 Service-Architektur-Framework für Hochleistungs-Trading Ultra-Low Latency Messaging Service Dieser Service wird von dem Messaging-Bus bereitgestellt, der ein Software-System ist, das das Problem der Verbindung von vielen zu - Viele Anwendungen. Das System besteht aus: Ein Satz von vordefinierten Meldungsschemata Ein Satz von gemeinsamen Befehlsnachrichten Eine gemeinsame Anwendungsinfrastruktur zum Senden der Nachrichten an Empfänger. Die gemeinsame Infrastruktur kann auf einem Message Broker oder einem Publishsubscribe-Modell basieren. Die Schlüsselanforderungen für den Nachrichtenbus der nächsten Generation sind (Quelle 29West): Niedrigste Latenzzeit (zB weniger als 100 Mikrosekunden) Stabilität unter schwerer Belastung (zB mehr als 1,4 Millionen Milliarden) Kontrolle und Flexibilität (Ratensteuerung und konfigurierbare Transporte) Sind Bemühungen in der Industrie, den Messaging-Bus zu standardisieren. Advanced Message Queuing Protocol (AMQP) ist ein Beispiel für einen offenen Standard, der von J. P. Morgan Chase unterstützt wird und von einer Gruppe von Anbietern wie Cisco, Envoy Technologies, Red Hat, TWIST Process Innovations, Iona, 29West und iMatix unterstützt wird. Zwei der Hauptziele sind es, einen einfacheren Weg zur Interoperabilität für Anwendungen zu schaffen, die auf verschiedenen Plattformen und Modularität geschrieben sind, so dass die Middleware leicht weiterentwickelt werden kann. In sehr allgemeiner Hinsicht ist ein AMQP-Server analog zu einem E-Mail-Server, wobei jeder Austausch als Nachrichtenübertragungsagent und jede Nachrichtenwarteschlange als Postfach fungiert. Die Bindungen definieren die Routingtabellen in jedem Transferagent. Verleger senden Nachrichten an einzelne Übertragungsagenten, die dann die Nachrichten in Postfächer vermitteln. Die Konsumenten nehmen Nachrichten aus Postfächern, die ein leistungsfähiges und flexibles Modell schaffen, das einfach ist (Quelle: amqp. orgtikiwikitiki-index. phppageOpenApproachWhyAMQP). Latency Monitoring Service Die wichtigsten Voraussetzungen für diesen Service sind: Sub-Millisekunden-Granularität von Messungen Near-Echtzeit-Sichtbarkeit ohne Hinzufügen von Latenz auf den Trading-Verkehr Fähigkeit, die Latenz der Applikationsverarbeitung von der Netzwerk-Transit-Latenz zu unterscheiden. Fähigkeit, hohe Nachrichtenraten zu verarbeiten Geben Sie eine programmatische Schnittstelle für Trading-Anwendungen, um Latenzdaten zu empfangen, so dass algorithmische Trading-Engines an sich ändernde Bedingungen angepasst werden können. Verknüpfen von Netzwerkereignissen mit Anwendungsereignissen für Fehlerbehebungszwecke Latenzzeit kann als das Zeitintervall definiert werden, wenn ein Handelsauftrag gesendet wird und wenn die gleiche Reihenfolge quittiert und gehandelt wird Von der empfangenden Partei Die Ansprache der Latenzfrage ist ein komplexes Problem, das einen ganzheitlichen Ansatz erfordert, der alle Latenzquellen identifiziert und unterschiedliche Technologien auf verschiedenen Schichten des Systems anwendet. Abbildung 5 zeigt die Vielfalt der Komponenten, die Latenz auf jeder Schicht des OSI-Stacks einführen können. Es gibt auch jede Latenzquelle mit einer möglichen Lösung und einer Überwachungslösung ab. Dieser geschichtete Ansatz kann Unternehmen eine strukturierte Art, die Latenzfrage anzugreifen, wobei jede Komponente als Dienstleistung gedacht und konsequent über die Firma behandelt werden kann. Die Aufrechterhaltung einer genauen Messung des dynamischen Zustands dieses Zeitintervalls über alternative Routen und Ziele kann bei taktischen Handelsentscheidungen von großer Unterstützung sein. Die Fähigkeit, den genauen Standort der Verzögerungen zu identifizieren, sei es im Kundenrandnetzwerk, im zentralen Bearbeitungszentrum oder auf der Transaktionsanwendungsebene, bestimmt die Fähigkeit von Dienstanbietern, ihre Handelsdienstleistungsverträge (SLAs) zu erfüllen. Für kauf - und verkaufsseitige Formulare sowie für Marktdaten-Syndikatoren führt die schnelle Identifikation und Beseitigung von Engpässen direkt zu verbesserten Handelsmöglichkeiten und Umsatz. Abbildung 5 Latenzmanagement-Architektur Cisco Low-Latency Monitoring Tools Traditionelle Netzwerk-Monitoring-Tools arbeiten mit Minuten oder Sekunden Granularität. Die nächsten Plattformen der nächsten Generation, vor allem jene, die den algorithmischen Handel unterstützen, erfordern Latenzen weniger als 5 ms und extrem niedrige Pufferverluste. Auf einem Gigabit-LAN ​​kann ein 100 ms microburst 10.000 Transaktionen verloren gehen oder übermäßig verzögert werden. Cisco bietet seinen Kunden eine Auswahl an Tools zur Messung der Latenz in einer Handelsumgebung: Bandbreite Qualitätsmanager (BQM) (OEM von Corvil) Cisco AON-basierte Financial Services Latency Monitoring Solution (FSMS) Bandwidth Quality Manager Bandwidth Quality Manager (BQM) 4.0 ist Ein Netzwerk-Netzwerk-Performance-Management-Produkt der nächsten Generation, das es Kunden ermöglicht, ihr Netzwerk für kontrollierte Latenz - und Verlustleistung zu überwachen und bereitzustellen. Während BQM nicht ausschließlich auf Trading-Netzwerke ausgerichtet ist, ist die Mikrosekunden-Sichtbarkeit mit intelligenten Bandbreiten-Provisioning-Funktionen ideal für diese anspruchsvollen Umgebungen geeignet. Cisco BQM 4.0 implementiert eine breite Palette von patentierten und zum Patent angemeldete Verkehrsmessung und Netzwerkanalysetechnologien, die dem Anwender eine noch nie dagewesene Sichtbarkeit vermitteln und verstehen, wie das Netzwerk für maximale Anwendungsleistung optimiert werden kann. Cisco BQM wird nun auf der Produktfamilie der Cisco Application Deployment Engine (ADE) unterstützt. Die Cisco ADE Produktfamilie ist die Plattform für Cisco Network Management Anwendungen. BQM Vorteile Cisco BQM Mikro-Sichtbarkeit ist die Fähigkeit zu erkennen, zu messen und zu analysieren Latenz, Jitter und Verlust induzieren Verkehrsereignisse bis hin zu Mikrosekunden Ebenen der Granularität mit pro Paketauflösung. Dies ermöglicht es Cisco BQM, die Auswirkungen von Verkehrsereignissen auf Netzwerklatenz, Jitter und Verlust zu erkennen und zu bestimmen. Kritisch für Handelsumgebungen ist, dass BQM Latenz-, Verlust - und Jittermessungen einsetzen kann, sowohl für TCP - als auch für UDP-Multicast-Verkehr. Dies bedeutet, dass es sowohl für den Handelsverkehr als auch für den Marktdaten-Feeds nahtlos berichtet. BQM ermöglicht es dem Benutzer, auf allen Schnittstellen einen umfassenden Satz von Schwellenwerten (gegen Microburst-Aktivität, Latenz, Verlust, Jitter, Nutzung etc.) festzulegen. BQM betreibt dann eine Hintergrundrollenpaketaufnahme. Immer wenn eine Schwellenverletzung oder ein anderes potentielles Leistungsverschlechterungsereignis auftritt, löst es Cisco BQM aus, die Paketaufnahme auf Festplatte für eine spätere Analyse zu speichern. Dies ermöglicht es dem Benutzer, den Anwendungsverkehr, der von der Leistungsverschlechterung betroffen war, zu untersuchen (quotthe victimsquot) und den Verkehr, der die Leistungsverschlechterung verursacht hat (quotthe culpritsquot). Dies kann den Zeitaufwand für die Diagnose und die Behebung von Netzwerkleistungsproblemen erheblich reduzieren. BQM ist auch in der Lage, detaillierte Bandbreite und Quality of Service (QoS) Richtlinienbereitstellungsempfehlungen zur Verfügung zu stellen, die der Benutzer direkt anwenden kann, um die gewünschte Netzwerkleistung zu erreichen. BQM-Messungen Illustriert Um den Unterschied zwischen einigen der herkömmlicheren Messtechniken und der Sichtbarkeit von BQM zu verstehen, können wir einige Vergleichsgraphen anschauen. In dem ersten Satz von Graphen (Abbildung 6 und Abbildung 7) sehen wir den Unterschied zwischen der Latenz, gemessen durch den BQMs Passive Network Quality Monitor (PNQM) und die Latenz, gemessen durch Einspritzen von Ping-Pakete alle 1 Sekunde in den Verkehrsstrom. In Abbildung 6 sehen wir die Latenz, die von 1-Sekunden-ICMP-Ping-Paketen für einen echten Netzwerkverkehr gemeldet wird (es wird durch 2 geteilt, um eine Schätzung für die Einwegverzögerung zu geben). Es zeigt die Verzögerung bequem unter etwa 5ms für fast die ganze Zeit. Abbildung 6 Latenz, die von 1-Sekunden-ICMP-Ping-Paketen für realen Netzwerkverkehr gemeldet wird In Abbildung 7. sehen wir die Latenz, die von PNQM für denselben Verkehr zur gleichen Zeit gemeldet wird. Hier sehen wir, dass wir durch die Messung der Einweg-Latenz der eigentlichen Applikationspakete ein radikal anderes Bild bekommen. Hier ist die Latenz zu sehen, um etwa 20 ms zu schweben, mit gelegentlichen Bursts weit höher. Die Erklärung ist, dass, weil Ping sendet Pakete nur jede Sekunde, es ist völlig fehlt die meisten der Anwendung Traffic Latenz. In der Tat, Ping-Ergebnisse zeigen in der Regel nur Runde Reise Ausbreitung Verspätung statt realistische Anwendung Latenz über das Netzwerk. Abbildung 7 Latenz, die von PNQM für Real Network Traffic gemeldet wird Im zweiten Beispiel (Abbildung 8) sehen wir den Unterschied in den gemeldeten Link-Load - oder Sättigungsniveaus zwischen einer 5-Minuten-Durchschnittsansicht und einer 5-ms-Microburst-Sicht (BQM kann auf Microbursts berichten Bis etwa 10-100 Nanosekunden Genauigkeit). Die grüne Linie zeigt die durchschnittliche Auslastung bei 5-minütigen Mitteln, um niedrig zu sein, vielleicht bis zu 5 Mbitss. Die dunkelblaue Handlung zeigt die 5ms-Mikroburst-Aktivität zwischen 75 Mbitss und 100 Mbitss, die LAN-Geschwindigkeit effektiv. BQM zeigt diese Ebene der Granularität für alle Anwendungen und es gibt auch klare Bereitstellungsregeln, damit der Benutzer diese Mikrobursts kontrollieren oder neutralisieren kann. Abbildung 8 Unterschied in der gemeldeten Link-Last zwischen einer 5-Minuten-Durchschnittsansicht und einer 5-ms-Microburst-Ansicht BQM-Bereitstellung im Handelsnetz Abbildung 9 zeigt eine typische BQM-Bereitstellung in einem Handelsnetzwerk. Abbildung 9 Typische BQM-Bereitstellung in einem Trading-Netzwerk BQM kann dann verwendet werden, um diese Art von Fragen zu beantworten: Sind irgendwelche meiner Gigabit-LAN-Core-Links für mehr als X Millisekunden gesättigt Ist dies Verluste verursachen Welche Links würden am meisten von einem Upgrade auf Etherchannel oder profitieren 10 Gigabit-Geschwindigkeiten Welcher Anwendungsverkehr verursacht die Sättigung meiner 1 Gigabit-Links Ist eine der Marktdaten, die einen End-to-End-Verlust erleiden. Wie viel zusätzliche Latenzzeit macht das Failover-Rechenzentrumserlebnis, ist dieser Link korrekt, um mit Microbursts umzugehen. Sind meine Händler Immer geringe Latenz-Updates von der Marktdatenverteilungsschicht Wenn sie irgendwelche Verzögerungen größer als X Millisekunden sehen können, können diese Fragen einfach und effektiv Zeit und Geld beim Laufen des Handelsnetzes sparen. BQM ist ein wesentliches Instrument, um Markt - und Handelsumgebungen sichtbar zu machen. Es bietet körnige End-to-End-Latenzmessungen in komplexen Infrastrukturen, die eine hochvolumige Datenbewegung erfahren. Die effektive Erkennung von Mikrobursts in Sub-Millisekunden-Ebenen und die Erfassung von Expertenanalysen zu einem bestimmten Ereignis ist für den Handel von Bodenarchitekten von unschätzbarem Wert. Smart-Bandbreiten-Bereitstellungsempfehlungen, wie z. B. Dimensionierung und What-If-Analyse, bieten eine größere Agilität, um auf volatile Marktbedingungen zu reagieren. Da die Explosion des algorithmischen Handels und der zunehmenden Nachrichtenraten fortgesetzt wird, bietet BQM, kombiniert mit seinem QoS-Tool, die Möglichkeit, QoS-Richtlinien zu implementieren, die kritische Handelsanwendungen schützen können. Cisco Financial Services Latency Monitoring Solution Cisco und Trading Metrics haben auf Latency Monitoring Lösungen für FIX Auftragsfluss und Marktdatenüberwachung zusammengearbeitet. Die Cisco AON-Technologie ist die Basis für eine neue Klasse von Netzwerk-Embedded-Produkten und - Lösungen, die intelligente Netzwerke mit der Anwendungsinfrastruktur zusammenführen, basierend auf serviceorientierten oder traditionellen Architekturen. Trading Metrics ist ein führender Anbieter von Analytics-Software für Netzwerk-Infrastruktur und Application Latency Monitoring-Zwecke (tradingmetrics). Die Cisco AON Financial Services Latency Monitoring Solution (FSMS) korrelierte zwei Arten von Ereignissen an der Beobachtungsstelle: Netzwerkereignisse korrelierten direkt mit einer übereinstimmenden Applikationsmeldung im Handling Trade Order Flow und passende Marktaktualisierungsereignisse Mit Zeitstempeln, die am Erfassungspunkt in der Netzwerk, Echtzeit-Analyse dieser korrelierten Datenströme ermöglicht eine genaue Identifizierung von Engpässen über die Infrastruktur, während ein Handel durchgeführt wird oder Marktdaten verteilt werden. Durch die Überwachung und Messung der Latenz früh im Zyklus können Finanzgesellschaften bessere Entscheidungen darüber treffen, welchen Netzwerkdienst und welcher Vermittler, Markt oder Gegenpartei für die Weiterleitung von Handelsaufträgen auswählen soll. Ebenso ermöglicht dieses Wissen einen effizienteren Zugang zu aktualisierten Marktdaten (Aktienkurse, Wirtschaftsnachrichten etc.), die eine wichtige Grundlage für die Einleitung, den Rückzug oder die Verfolgung von Marktchancen darstellen. Die Komponenten der Lösung sind: AON-Hardware in drei Formfaktoren: AON-Netzwerkmodul für Cisco 2600280037003800 Router AON Blade für die Cisco Catalyst 6500 Serie AON 8340 Appliance Trading Metrics Die MampA 2.0 Software, die die Überwachungs - und Alarmierungsanwendung bietet, zeigt Latenzdiagramme an Ein Armaturenbrett, und gibt Warnungen aus, wenn Verlangsamungen auftreten (tradingmetricsTMbrochure. pdf). Abbildung 10 AON-basierte FIX Latency Monitoring Cisco IP SLA Cisco IP SLA ist ein eingebettetes Netzwerk-Management-Tool in Cisco IOS, das es Routern und Switches ermöglicht, synthetische Verkehrsströme zu erzeugen, die für Latenz, Jitter, Paketverlust und andere Kriterien gemessen werden können (ciscogoipsla ). Zwei Schlüsselkonzepte sind die Quelle des erzeugten Verkehrs und des Ziels. Beide führen einen IP-SLA-Quotierer aus, der die Verantwortung hat, den Steuerungsverkehr zu verteilen, bevor er vom Ziel abgeholt und zurückgegeben wird (für eine Rundreisemessung). Verschiedene Verkehrstypen können innerhalb von IP SLA bezogen werden und sie sind auf unterschiedliche Metriken ausgerichtet und zielen auf unterschiedliche Dienste und Anwendungen ab. Die UDP-Jitter-Operation wird verwendet, um Einweg - und Rundlaufverzögerung zu messen und Variationen zu melden. Da der Verkehr auf Sende - und Zielgeräten mit Hilfe der Responder-Fähigkeit zeitgestempelt ist, ist die Umlaufverzögerung als Delta zwischen den beiden Zeitstempeln charakterisiert. Ein neues Feature wurde in IOS 12.3 (14) T, IP SLA Sub Millisecond Reporting eingeführt, mit dem Zeitstempel mit einer Auflösung in Mikrosekunden angezeigt werden können, so dass ein Niveau der bisher nicht vorhandenen Granularität zur Verfügung steht. Diese neue Funktion hat nun IP-SLA für Campus-Netzwerke relevant, wo die Netzwerklatenz typischerweise im Bereich von 300-800 Mikrosekunden liegt und die Fähigkeit, Trends und Spikes (kurze Trends) auf der Basis von Mikrosekunden-Granularitätszählern zu erkennen, ist eine Voraussetzung für die zeitlich bezahlten Kunden - sensitive elektronische Handelsumgebungen. Infolgedessen wird IP SLA jetzt von einer beträchtlichen Anzahl von Finanzorganisationen betrachtet, da sie alle mit Anforderungen konfrontiert sind: Berichtsbasislinien-Latenz zu ihren Benutzern Trend-Baseline-Latenz über die Zeit Reagieren Sie schnell auf Traffic-Bursts, die Änderungen in der gemeldeten Latenz verursachen Sub - Millisekunden-Reporting ist für diese Kunden notwendig, da viele Campus und Backbones derzeit unter einer Sekunde der Latenz über mehrere Switch-Hops liefern. Elektronische Handelsumgebungen haben in der Regel gearbeitet, um alle Bereiche der Geräte und Netzwerk-Latenz zu beseitigen oder zu minimieren, um eine schnelle Auftragsabwicklung für das Geschäft zu liefern. Die Berichterstattung, dass Netzwerk-Antwortzeiten unter einem Millisekunden liegen, reicht nicht mehr aus, dass die Granularität von Latenzmessungen, die über ein Netzwerksegment oder ein Backbone berichtet werden, näher an 300-800 Mikrosekunden mit einem Grad von Auflösung von 100 Jigrav Sekunden liegen muss. IP SLA hat vor kurzem Unterstützung für IP-Multicast-Testströme hinzugefügt, die die Marktdatenlatenz messen können. Eine typische Netzwerktopologie ist in Abbildung 11 mit den IP-SLA-Schatten-Routern, Quellen und Respondern dargestellt. Abbildung 11 IP SLA Deployment Computing Services Computing Services decken eine breite Palette von Technologien ab, mit dem Ziel, Speicher - und CPU-Engpässe zu eliminieren, die durch die Verarbeitung von Netzwerkpaketen entstehen. Trading-Anwendungen verbrauchen hohe Mengen an Marktdaten und die Server müssen Ressourcen für die Verarbeitung von Netzwerkverkehr statt der Verarbeitung von Anwendungen zu widmen. Transportverarbeitung Mit hohen Geschwindigkeiten kann die Netzwerkpaketverarbeitung eine beträchtliche Anzahl an Server-CPU-Zyklen und Speicher verbrauchen. Eine etablierte Faustregel besagt, dass 1 Gbit / s Netzwerkbandbreite 1 GHz Prozessorkapazität benötigt (Quelle Intel White Paper zur IO-Beschleunigung inteltechnologyioacceleration306517.pdf). Zwischenpuffer-KopierenIn einer konventionellen Netzwerk-Stack-Implementierung müssen Daten von der CPU zwischen Netzwerkpuffern und Applikationspuffern kopiert werden. Dieser Overhead wird durch die Tatsache verschlechtert, dass Speicher-Geschwindigkeiten nicht mit steigenden CPU-Geschwindigkeiten gehalten haben. Zum Beispiel, Prozessoren wie die Intel Xeon sind Annäherung an 4 GHz, während RAM-Chips schweben rund 400MHz (für DDR 3200 Speicher) (Quelle Intel inteltechnologyioacceleration306517.pdf). KontextumschaltungDie Zeit, in der ein einzelnes Paket verarbeitet werden muss, führt die CPU einen Kontextwechsel vom Anwendungskontext zum Netzwerkverkehrskontext. Dieser Overhead könnte reduziert werden, wenn der Switch nur dann auftreten würde, wenn der gesamte Applikationspuffer vollständig ist. Abbildung 12 Quellen von Overhead in Data Center Servern TCP Offload Engine (TOE) Entlastet Transportprozessor-Zyklen auf die NIC. Verschiebt TCPIP-Protokoll-Stack-Puffer-Kopien vom Systemspeicher zum NIC-Speicher. Remote Direct Memory Access (RDMA) Ermöglicht es einem Netzwerkadapter, Daten direkt von der Anwendung zur Anwendung zu übertragen, ohne das Betriebssystem einzubeziehen. Eliminiert Zwischen - und Anwendungspuffer-Kopien (Speicherbandbreitenverbrauch). Kernel-Bypass Direkter User-Level-Zugriff auf Hardware. Dramatisch reduziert Anwendungskontext-Schalter. Abbildung 13 RDMA und Kernel Bypass InfiniBand ist eine bidirektionale serielle Kommunikationsverbindung, die unter anderem RDMA implementiert. Cisco bietet einen InfiniBand Switch, den Server Fabric Switch (SFS): ciscoapplicationpdfenusguestnetsolns500c643cdccont0900aecd804c35cb. pdf. Abbildung 14 Typische SFS-Deployment-Trading-Anwendungen profitieren von der Verringerung der Latenz - und Latenzvariabilität, wie durch einen Test mit den Cisco SFS - und Wombat-Feed-Handlern von Stac Research gezeigt wird: Application Virtualization Service Entkoppeln der Applikation von der zugrunde liegenden OS - und Server-Hardware Ermöglicht es ihnen, als Netzwerkdienste zu laufen. Eine Anwendung kann parallel auf mehreren Servern ausgeführt werden, oder mehrere Anwendungen können auf demselben Server ausgeführt werden, da die beste Ressourcenzuordnung diktiert. Diese Entkopplung ermöglicht eine bessere Lastverteilung und Disaster Recovery für Business Continuity Strategien. Der Prozess der Neuzuordnung von Rechenressourcen zu einer Anwendung ist dynamisch. Mit einem Anwendungsvirtualisierungssystem wie Data Synapses GridServer können Anwendungen unter Verwendung von vorkonfigurierten Richtlinien auf unter-genutzte Server in einem Supply-Match-Demand-Prozess (wwwworkworldsupp2005ndc1022105virtual. htmlpage2) migrieren. Es gibt viele Geschäftsvorteile für Finanzfirmen, die die Anwendungsvirtualisierung annehmen: Schnellere Markteinführung für neue Produkte und Dienstleistungen Schnellere Integration von Firmen nach Fusions - und Akquisitionstätigkeit Erhöhte Anwendungsverfügbarkeit Bessere Workload-Distribution, die mehr Platz für die Verarbeitung von Spikes im Handelsvolumen bietet Effizienz und Kontrolle Reduzierung der IT-Komplexität Derzeit wird die Anwendungsvirtualisierung nicht im Handels-Front-Office eingesetzt. Ein Anwendungsfall ist die Risikomodellierung, wie Monte Carlo Simulationen. Wenn sich die Technologie weiterentwickelt, ist es denkbar, dass einige der Handelsplattformen sie annehmen werden. Daten-Virtualisierungs-Service Um Ressourcen in verteilten Unternehmensanwendungen effektiv zu teilen, müssen Unternehmen in der Lage sein, Daten über mehrere Quellen in Echtzeit zu nutzen und gleichzeitig die Datenintegrität zu gewährleisten. Mit Lösungen von Datenvirtualisierungssoftwareanbietern wie Edelstein oder Tangosol (jetzt Oracle) können Finanzunternehmen auf heterogene Datenquellen als ein einziges Systembild zugreifen, das die Konnektivität zwischen Geschäftsprozessen und den uneingeschränkten Anwendungszugriff auf verteiltes Caching ermöglicht. Das Ergebnis ist, dass alle Benutzer sofort Zugriff auf diese Datenressourcen über ein verteiltes Netzwerk haben (gridtoday030210101061.html). Dies wird als Datenraster bezeichnet und ist der erste Schritt bei der Erstellung dessen, was Gartner Extreme Transaction Processing (XTP) nennt (gartnerDisplayDocumentrefgsearchampid500947). Technologien wie Daten - und Anwendungsvirtualisierung ermöglichen es Finanzinstituten, komplexe Analysen in Echtzeit durchzuführen, ereignisgesteuerte Anwendungen und dynamische Ressourcenverteilung durchzuführen. One example of data virtualization in action is a global order book application. An order book is the repository of active orders that is published by the exchange or other market makers. A global order book aggregates orders from around the world from markets that operate independently. The biggest challenge for the application is scalability over WAN connectivity because it has to maintain state. Todays data grids are localized in data centers connected by Metro Area Networks (MAN). This is mainly because the applications themselves have limitsthey have been developed without the WAN in mind. Figure 15 GemStone GemFire Distributed Caching Before data virtualization, applications used database clustering for failover and scalability. This solution is limited by the performance of the underlying database. Failover is slower because the data is committed to disc. With data grids, the data which is part of the active state is cached in memory, which reduces drastically the failover time. Scaling the data grid means just adding more distributed resources, providing a more deterministic performance compared to a database cluster. Multicast Service Market data delivery is a perfect example of an application that needs to deliver the same data stream to hundreds and potentially thousands of end users. Market data services have been implemented with TCP or UDP broadcast as the network layer, but those implementations have limited scalability. Using TCP requires a separate socket and sliding window on the server for each recipient. UDP broadcast requires a separate copy of the stream for each destination subnet. Both of these methods exhaust the resources of the servers and the network. The server side must transmit and service each of the streams individually, which requires larger and larger server farms. On the network side, the required bandwidth for the application increases in a linear fashion. For example, to send a 1 Mbps stream to 1000recipients using TCP requires 1 Gbps of bandwidth. IP multicast is the only way to scale market data delivery. To deliver a 1 Mbps stream to 1000 recipients, IP multicast would require 1 Mbps. The stream can be delivered by as few as two serversone primary and one backup for redundancy. There are two main phases of market data delivery to the end user. In the first phase, the data stream must be brought from the exchange into the brokerages network. Typically the feeds are terminated in a data center on the customer premise. The feeds are then processed by a feed handler, which may normalize the data stream into a common format and then republish into the application messaging servers in the data center. The second phase involves injecting the data stream into the application messaging bus which feeds the core infrastructure of the trading applications. The large brokerage houses have thousands of applications that use the market data streams for various purposes, such as live trades, long term trending, arbitrage, etc. Many of these applications listen to the feeds and then republish their own analytical and derivative information. For example, a brokerage may compare the prices of CSCO to the option prices of CSCO on another exchange and then publish ratings which a different application may monitor to determine how much they are out of synchronization. Figure 16 Market Data Distribution Players The delivery of these data streams is typically over a reliable multicast transport protocol, traditionally Tibco Rendezvous. Tibco RV operates in a publish and subscribe environment. Each financial instrument is given a subject name, such as CSCO. last. Each application server can request the individual instruments of interest by their subject name and receive just a that subset of the information. This is called subject-based forwarding or filtering. Subject-based filtering is patented by Tibco. A distinction should be made between the first and second phases of market data delivery. The delivery of market data from the exchange to the brokerage is mostly a one-to-many application. The only exception to the unidirectional nature of market data may be retransmission requests, which are usually sent using unicast. The trading applications, however, are definitely many-to-many applications and may interact with the exchanges to place orders. Figure 17 Market Data Architecture Design Issues Number of GroupsChannels to Use Many application developers consider using thousand of multicast groups to give them the ability to divide up products or instruments into small buckets. Normally these applications send many small messages as part of their information bus. Usually several messages are sent in each packet that are received by many users. Sending fewer messages in each packet increases the overhead necessary for each message. In the extreme case, sending only one message in each packet quickly reaches the point of diminishing returnsthere is more overhead sent than actual data. Application developers must find a reasonable compromise between the number of groups and breaking up their products into logical buckets. Consider, for example, the Nasdaq Quotation Dissemination Service (NQDS). The instruments are broken up alphabetically: This approach allows for straight forward networkapplication management, but does not necessarily allow for optimized bandwidth utilization for most users. A user of NQDS that is interested in technology stocks, and would like to subscribe to just CSCO and INTL, would have to pull down all the data for the first two groups of NQDS. Understanding the way users pull down the data and then organize it into appropriate logical groups optimizes the bandwidth for each user. In many market data applications, optimizing the data organization would be of limited value. Typically customers bring in all data into a few machines and filter the instruments. Using more groups is just more overhead for the stack and does not help the customers conserve bandwidth. Another approach might be to keep the groups down to a minimum level and use UDP port numbers to further differentiate if necessary. The other extreme would be to use just one multicast group for the entire application and then have the end user filter the data. In some situations this may be sufficient. Intermittent Sources A common issue with market data applications are servers that send data to a multicast group and then go silent for more than 3.5 minutes. These intermittent sources may cause trashing of state on the network and can introduce packet loss during the window of time when soft state and then hardware shorts are being created. PIM-Bidir or PIM-SSM The first and best solution for intermittent sources is to use PIM-Bidir for many-to-many applications and PIM-SSM for one-to-many applications. Both of these optimizations of the PIM protocol do not have any data-driven events in creating forwarding state. That means that as long as the receivers are subscribed to the streams, the network has the forwarding state created in the hardware switching path. Intermittent sources are not an issue with PIM-Bidir and PIM-SSM. Null Packets In PIM-SM environments a common method to make sure forwarding state is created is to send a burst of null packets to the multicast group before the actual data stream. The application must efficiently ignore these null data packets to ensure it does not affect performance. The sources must only send the burst of packets if they have been silent for more than 3 minutes. A good practice is to send the burst if the source is silent for more than a minute. Many financials send out an initial burst of traffic in the morning and then all well-behaved sources do not have problems. Periodic Keepalives or Heartbeats An alternative approach for PIM-SM environments is for sources to send periodic heartbeat messages to the multicast groups. This is a similar approach to the null packets, but the packets can be sent on a regular timer so that the forwarding state never expires. S, G Expiry Timer Finally, Cisco has made a modification to the operation of the S, G expiry timer in IOS. There is now a CLI knob to allow the state for a S, G to stay alive for hours without any traffic being sent. The (S, G) expiry timer is configurable. This approach should be considered a workaround until PIM-Bidir or PIM-SSM is deployed or the application is fixed. RTCP Feedback A common issue with real time voice and video applications that use RTP is the use of RTCP feedback traffic. Unnecessary use of the feedback option can create excessive multicast state in the network. If the RTCP traffic is not required by the application it should be avoided. Fast Producers and Slow Consumers Today many servers providing market data are attached at Gigabit speeds, while the receivers are attached at different speeds, usually 100Mbps. This creates the potential for receivers to drop packets and request re-transmissions, which creates more traffic that the slowest consumers cannot handle, continuing the vicious circle. The solution needs to be some type of access control in the application that limits the amount of data that one host can request. QoS and other network functions can mitigate the problem, but ultimately the subscriptions need to be managed in the application. Tibco Heartbeats TibcoRV has had the ability to use IP multicast for the heartbeat between the TICs for many years. However, there are some brokerage houses that are still using very old versions of TibcoRV that use UDP broadcast support for the resiliency. This limitation is often cited as a reason to maintain a Layer 2 infrastructure between TICs located in different data centers. These older versions of TibcoRV should be phased out in favor of the IP multicast supported versions. Multicast Forwarding Options PIM Sparse Mode The standard IP multicast forwarding protocol used today for market data delivery is PIM Sparse Mode. It is supported on all Cisco routers and switches and is well understood. PIM-SM can be used in all the network components from the exchange, FSP, and brokerage. There are, however, some long-standing issues and unnecessary complexity associated with a PIM-SM deployment that could be avoided by using PIM-Bidir and PIM-SSM. These are covered in the next sections. The main components of the PIM-SM implementation are: PIM Sparse Mode v2 Shared Tree (spt-threshold infinity) A design option in the brokerage or in the exchange. sirengus nam, ar i darb eigoje, danai mintys pradeda suktis apie kiemo aplink. Keletas landafto architekts patarim kaip aplink susiplanuoti patiems. Prie pradedant galvoti apie glynus arba alpinariumus, svarbiausia yra pirmi ingsniai tai funkcinis teritorijos planavimas. Nesuskirsius teritorijos tinkamas zonas, augalai pasodinami ten, kur j visai nereikia, ar iltnamis pastatomas toje vietoje, kur jis Skaityti daugiau. Tel. 370 608 16327 El. p. Infoskraidantikamera. lt Interneto svetain: skraidantikamera. lt Socialiniai tinklai: facebook paskyra Apraymas: Filmuojame 8211 fotografuojame i 70 8211 100 metr aukio naudojant dron. Sukuriame HD raikos nuotraukas ir video siuetus. Silome pasli, sod, mik, medelyn apiros nuotraukas i aukio. Daugiau ms darb pavyzdi rasite interneto Skaityti daugiau. Profisionalios technins, sodo arnos (gera kaina) PVC laistymo arnos: PVC, dviej sluoksni laistymo arna, sutvirtinta tinkleliu i poliesterio sil atspari ultravioletiniams spinduliams kokybs sertifikatas spalva alia 58 skersmens, 16 mm, 8211 kaina 0.90 Ltm 34 skersmens, 19 mm. 8211 kaina 1.20 Ltm 1 col. Skersmens, 25 mm, 8211 kaina 2.30 Ltm Profesionalios PVC auktos kokybs Skaityti daugiau. The LMAX Architecture Over the last few years we keep hearing that the free lunch is over1 - we cant expect increases in individual CPU speed. So to write fast code we need to explicitly use multiple processors with concurrent software. This is not good news - writing concurrent code is very hard. Locks and semaphores are hard to reason about and hard to test - meaning we are spending more time worrying about satisfying the computer than we are solving the domain problem. Various concurrency models, such as Actors and Software Transactional Memory, aim to make this easier - but there is still a burden that introduces bugs and complexity. So I was fascinated to hear about a talk at QCon London in March last year from LMAX. LMAX is a new retail financial trading platform. Its business innovation is that it is a retail platform - allowing anyone to trade in a range of financial derivative products2. A trading platform like this needs very low latency - trades have to be processed quickly because the market is moving rapidly. A retail platform adds complexity because it has to do this for lots of people. So the result is more users, with lots of trades, all of which need to be processed quickly.3 Given the shift to multi-core thinking, this kind of demanding performance would naturally suggest an explicitly concurrent programming model - and indeed this was their starting point. But the thing that got peoples attention at QCon was that this wasnt where they ended up. In fact they ended up by doing all the business logic for their platform: all trades, from all customers, in all markets - on a single thread. A thread that will process 6 million orders per second using commodity hardware.4 Processing lots of transactions with low-latency and none of the complexities of concurrent code - how can I resist digging into that Fortunately another difference LMAX has to other financial companies is that they are quite happy to talk about their technological decisions. So now LMAX has been in production for a while its time to explore their fascinating design. Overall Structure Figure 1: LMAXs architecture in three blobs At a top level, the architecture has three parts business logic processor5 input disruptor output disruptors As its name implies, the business logic processor handles all the business logic in the application. As I indicated above, it does this as a single-threaded java program which reacts to method calls and produces output events. Consequently its a simple java program that doesnt require any platform frameworks to run other than the JVM itself, which allows it to be easily run in test environments. Although the Business Logic Processor can run in a simple environment for testing, there is rather more involved choreography to get it to run in a production setting. Input messages need to be taken off a network gateway and unmarshaled, replicated and journaled. Output messages need to be marshaled for the network. These tasks are handled by the input and output disruptors. Unlike the Business Logic Processor, these are concurrent components, since they involve IO operations which are both slow and independent. They were designed and built especially for LMAX, but they (like the overall architecture) are applicable elsewhere. Business Logic Processor Keeping it all in memory The Business Logic Processor takes input messages sequentially (in the form of a method invocation), runs business logic on it, and emits output events. It operates entirely in-memory, there is no database or other persistent store. Keeping all data in-memory has two important benefits. Firstly its fast - theres no database to provide slow IO to access, nor is there any transactional behavior to execute since all the processing is done sequentially. The second advantage is that it simplifies programming - theres no objectrelational mapping to do. All the code can be written using Javas object model without having to make any compromises for the mapping to a database. Using an in-memory structure has an important consequence - what happens if everything crashes Even the most resilient systems are vulnerable to someone pulling the power. The heart of dealing with this is Event Sourcing - which means that the current state of the Business Logic Processor is entirely derivable by processing the input events. As long as the input event stream is kept in a durable store (which is one of the jobs of the input disruptor) you can always recreate the current state of the business logic engine by replaying the events. A good way to understand this is to think of a version control system. Version control systems are a sequence of commits, at any time you can build a working copy by applying those commits. VCSs are more complicated than the Business Logic Processor because they must support branching, while the Business Logic Processor is a simple sequence. So, in theory, you can always rebuild the state of the Business Logic Processor by reprocessing all the events. In practice, however, that would take too long should you need to spin one up. So, just as with version control systems, LMAX can make snapshots of the Business Logic Processor state and restore from the snapshots. They take a snapshot every night during periods of low activity. Restarting the Business Logic Processor is fast, a full restart - including restarting the JVM, loading a recent snapshot, and replaying a days worth of journals - takes less than a minute. Snapshots make starting up a new Business Logic Processor faster, but not quickly enough should a Business Logic Processor crash at 2pm. As a result LMAX keeps multiple Business Logic Processors running all the time6. Each input event is processed by multiple processors, but all but one processor has its output ignored. Should the live processor fail, the system switches to another one. This ability to handle fail-over is another benefit of using Event Sourcing. By event sourcing into replicas they can switch between processors in a matter of micro-seconds. As well as taking snapshots every night, they also restart the Business Logic Processors every night. The replication allows them to do this with no downtime, so they continue to process trades 247. For more background on Event Sourcing, see the draft pattern on my site from a few years ago. The article is more focused on handling temporal relationships rather than the benefits that LMAX use, but it does explain the core idea. Event Sourcing is valuable because it allows the processor to run entirely in-memory, but it has another considerable advantage for diagnostics. If some unexpected behavior occurs, the team copies the sequence of events to their development environment and replays them there. This allows them to examine what happened much more easily than is possible in most environments. This diagnostic capability extends to business diagnostics. There are some business tasks, such as in risk management, that require significant computation that isnt needed for processing orders. An example is getting a list of the top 20 customers by risk profile based on their current trading positions. The team handles this by spinning up a replicate domain model and carrying out the computation there, where it wont interfere with the core order processing. These analysis domain models can have variant data models, keep different data sets in memory, and run on different machines. Tuning performance So far Ive explained that the key to the speed of the Business Logic Processor is doing everything sequentially, in-memory. Just doing this (and nothing really stupid) allows developers to write code that can process 10K TPS7. They then found that concentrating on the simple elements of good code could bring this up into the 100K TPS range. This just needs well-factored code and small methods - essentially this allows Hotspot to do a better job of optimizing and for CPUs to be more efficient in caching the code as its running. It took a bit more cleverness to go up another order of magnitude. There are several things that the LMAX team found helpful to get there. One was to write custom implementations of the java collections that were designed to be cache-friendly and careful with garbage8. An example of this is using primitive java longs as hashmap keys with a specially written array backed Map implementation ( LongToObjectHashMap ). In general theyve found that choice of data structures often makes a big difference, Most programmers just grab whatever List they used last time rather than thinking which implementation is the right one for this context.9 Another technique to reach that top level of performance is putting attention into performance testing. Ive long noticed that people talk a lot about techniques to improve performance, but the one thing that really makes a difference is to test it. Even good programmers are very good at constructing performance arguments that end up being wrong, so the best programmers prefer profilers and test cases to speculation.10 The LMAX team has also found that writing tests first is a very effective discipline for performance tests. Programming Model This style of processing does introduce some constraints into the way you write and organize the business logic. The first of these is that you have to tease out any interaction with external services. An external service call is going to be slow, and with a single thread will halt the entire order processing machine. As a result you cant make calls to external services within the business logic. Instead you need to finish that interaction with an output event, and wait for another input event to pick it back up again. Ill use a simple non-LMAX example to illustrate. Imagine you are making an order for jelly beans by credit card. A simple retailing system would take your order information, use a credit card validation service to check your credit card number, and then confirm your order - all within a single operation. The thread processing your order would block while waiting for the credit card to be checked, but that block wouldnt be very long for the user, and the server can always run another thread on the processor while its waiting. In the LMAX architecture, you would split this operation into two. The first operation would capture the order information and finish by outputting an event (credit card validation requested) to the credit card company. The Business Logic Processor would then carry on processing events for other customers until it received a credit-card-validated event in its input event stream. On processing that event it would carry out the confirmation tasks for that order. Working in this kind of event-driven, asynchronous style, is somewhat unusual - although using asynchrony to improve the responsiveness of an application is a familiar technique. It also helps the business process be more resilient, as you have to be more explicit in thinking about the different things that can happen with the remote application. A second feature of the programming model lies in error handling. The traditional model of sessions and database transactions provides a helpful error handling capability. Should anything go wrong, its easy to throw away everything that happened so far in the interaction. Session data is transient, and can be discarded, at the cost of some irritation to the user if in the middle of something complicated. If an error occurs on the database side you can rollback the transaction. LMAXs in-memory structures are persistent across input events, so if there is an error its important to not leave that memory in an inconsistent state. However theres no automated rollback facility. As a consequence the LMAX team puts a lot of attention into ensuring the input events are fully valid before doing any mutation of the in-memory persistent state. They have found that testing is a key tool in flushing out these kinds of problems before going into production. Input and Output Disruptors Although the business logic occurs in a single thread, there are a number tasks to be done before we can invoke a business object method. The original input for processing comes off the wire in the form of a message, this message needs to be unmarshaled into a form convenient for Business Logic Processor to use. Event Sourcing relies on keeping a durable journal of all the input events, so each input message needs to be journaled onto a durable store. Finally the architecture relies on a cluster of Business Logic Processors, so we have to replicate the input messages across this cluster. Similarly on the output side, the output events need to be marshaled for transmission over the network. Figure 2: The activities done by the input disruptor (using UML activity diagram notation) The replicator and journaler involve IO and therefore are relatively slow. After all the central idea of Business Logic Processor is that it avoids doing any IO. Also these three tasks are relatively independent, all of them need to be done before the Business Logic Processor works on a message, but they can done in any order. So unlike with the Business Logic Processor, where each trade changes the market for subsequent trades, there is a natural fit for concurrency. To handle this concurrency the LMAX team developed a special concurrency component, which they call a Disruptor 11 . The LMAX team have released the source code for the Disruptor with an open source licence. At a crude level you can think of a Disruptor as a multicast graph of queues where producers put objects on it that are sent to all the consumers for parallel consumption through separate downstream queues. When you look inside you see that this network of queues is really a single data structure - a ring buffer. Each producer and consumer has a sequence counter to indicate which slot in the buffer its currently working on. Each producerconsumer writes its own sequence counter but can read the others sequence counters. This way the producer can read the consumers counters to ensure the slot it wants to write in is available without any locks on the counters. Similarly a consumer can ensure it only processes messages once another consumer is done with it by watching the counters. Figure 3: The input disruptor coordinates one producer and four consumers Output disruptors are similar but they only have two sequential consumers for marshaling and output.12 Output events are organized into several topics, so that messages can be sent to only the receivers who are interested in them. Each topic has its own disruptor. The disruptors Ive described are used in a style with one producer and multiple consumers, but this isnt a limitation of the design of the disruptor. The disruptor can work with multiple producers too, in this case it still doesnt need locks.13 A benefit of the disruptor design is that it makes it easier for consumers to catch up quickly if they run into a problem and fall behind. If the unmarshaler has a problem when processing on slot 15 and returns when the receiver is on slot 31, it can read data from slots 16-30 in one batch to catch up. This batch read of the data from the disruptor makes it easier for lagging consumers to catch up quickly, thus reducing overall latency. Ive described things here, with one each of the journaler, replicator, and unmarshaler - this indeed is what LMAX does. But the design would allow multiple of these components to run. If you ran two journalers then one would take the even slots and the other journaler would take the odd slots. This allows further concurrency of these IO operations should this become necessary. The ring buffers are large: 20 million slots for input buffer and 4 million slots for each of the output buffers. The sequence counters are 64bit long integers that increase monotonically even as the ring slots wrap.14 The buffer is set to a size thats a power of two so the compiler can do an efficient modulus operation to map from the sequence counter number to the slot number. Like the rest of the system, the disruptors are bounced overnight. This bounce is mainly done to wipe memory so that there is less chance of an expensive garbage collection event during trading. (I also think its a good habit to regularly restart, so that you rehearse how to do it for emergencies.) The journalers job is to store all the events in a durable form, so that they can be replayed should anything go wrong. LMAX does not use a database for this, just the file system. They stream the events onto the disk. In modern terms, mechanical disks are horribly slow for random access, but very fast for streaming - hence the tag-line disk is the new tape.15 Earlier on I mentioned that LMAX runs multiple copies of its system in a cluster to support rapid failover. The replicator keeps these nodes in sync. All communication in LMAX uses IP multicasting, so clients dont need to know which IP address is the master node. Only the master node listens directly to input events and runs a replicator. The replicator broadcasts the input events to the slave nodes. Should the master node go down, its lack of heartbeat will be noticed, another node becomes master, starts processing input events, and starts its replicator. Each node has its own input disruptor and thus has its own journal and does its own unmarshaling. Even with IP multicasting, replication is still needed because IP messages can arrive in a different order on different nodes. The master node provides a deterministic sequence for the rest of the processing. The unmarshaler turns the event data from the wire into a java object that can be used to invoke behavior on the Business Logic Processor. Therefore, unlike the other consumers, it needs to modify the data in the ring buffer so it can store this unmarshaled object. The rule here is that consumers are permitted to write to the ring buffer, but each writable field can only have one parallel consumer thats allowed to write to it. This preserves the principle of only having a single writer. 16 Figure 4: The LMAX architecture with the disruptors expanded The disruptor is a general purpose component that can be used outside of the LMAX system. Usually financial companies are very secretive about their systems, keeping quiet even about items that arent germane to their business. Not just has LMAX been open about its overall architecture, they have open-sourced the disruptor code - an act that makes me very happy. Not just will this allow other organizations to make use of the disruptor, it will also allow for more testing of its concurrency properties. Queues and their lack of mechanical sympathy The LMAX architecture caught peoples attention because its a very different way of approaching a high performance system to what most people are thinking about. So far Ive talked about how it works, but havent delved too much into why it was developed this way. This tale is interesting in itself, because this architecture didnt just appear. It took a long time of trying more conventional alternatives, and realizing where they were flawed, before the team settled on this one. Most business systems these days have a core architecture that relies on multiple active sessions coordinated through a transactional database. The LMAX team were familiar with this approach, and confident that it wouldnt work for LMAX. This assessment was founded in the experiences of Betfair - the parent company who set up LMAX. Betfair is a betting site that allows people to bet on sporting events. It handles very high volumes of traffic with a lot of contention - sports bets tend to burst around particular events. To make this work they have one of the hottest database installations around and have had to do many unnatural acts in order to make it work. Based on this experience they knew how difficult it was to maintain Betfairs performance and were sure that this kind of architecture would not work for the very low latency that a trading site would require. As a result they had to find a different approach. Their initial approach was to follow what so many are saying these days - that to get high performance you need to use explicit concurrency. For this scenario, this means allowing orders to be processed by multiple threads in parallel. However, as is often the case with concurrency, the difficulty comes because these threads have to communicate with each other. Processing an order changes market conditions and these conditions need to be communicated. The approach they explored early on was the Actor model and its cousin SEDA. The Actor model relies on independent, active objects with their own thread that communicate with each other via queues. Many people find this kind of concurrency model much easier to deal with than trying to do something based on locking primitives. The team built a prototype exchange using the actor model and did performance tests on it. What they found was that the processors spent more time managing queues than doing the real logic of the application. Queue access was a bottleneck. When pushing performance like this, it starts to become important to take account of the way modern hardware is constructed. The phrase Martin Thompson likes to use is mechanical sympathy. The term comes from race car driving and it reflects the driver having an innate feel for the car, so they are able to feel how to get the best out of it. Many programmers, and I confess I fall into this camp, dont have much mechanical sympathy for how programming interacts with hardware. Whats worse is that many programmers think they have mechanical sympathy, but its built on notions of how hardware used to work that are now many years out of date. One of the dominant factors with modern CPUs that affects latency, is how the CPU interacts with memory. These days going to main memory is a very slow operation in CPU-terms. CPUs have multiple levels of cache, each of which of is significantly faster. So to increase speed you want to get your code and data in those caches. At one level, the actor model helps here. You can think of an actor as its own object that clusters code and data, which is a natural unit for caching. But actors need to communicate, which they do through queues - and the LMAX team observed that its the queues that interfere with caching. The explanation runs like this: in order to put some data on a queue, you need to write to that queue. Similarly, to take data off the queue, you need to write to the queue to perform the removal. This is write contention - more than one client may need to write to the same data structure. To deal with the write contention a queue often uses locks. But if a lock is used, that can cause a context switch to the kernel. When this happens the processor involved is likely to lose the data in its caches. The conclusion they came to was that to get the best caching behavior, you need a design that has only one core writing to any memory location17. Multiple readers are fine, processors often use special high-speed links between their caches. But queues fail the one-writer principle. This analysis led the LMAX team to a couple of conclusions. Firstly it led to the design of the disruptor, which determinedly follows the single-writer constraint. Secondly it led to idea of exploring the single-threaded business logic approach, asking the question of how fast a single thread can go if its freed of concurrency management. The essence of working on a single thread, is to ensure that you have one thread running on one core, the caches warm up, and as much memory access as possible goes to the caches rather than to main memory. This means that both the code and the working set of data needs to be as consistently accessed as possible. Also keeping small objects with code and data together allows them to be swapped between the caches as a unit, simplifying the cache management and again improving performance. An essential part of the path to the LMAX architecture was the use of performance testing. The consideration and abandonment of an actor-based approach came from building and performance testing a prototype. Similarly much of the steps in improving the performance of the various components were enabled by performance tests. Mechanical sympathy is very valuable - it helps to form hypotheses about what improvements you can make, and guides you to forward steps rather than backward ones - but in the end its the testing gives you the convincing evidence. Performance testing in this style, however, is not a well-understood topic. Regularly the LMAX team stresses that coming up with meaningful performance tests is often harder than developing the production code. Again mechanical sympathy is important to developing the right tests. Testing a low level concurrency component is meaningless unless you take into account the caching behavior of the CPU. One particular lesson is the importance of writing tests against null components to ensure the performance test is fast enough to really measure what real components are doing. Writing fast test code is no easier than writing fast production code and its too easy to get false results because the test isnt as fast as the component its trying to measure. Should you use this architecture At first glance, this architecture appears to be for a very small niche. After all the driver that led to it was to be able to run lots of complex transactions with very low latency - most applications dont need to run at 6 million TPS. But the thing that fascinates me about this application, is that they have ended up with a design which removes much of the programming complexity that plagues many software projects. The traditional model of concurrent sessions surrounding a transactional database isnt free of hassles. Theres usually a non-trivial effort that goes into the relationship with the database. Objectrelational mapping tools can help much of the pain of dealing with a database, but it doesnt deal with it all. Most performance tuning of enterprise applications involves futzing around with SQL. These days, you can get more main memory into your servers than us old guys could get as disk space. More and more applications are quite capable of putting all their working set in main memory - thus eliminating a source of both complexity and sluggishness. Event Sourcing provides a way to solve the durability problem for an in-memory system, running everything in a single thread solves the concurrency issue. The LMAX experience suggests that as long as you need less than a few million TPS, youll have enough performance headroom. There is a considerable overlap here with the growing interest in CQRS. An event sourced, in-memory processor is a natural choice for the command-side of a CQRS system. (Although the LMAX team does not currently use CQRS.) So what indicates you shouldnt go down this path This is always a tricky questions for little-known techniques like this, since the profession needs more time to explore its boundaries. A starting point, however, is to think of the characteristics that encourage the architecture. One characteristic is that this is a connected domain where processing one transaction always has the potential to change how following ones are processed. With transactions that are more independent of each other, theres less need to coordinate, so using separate processors running in parallel becomes more attractive. LMAX concentrates on figuring the consequences of how events change the world. Many sites are more about taking an existing store of information and rendering various combinations of that information to as many eyeballs as they can find - eg think of any media site. Here the architectural challenge often centers on getting your caches right. Another characteristic of LMAX is that this is a backend system, so its reasonable to consider how applicable it would be for something acting in an interactive mode. Increasingly web application are helping us get used to server systems that react to requests, an aspect that does fit in well with this architecture. Where this architecture goes further than most such systems is its absolute use of asynchronous communications, resulting in the changes to the programming model that I outlined earlier. These changes will take some getting used to for most teams. Most people tend to think of programming in synchronous terms and are not used to dealing with asynchrony. Yet its long been true that asynchronous communication is an essential tool for responsiveness. It will be interesting to see if the wider use of asynchronous communication in the javascript world, with AJAX and node. js, will encourage more people to investigate this style. The LMAX team found that while it took a bit of time to adjust to asynchronous style, it soon became natural and often easier. In particular error handling was much easier to deal with under this approach. The LMAX team certainly feels that the days of the coordinating transactional database are numbered. The fact that you can write software more easily using this kind of architecture and that it runs more quickly removes much of the justification for the traditional central database. For my part, I find this a very exciting story. Much of my goal is to concentrate on software that models complex domains. An architecture like this provides good separation of concerns, allowing people to focus on Domain-Driven Design and keeping much of the platform complexity well separated. The close coupling between domain objects and databases has always been an irritation - approaches like this suggest a way out. if you found this article useful, please share it. I appreciate the feedback and encouragement

No comments:

Post a Comment