Friday 26 January 2018

أنظمة تداول الكمون المنخفض


أنظمة تداول الكمون المنخفض
الحصول على فيا أب ستور قراءة هذه المشاركة في التطبيق لدينا!
أنظمة التداول الكمون المنخفض باستخدام C ++ في ويندوز؟
ويبدو أن جميع البنوك الاستثمارية الكبرى تستخدم C ++ في أونيكس (لينكس، سولاريس) لتطبيقات الكمون المنخفض / عالية التردد الخادم. لماذا لا يتم استخدام ويندوز بشكل عام كمنصة لهذا؟ هل هناك أسباب تقنية لماذا لا يستطيع ويندوز المنافسة؟
ومتطلبات الأداء على أنظمة الكمون المنخفض للغاية المستخدمة في التداول الخوارزمي متطرفة. في هذه البيئة، ميكروثانية العد.
أنا لست متأكدا من سولاريس، ولكن حالة لينكس، هؤلاء الرجال يكتبون واستخدام بقع منخفضة الكمون والتخصيصات لنواة كاملة، من برامج تشغيل بطاقة الشبكة على ما يصل. انها ليست أن هناك سبب فني لماذا لا يمكن أن يتم ذلك على ويندوز، ولكن هناك واحد عملي / قانوني - الوصول إلى شفرة المصدر، والقدرة على إعادة ترجمة مع التغييرات.
من الناحية الفنية، لا. ومع ذلك، هناك سبب عمل بسيط جدا: بقية العالم المالي يعمل على يونكس. البنوك تعمل على إيكس، سوق الأوراق المالية نفسها يعمل على يونكس، وبالتالي، فإنه من الأسهل العثور على المبرمجين في العالم المالي التي تستخدم لبيئة يونكس، بدلا من ويندوز واحد.
(لقد عملت في الخدمات المصرفية الاستثمارية لمدة 8 سنوات) في الواقع، الكثير جدا من ما تسمى البنوك الكمون المنخفض يتم في جافا. وليس حتى الوقت الحقيقي جافا - مجرد جافا العادية مع غ إيقاف. الخدعة الرئيسية هنا هي التأكد من أنك قد مارست كل ما تبذلونه من التعليمات البرمجية بما فيه الكفاية ل جيت لتشغيل قبل أن تحول فم معين إلى برود (بحيث يكون لديك بعض بدء التشغيل حلقة التي تدير لبضع دقائق - وفشل الساخن) .
أسباب استخدام لينوكس هي:
الإدارة عن بعد لا تزال أفضل، وأيضا تأثير منخفض - سيكون لها تأثير ضئيل على العمليات الأخرى على الجهاز. تذكر أن هذه الأنظمة غالبا ما تكون مشتركة في تبادل، وبالتالي فإن الروابط إلى الآلات (من أنت / فريق الدعم الخاص بك) وربما يكون أسوأ من تلك التي لمراكز البيانات العادية الخاصة بك.
تونابيليتي - القدرة على تعيين سوابينس إلى 0، والحصول على جفم لتخصيص صفحات كبيرة، وغيرها من الحيل مستوى منخفض مفيد جدا.
أنا متأكد من أنك يمكن أن تحصل على ويندوز للعمل المقبول، ولكن ليس هناك ميزة كبيرة للقيام بذلك - كما قال آخرون، فإن أي موظف كنت مسروق أن تضطر إلى إعادة اكتشاف كل الكمون خدع خدع بدلا من مجرد تشغيل قائمة مرجعية.
السبب بسيط، قبل 10-20 سنة عندما ظهرت مثل هذه الأنظمة، "المتشددين" خوادم وحدة المعالجة المركزية متعددة كانت فقط على نوع من أونيكس. كان ويندوز نت في حديقة الرقيق هذه الأيام. لذا السبب هو "تاريخي".
قد يتم تطوير النظم الحديثة على ويندوز، انها مجرد مسألة طعم هذه الأيام.
بس: أنا كورينكلي العمل على واحدة من هذه الأنظمة :-)
لينكس / أونيكس هي أكثر قابلية للاستخدام للمستخدمين البعيدين المتزامنة، مما يجعل من الأسهل لكتابة حول النظم، واستخدام الأدوات القياسية مثل غريب / سيد / أوك / بيرل / روبي / أقل على السجلات. سه / اللجنة الدائمة. كل تلك الأشياء فقط هناك.
هناك أيضا قضايا تقنية، على سبيل المثال: لقياس الوقت المنقضي على ويندوز يمكنك الاختيار بين مجموعة من الوظائف استنادا إلى علامة الساعة ويندوز، و كيريبرفورمانسكونتر القائم على الأجهزة (). الأولى هي الزيادات كل 10 إلى 16 ميلي ثانية (ملاحظة: بعض الوثائق يعني المزيد من الدقة - على سبيل المثال القيم من جيتسيستمتيماسفيليتيمي () قياس إلى 100ns، لكنها تبلغ نفس 100ns حافة علامة على مدار الساعة حتى القراد مرة أخرى). هذا الأخير - كيريبرفورمانسكونتر () - لديها قضايا عرض توقف حيث النوى مختلفة / كبوس يمكن الإبلاغ عن الساعات منذ منذ بدء التشغيل التي تختلف من عدة ثوان بسبب يجري تسخينها في أوقات مختلفة أثناء التمهيد النظام. مسن يوثق هذا كعلل بيوس ممكن، ولكن من الشائع. لذلك، الذي يريد تطوير أنظمة التداول الكمون المنخفض على منصة لا يمكن أن تكون أداة بشكل صحيح؟ (هناك حلول، ولكنك لن تجد أي البرامج التي يجلس مريح في دفعة أو إيس).
العديد من المتغيرات لينكس / أونيكس لديها الكثير من المعلمات توياكابل بسهولة للتجارة خارج الكمون لحدث واحد ضد الكمون المتوسط ​​تحت الحمل، وأحجام شريحة الوقت، وسياسات جدولة الخ .. على أنظمة التشغيل مفتوحة المصدر، وهناك أيضا التأكيد الذي يأتي مع القدرة على يرجى الرجوع إلى الشفرة عندما تعتقد أن شيئا ما يجب أن يكون أسرع مما هو عليه، ومعرفة أن مجتمع (قد يكون ضخما) من الناس قد تم القيام بذلك بشكل حاسم - مع ويندوز من الواضح أن يكون أساسا الناس الذين تم تعيينهم إلى انظر إليه.
على الجانب فود / سمعة - غير ملموس إلى حد ما ولكن جزءا هاما من أسباب اختيار نظام التشغيل - أعتقد أن معظم المبرمجين في هذه الصناعة سوف تثق فقط لينكس / أونيكس أكثر لتوفير جدولة موثوق بها والسلوك. وعلاوة على ذلك، لينكس / أونيكس لديه سمعة لتحطمها أقل، على الرغم من ويندوز هو موثوق بها جدا في هذه الأيام، ولينكس لديها قاعدة رمز أكثر تقلبا بكثير من سولاريس أو فريبسد.
هناك مجموعة متنوعة من الأسباب، ولكن السبب ليس فقط التاريخية. في الواقع، يبدو كما لو المزيد والمزيد من التطبيقات المالية من جانب الخادم تعمل على * نيكس هذه الأيام من أي وقت مضى (بما في ذلك الأسماء الكبيرة مثل بورصة لندن، الذي تحول من منصة). بالنسبة إلى تطبيقات العميل أو سطح المكتب، سيكون من السخيف استهداف أي شيء آخر بخلاف ويندوز، حيث أن هذا هو النظام الأساسي المحدد. ومع ذلك، لتطبيقات من جانب الخادم، ومعظم الأماكن التي عملت على نشر ل * نيكس.
أنا أتفق جزئيا مع معظم الإجابات أعلاه. على الرغم من ما أدركت هو السبب الأكبر لاستخدام C ++ هو بيكوس هو أسرع نسبيا مع مكتبة ستل واسعة جدا.
وبصرف النظر عن ذلك، يستخدم نظام لينكس / يونكس أيضا لتعزيز الأداء. أنا أعرف العديد من فريق الكمون المنخفض التي تذهب إلى حد من التغيير والتبديل نواة لينكس. ومن الواضح أن هذا المستوى من الحرية لا توفره النوافذ.
أسباب أخرى مثل النظم القديمة، وتكلفة الترخيص، والموارد أيضا عد ولكن هي عوامل القيادة أقل. كما ذكرت "ريو"، لقد رأيت فرق استخدام جافا وكذلك مع جفم معدل.
أنا ثانيا آراء التاريخية والوصول إلى التلاعب النواة.
وبصرف النظر عن تلك الأسباب وأعتقد أيضا أن تماما مثل كيفية إيقاف جمع القمامة وآلية مماثلة في جافا عند استخدام هذه التقنيات في بعض الكمون المنخفض. قد تجنب ويندوز بسبب أبي في مستوى عال التي تتفاعل مع نظام التشغيل منخفضة المستوى ومن ثم النواة.
وبالتالي فإن جوهر هو بالطبع النواة التي يمكن أن تتفاعل مع استخدام أوس مستوى منخفض. يتم توفير واجهات برمجة التطبيقات عالية المستوى فقط لجعل الحياة المشتركة للمستخدمين أسهل. ولكن في حالة الكمون المنخفض هذا اتضح أن تكون طبقة الدهنية وفقدان ثواني خسارة حول كل عملية. لذلك خيار مربحة للحصول على بضع ثوان ثانية لكل مكالمة.
وبصرف النظر عن هذا شيء آخر للنظر فيه هو التكامل. معظم الخوادم ومراكز البيانات والتبادلات استخدام أونيكس لا ويندوز وذلك باستخدام عملاء من نفس الأسرة يجعل التكامل والاتصالات أسهل.
ثم لديك قضايا الأمن (كثير من الناس هناك قد لا تتفق مع هذه النقطة على الرغم من) القرصنة أونيكس ليست سهلة مقارنة القرصنة ويندوز. أنا لا أوافق على الترخيص يجب أن يكون قضية للبنوك لأنها دش المال على كل قطعة واحدة من الأجهزة والبرمجيات والأشخاص الذين تخصيص لهم، لذلك سوف تراخيص شراء لن تكون أكبر قضية عند النظر في ما كسب من خلال شراء.

أنظمة تداول الكمون المنخفض
الحصول على فيا أب ستور قراءة هذه المشاركة في التطبيق لدينا!
ما مدى سرعة أنظمة التداول هفت الفن اليوم؟
في كل وقت تسمع عن تداول عالية التردد (هفت) وكيف لعنة بسرعة الخوارزميات. ولكن أنا أتساءل - ما هو سريع هذه الأيام؟
أنا لا أفكر في الكمون الناجم عن المسافة الفعلية بين تبادل والخادم تشغيل تطبيق التداول، ولكن الكمون التي قدمها البرنامج نفسه.
أن تكون أكثر تحديدا: ما هو الوقت من الأحداث التي تصل على السلك في تطبيق لهذا التطبيق يخرج أمر / سعر على السلك؟ أي. وقت القراد إلى التجارة.
هل نتحدث دون ميلي ثانية واحدة؟ أو الفرعية ميكروثانية؟
كيف يحقق الأشخاص هذه الحالات؟ الترميز في التجمع؟ التصميم بما؟ جيد C ++ رمز قديم؟
تم مؤخرا نشر مقالة مثيرة للاهتمام حول أسم، وتوفير الكثير من التفاصيل في التكنولوجيا هفت اليوم، وهو قراءة ممتازة:
لقد تلقيت إجابات جيدة جدا. هناك مشكلة واحدة، على الرغم من أن معظم أليغوترادينغ هو سر. كنت ببساطة لا أعرف مدى سرعة ذلك. هذا يسير في كلا الاتجاهين - قد لا اقول لكم بعض مدى السرعة التي يعملون، لأنها لا تريد. البعض الآخر، دعونا نقول "المبالغة"، لأسباب عديدة (جذب المستثمرين أو العملاء، واحد).
الشائعات حول البيكو ثانية، على سبيل المثال، هي الفاحشة بدلا من ذلك. 10 نانو ثانية و 0.1 نانو ثانية هي بالضبط نفس الشيء، لأن الوقت الذي يستغرقه للوصول إلى خادم التداول هو أكثر من ذلك بكثير من ذلك.
والأهم من ذلك، وإن لم يكن ما كنت قد سألت، إذا ذهبت نحو محاولة للتجارة خوارزمية، لا تحاول أن تكون أسرع، في محاولة لتكون أكثر ذكاء. لقد رأيت خوارزميات جيدة جدا التي يمكن التعامل مع ثواني كاملة من الكمون وجعل الكثير من المال.
أنا كتو من شركة صغيرة أن يجعل ويبيع أنظمة هفت القائم على فبغا. بناء أنظمةنا على رأس سولارفلار تطبيق أونلود المحرك (أو) كنا تقديم باستمرار الكمون من "السوق" مثيرة للاهتمام الحدث على السلك (10Gb / S أودب بيانات تغذية السوق من أيس أو سم) إلى أول بايت من رسالة أمر الناتجة ضرب الأسلاك في نطاق 750 إلى 800 نانوسيكوند (نعم، ميكروثانية فرعية). ونحن نتوقع أن أنظمة الإصدار التالي سيكون في نطاق 704 إلى 710 نانوسيكوند. بعض الناس قد ادعى أقل قليلا، ولكن هذا في بيئة المختبر ولا يجلس في الواقع في كولو في شيكاغو وتطهير الأوامر.
التعليقات حول الفيزياء و "سرعة الضوء" صالحة ولكنها ليست ذات صلة. كل شخص جاد في هفت لديه خوادمهم في كولو في الغرفة بجانب خادم التبادل.
للوصول إلى هذا المجال ميكروثانية الفرعية لا يمكنك أن تفعل كثيرا على وحدة المعالجة المركزية المضيف باستثناء أوامر تنفيذ استراتيجية التغذية إلى فبغا، حتى مع تقنيات مثل تجاوز النواة لديك 1.5 ميكروثانية من النفقات العامة لا مفر منه. لذلك في هذا المجال كل شيء يلعب مع فبغاس.
واحدة من الإجابات الأخرى هي نزيهة جدا في القول أنه في هذا السوق سرية للغاية عدد قليل جدا من الناس يتحدثون عن الأدوات التي يستخدمونها أو أدائهم. كل واحد من عملائنا يتطلب أننا حتى لا نقول أي شخص أنهم يستخدمون أدواتنا ولا الكشف عن أي شيء حول كيفية استخدامها. هذا ليس فقط يجعل التسويق الثابت، ولكنه يمنع حقا تدفق جيد من المعرفة التقنية بين أقرانهم.
وبسبب هذه الحاجة للدخول في أنظمة غريبة لجزء "سريع الأشرار" من السوق ستجد أن كوانتس (الناس التي تأتي مع الخوارزميات التي نجعلها تسير بسرعة) وتقسم الطحالب الخاصة بهم إلى الحدث - زمن الاستجابة. في الجزء العلوي من كومة التكنولوجيا هي نظم ميكروثانية الفرعية (مثل بلدنا). الطبقة التالية هي أنظمة C ++ المخصصة التي تجعل الاستخدام الكثيف للتجاوز النواة و هم في نطاق 3-5 ميكروثانية. الطبقة التالية هي الناس الذين لا يستطيعون أن يكون على سلك 10Gb / S واحد فقط هوب التوجيه من "الصرف"، فإنها قد تكون لا تزال في كولو ولكن بسبب لعبة سيئة نسميها "ميناء الروليت" انهم في العشرات إلى المئات من المجال ميكروثانية. مرة واحدة تحصل في ميلي ثانية أنه يكاد لا هفت أي أكثر من ذلك.
"سوب-40 ميكروثانية" إذا كنت ترغب في مواكبة ناسداك. يتم نشر هذا الرقم هنا ناسداكومكس / التكنولوجيا /
المادة الجيدة التي تصف ما هي حالة هفت (في 2018) ويعطي بعض العينات من حلول الأجهزة مما يجعل نانو ثانية قابلة للتحقيق: ستريت ستريتس الحاجة لسرعة التداول: عصر نانوسيكوند.
مع السباق لأقل "الكمون" مستمرة، بعض المشاركين في السوق حتى يتحدثون عن بيكوسكوندس-تريليونثس من الثانية.
إديت: كما ذكر نيكولاس:
يشير الرابط إلى شركة فيكسنيتيكس، والتي يمكن أن "تعد التجارة" في 740ns (أي الوقت من حدث الإدخال يحدث لإرسال أمر).
ما هو قيمة لها، و تيبكو فتل المنتج الرسائل دون 500 نانومتر داخل الجهاز (الذاكرة المشتركة) وعدد قليل من الثواني الصغيرة باستخدام ردما (البعيد الوصول إلى الذاكرة المباشرة) داخل مركز البيانات. بعد ذلك، تصبح الفيزياء الجزء الرئيسي من المعادلة.
بحيث تكون السرعة التي يمكن للبيانات الحصول عليها من الأعلاف إلى التطبيق الذي يجعل القرارات.
وقد ادعى نظام واحد على الأقل.
30ns إنتيرثريد الرسائل، الذي هو على الارجح أنب حتى المعيار، لذلك أي شخص يتحدث عن أقل الأرقام يستخدم نوعا من وحدة المعالجة المركزية السحرية.
مرة كنت في التطبيق، بل هو مجرد مسألة مدى سرعة البرنامج يمكن اتخاذ القرارات.
هذه الأيام رقم واحد القراد إلى التداول في ميكروثانية هو شريط لشركات هفت تنافسية. يجب أن تكون قادرا على القيام بأرقام واحدة عالية باستخدام البرنامج فقط. ثم & لوت؛ 5 أوسيك مع أجهزة إضافية.
وقد بدأ التداول عالي التردد على الأقل منذ عام 1999، بعد أن أذنت لجنة الأوراق المالية والبورصات الأمريكية (سيك) بتبادلات إلكترونية في عام 1998. وفي مطلع القرن الحادي والعشرين، كانت الصفقات هفت وقت التنفيذ عدة ثوان، في حين بحلول عام 2018 هذا قد انخفض إلى ميلي ثانية وحتى ميكروثانية.
فإنه لن يكون تحت ميكروثانية قليلة، بسبب إم-w / الحد الأقصى للسرعة الخفيفة، وفقط عدد قليل الحظ، التي يجب أن تكون في أقل من كيلومتر واحد بعيدا، ويمكن حتى حلم الاقتراب من ذلك.
أيضا، لا يوجد الترميز، لتحقيق تلك السرعة يجب أن تذهب البدنية .. (الرجل مع المادة مع التبديل 300ns، وهذا هو فقط الكمون المضافة من هذا التبديل!؛ يساوي 90M من السفر من خلال البصرية وأقل قليلا في النحاس)

التطور والممارسة: منخفض الكمون التطبيقات الموزعة في المالية.
وصناعة التمويل لديها مطالب فريدة من نوعها لنظم توزيع الكمون المنخفض.
أندرو بروك.
ولكل الأنظمة تقريبا بعض متطلبات الكمون، وتعرف هنا على أنها الوقت اللازم لكي يستجيب النظام للإدخال. (توجد عمليات حسابية غير متوقفة، ولكن لديها عدد قليل من التطبيقات العملية.) تظهر متطلبات الكمون في مجالات المشاكل المتنوعة مثل ضوابط الطيران للطائرات (copter. ardupilot)، والاتصالات الصوتية (queue. acm / detail. cfm؟ إد = 1028895)، متعددة اللاعبين (queue. acm / detail. cfm؟ إد = 971591)، والإعلان عبر الإنترنت (أكويتيادس / في الوقت الحقيقي العطاءات /)، والتجارب العلمية (home. web. cern. ch/about/accelerators/cern-neutrinos-gran - sasso).
الأنظمة الموزعة & مداش؛ حيث يحدث الحساب على أجهزة كمبيوتر متعددة متصلة بالشبكة تتواصل وتنسيق إجراءاتها عن طريق تمرير الرسائل & مداش؛ اعتبارات وقت الاستجابة الخاصة الحالية. في السنوات الأخيرة، أدت أتمتة التداول المالي إلى دفع متطلبات الأنظمة الموزعة مع متطلبات زمن الاستجابة الصعبة (غالبا ما تقاس بالميكروثانية أو حتى النانو ثانية؛ انظر الجدول 1) والتوزيع الجغرافي العالمي. يوفر التداول الآلي نافذة على التحديات الهندسية من متطلبات الكمون المتقلص من أي وقت مضى، والتي قد تكون مفيدة لمهندسي البرمجيات في مجالات أخرى.
تركز هذه المقالة على التطبيقات التي يكون فيها زمن الاستجابة (بدلا من الإنتاجية أو الكفاءة أو بعض المقاييس الأخرى) أحد اعتبارات التصميم الأساسية. فراسد بشكل مختلف، "أنظمة الكمون المنخفض" هي تلك التي الكمون هو المقياس الرئيسي للنجاح وعادة ما يكون أصعب القيد على تصميم حولها. تقدم المقالة أمثلة على أنظمة الكمون المنخفض التي توضح العوامل الخارجية التي تدفع الكمون ومن ثم مناقشة بعض النهج الهندسية العملية لنظم البناء التي تعمل في الكمون المنخفض.
لماذا الجميع في مثل هذا امرنا؟
لفهم تأثير الكمون على أحد التطبيقات، من المهم أولا أن نفهم العوامل الخارجية، في العالم الحقيقي التي تدفع المتطلبات. وتوضح الأمثلة التالية من صناعة التمويل أثر بعض العوامل في العالم الحقيقي.
طلب إقتباس التداول.
وفي عام 2003، عملت في مصرف كبير نشر للتو نظاما تجاريا مؤسسيا جديدا للعملة الأجنبية. وكان الاقتباس ومحرك التجارة، وهو J2EE (جافا 2 منصة، الطبعة المؤسسة) تطبيق قيد التشغيل في خادم ويبلوجيك على رأس قاعدة بيانات أوراكل أوقات الاستجابة التي كانت موثوق بها تحت ثانيتين و [مدش]؛ سريع بما فيه الكفاية لضمان تجربة جيدة للمستخدم.
وفي نفس الوقت الذي بدأ فيه موقع البنك على شبكة الإنترنت، تم إطلاق منصة تداول عبر الإنترنت متعددة البنوك. على هذا النظام الأساسي الجديد، سيقوم العميل بتقديم طلب عرض أسعار (رفق) الذي سيتم إرساله إلى عدة بنوك مشاركة. كل بنك سوف يستجيب مع الاقتباس، وسوف العميل اختيار أي واحد لقبوله.
بدأ البنك الذي أعمل فيه مشروعا للاتصال بالمنصة الجديدة متعددة القنوات. وكان المنطق هو أنه بما أن زمن الاستجابة لمدة ثانيتين كان جيدا بما فيه الكفاية لمستخدم على موقع الويب، فإنه ينبغي أن يكون جيدا بما فيه الكفاية للمنصة الجديدة، وبالتالي فإن نفس الاقتباس ومحرك التجارة يمكن إعادة استخدامها. في غضون أسابيع من بدء العمل، ومع ذلك، كان البنك الفوز بنسبة صغيرة من المستغرب من رفقس. كان السبب الجذري هو الكمون. عندما ردت بنكين بنفس السعر (الذي حدث في كثير من الأحيان)، تم عرض أول رد في أعلى القائمة. انتظر معظم العملاء لرؤية عدد قليل من يقتبس مختلفة ومن ثم النقر على واحد في الجزء العلوي من القائمة. وكانت النتيجة أن أسرع بنك غالبا ما فاز عمل العميل و [مدش]؛ والبنك بلدي لم يكن أسرع.
حدث أبطأ جزء من عملية توليد الاقتباس في استعلامات قاعدة البيانات تحميل معلمات تسعير العملاء. إضافة ذاكرة التخزين المؤقت لمحرك الاقتباس وتحسين بعض "النقاط الساخنة" الأخرى في التعليمات البرمجية جلبت الكمون الاقتباس وصولا الى مجموعة من ما يقرب من 100 ميلي ثانية. مع محرك أسرع، وكان البنك قادرا على التقاط حصة كبيرة في السوق على منصة الاقتباس تنافسية و [مدش]؛ ولكن استمر السوق في التطور.
الجري ونقلت.
وبحلول عام 2006 أصبح نمط جديد من تداول العملات شعبية. فبدلا من قيام العميل بإرسال طلب محدد والبنك الذي يستجيب مع عرض أسعار، أراد العملاء من البنوك إرسال تدفق مستمر من عروض الأسعار. وكان هذا أسلوب البث المتدفق من تداول شعبية خاصة مع بعض صناديق التحوط التي كانت تقوم بتطوير استراتيجيات التداول الآلي و [مدش]؛ التطبيقات التي من شأنها أن تتلقى تيارات من يقتبس من بنوك متعددة وتقرر تلقائيا متى للتداول. في كثير من الحالات، كان البشر الآن خارج حلقة على جانبي التجارة.
ولكي نفهم هذه الديناميكية التنافسية الجديدة، من المهم أن نعرف كيف تحسب البنوك المعدلات التي تفرضها على عملائها من أجل معاملات الصرف الأجنبي. أكبر البنوك تداول العملات مع بعضها البعض في ما يسمى السوق بين البنوك. أسعار الصرف المحددة في تلك السوق هي الأكثر تنافسية وتشكل الأساس لمعدلات (بالإضافة إلى بعض الترميز) التي يتم تقديمها للعملاء. في كل مرة يتغير فيها سعر الفائدة بين البنوك، يقوم كل بنك بإعادة حساب أسعار أسعار العميل المقابلة وإعادة نشرها. وإذا قبل أحد العملاء عرض أسعار (أي طلبات التداول مقابل سعر صرف معلوم)، يمكن للبنك أن يقوم فورا بتجارة مقاصة مع سوق ما بين البنوك، مما يقلل من المخاطر ويقفل ربحا صغيرا. ومع ذلك، هناك مخاطر على البنوك التي بطيئة في تحديث أسعارها. مثال بسيط يمكن أن يوضح:
تخيل أن السوق الفورية بين البنوك ل ور / أوسد لديها معدلات 1.3558 / 1.3560. (يعني المصطلح الفوري أنه سيتم تبادل العملات المتفق عليها في غضون يومي عمل، ويمكن تداول العملات للتسليم في أي تاريخ متفق عليه بصورة متبادلة في المستقبل، ولكن السوق الفورية هي الأكثر نشاطا من حيث عدد الصفقات) يتم تسعير سعرين: واحد للشراء (سعر العطاء)، والآخر للبيع (سعر العرض أو الطلب). في هذه الحالة، يمكن للمشارك في السوق ما بين البنوك بيع اليورو واحد والحصول على 1.3558 دولار أمريكي في المقابل. على العكس من ذلك، يمكن للمرء أن يشتري يورو واحد بسعر 1.3560 دولار أمريكي.
ويقول أن اثنين من البنوك، A و B، هي المشاركين في السوق بين البنوك وتنشر اقتباسات لنفس العميل صندوق التحوط، C. كلا البنوك إضافة هامش من 0.0001 إلى أسعار الصرف التي اقتبس لعملائها و [مدش]؛ وذلك على حد سواء نشر يقتبس من 1.3557 / 1.3561 إلى العميل C. البنك، ومع ذلك، هو أسرع في تحديث أسعارها من البنك باء، مع حوالي 50 ميلي ثانية في حين أن البنك B يستغرق حوالي 250 ميلي ثانية. هناك ما يقرب من 50 ميلي ثانية من زمن استجابة الشبكة بين البنوك A و B والعميل المتبادل ج. كل من البنوك A و B يستغرق حوالي 10 ميلي ثانية للاعتراف أمر، في حين أن صندوق التحوط C يستغرق حوالي 10 ميلي ثانية لتقييم عروض أسعار جديدة وتقديم الطلبات. الجدول 2 يفصل تسلسل الأحداث.
وكان التأثير الصافي لهذا النمط الجديد من أسعار التداول هو أن أي بنك كان أبطأ بكثير من منافسيه من المرجح أن يعاني من خسائر عندما تغيرت أسعار السوق ولم يتم تحديث أسعارها بسرعة كافية. وفي الوقت نفسه، فإن تلك البنوك التي يمكن تحديث أسعارها أسرع حققت أرباحا كبيرة. لم يعد الكمون مجرد عامل في الكفاءة التشغيلية أو حصتها في السوق و [مدش]؛ وقد أثر ذلك بشكل مباشر على أرباح وخسائر مكتب التداول. ومع ازدياد حجم وسرعة التداول خلال منتصف العقد الأول من القرن العشرين، نمت هذه الأرباح والخسائر لتصبح كبيرة جدا. (كيف يمكن أن تذهب منخفضة؟ ويبين الجدول 3 بعض الأمثلة على فترات زمنية تقريبية من النظم والتطبيقات عبر تسعة أوامر من الحجم.)
لتحسين الكمون، قام البنك بتقسيم الاقتباس ومحرك التداول إلى تطبيقات مميزة وإعادة كتابة محرك الاقتباس في C ++. وأصبحت التأخيرات الصغيرة التي أضافتها كل قفزة في الشبكة من سوق ما بين المصارف إلى البنك وإلى زبائنه كبيرة الآن، ولذلك قام البنك بتحديث جدران الحماية وشراء دوائر اتصالات مخصصة. رفعت ترقيات الشبكة جنبا إلى جنب مع محرك الاقتباس أسرع جلبت نهاية إلى نهاية الكمون أقل من 10 مللي ثانية للعملاء الذين كانوا موجودين فعليا بالقرب من مرافقنا في نيويورك ولندن، أو هونغ كونغ. وارتفع أداء التداول والأرباح وفقا لذلك و [مدش]؛ ولكن، بطبيعة الحال، فإن السوق حافظت على التطور.
الأنظمة الهندسية لانخفاض وقت الاستجابة.
ويمكن معالجة متطلبات الكمون لتطبيق معين بطرق عديدة، وكل مشكلة تتطلب حلا مختلفا. ومع ذلك، هناك بعض الموضوعات المشتركة. أولا، من الضروري عادة قياس وقت الاستجابة قبل تحسينه. ثانيا، التحسين غالبا ما يتطلب النظر أدناه طبقات التجريد والتكيف مع واقع البنية التحتية المادية. وأخيرا، من الممكن أحيانا إعادة هيكلة الخوارزميات (أو حتى تعريف المشكلة نفسها) لتحقيق الكمون المنخفض.
أكاذيب، أكاذيب وإحصاءات لعنة.
الخطوة الأولى لحل معظم مشاكل التحسين (وليس فقط تلك التي تنطوي على البرمجيات) هو قياس أداء النظام الحالي. تبدأ من أعلى مستوى وقياس الكمون من النهاية إلى النهاية. ثم قياس زمن الاستجابة لكل مكون أو مرحلة المعالجة. إذا كانت أي مرحلة تأخذ جزءا كبيرا بشكل غير عادي من الكمون، ثم كسرها إلى أبعد من ذلك وقياس الكمون من المواد الفرعية لها. والهدف هو العثور على أجزاء من النظام التي تساهم أكثر من إجمالي الكمون والتركيز جهود التحسين هناك. غير أن ذلك ليس دائما واضحا في الممارسة العملية.
على سبيل المثال، تخيل أحد التطبيقات التي تستجيب لطلبات اقتباس العملاء التي يتم تلقيها عبر الشبكة. يرسل العميل 100 طلب اقتباس في تتابع سريع (يتم إرسال الطلب التالي بمجرد تلقي الرد المسبق) وتقارير إجمالي الوقت المنقضي البالغ 360 مللي ثانية و [مدش]؛ أو 3.6 مللي ثانية في المتوسط ​​لخدمة الطلب. يتم تقسيم الداخلي للتطبيقات وقياسها باستخدام نفس 100 اختبار مجموعة الاقتباس:
والثور؛ قراءة رسالة الإدخال من الشبكة وتحليل - 5 ميكروثانية.
والثور؛ البحث عن ملف تعريف العميل - 3.2 ميلي ثانية (3،200 ميكروثانية)
والثور؛ حساب اقتباس العميل - 15 ميكروثانية.
والثور؛ سجل الاقتباس - 20 ميكروثانية.
والثور؛ تسلسل الاقتباس إلى رسالة الرد - 5 ميكروثانية.
والثور؛ الكتابة إلى الشبكة - 5 ميكروثانية.
وكما هو مبين بوضوح في هذا المثال، يعني تقليل وقت الاستجابة بشكل كبير معالجة الوقت المستغرق للبحث عن الملف الشخصي للعميل. يظهر فحص سريع أن ملف تعريف العميل يتم تحميلها من قاعدة بيانات وتخزينها محليا. يظهر مزيد من الاختبارات أنه عندما يكون الملف الشخصي في ذاكرة التخزين المؤقت المحلي (جدول التجزئة بسيطة)، زمن الاستجابة عادة تحت ميكروثانية، ولكن عندما يتم تفويت ذاكرة التخزين المؤقت يستغرق عدة مئات من ميلي ثانية لتحميل الملف الشخصي. وكان متوسط ​​3.2 ميلي ثانية تقريبا تقريبا نتيجة استجابة واحدة بطيئة جدا (حوالي 320 ميلي ثانية) الناجمة عن ملكة جمال ذاكرة التخزين المؤقت. وبالمثل، تبين أن معدل استجابة المتوسط ​​الذي يبلغ 3.6 ميلي ثانية واحدة هو استجابة بطيئة جدا (350 ميلي ثانية) و 99 استجابة سريعة استغرقت حوالي 100 ميكروثانية لكل منها.
الوسائل والقيم المتطرفة.
معظم الأنظمة تظهر بعض التباين في الكمون من حدث واحد إلى التالي. وفي بعض الحالات، يدفع التباين (وخاصة القيم المتطرفة ذات الكمون الأعلى) التصميم، أكثر بكثير من متوسط ​​الحالة. من المهم أن نفهم أي قياس إحصائي للكمون مناسب للمشكلة المحددة. على سبيل المثال، إذا كنت تقوم ببناء نظام تداول يحقق أرباحا صغيرة عندما يكون الكمون أقل من عتبة معينة ولكنه يتكبد خسائر كبيرة عندما يتجاوز الكمون تلك العتبة، فيجب عليك قياس زمن الكمون (أو، بدلا من ذلك، النسبة المئوية للطلبات التي تتجاوز العتبة) بدلا من المتوسط. من ناحية أخرى، إذا كانت قيمة النظام تتناسب عكسيا مع زمن الاستجابة، فإن قياس (وتحسين) زمن الاستجابة يكون أكثر منطقية حتى لو كان ذلك يعني أن هناك بعض القيم المتطرفة الكبيرة.
ماذا تقيس؟
قد يكون القراء أستيوت قد لاحظت أن الكمون تقاس داخل تطبيق خادم الاقتباس لا تضيف تماما حتى الكمون ذكرت من قبل تطبيق العميل. هذا هو الأرجح لأنها ليست في الواقع قياس نفس الشيء. النظر في بسيودوكود المبسطة التالية:
(في تطبيق العميل)
فور (إنت i = 0؛ i & لوت؛ 100؛ i ++)
ريكتمسيج ريكتمسيج = نيو ريكتمسيج (كوتيركيست)؛
لونت سنتيمي = جيتسيستيمتيمي ()؛
ريسبونزيمسيج ريسبونزيمسيج = ريسيفيمسيج ()؛
طويل كوتلاتنسي = جيتسيستيمتيمي () - سنتيمي؛
(في تطبيق خادم الاقتباس)
ريكتمسيج ريكتمسيج = ريسيف ()؛
لونغ ريسيفدتيمي = جيتسيستيمتيمي ()؛
كوتيركست كوتيركيست = بارسيركست (ريكتمسيج)؛
لونغ بارسيتيمي = جيتسيستيمتيمي ()؛
طويل بارسيلاتنسي = بارسيتيمي - ريسيفدتيمي؛
كلينتبروفيل بروفيل = لوكوبلينتبروفيل (quoteRequest. client)؛
لونغ بروفيلتيم = جيتسيستيمتيمي ()؛
لونغ بروفيللاتنسي = بروفيلتيم - بارسيتيمي؛
كوت كوت = كومبوتكوت (بروفيل)؛
لونغ كومبوتيتيمي = جيتسيستيمتيمي ()؛
طويل كومبوتلاتنسي = كومبوتيتيمي - بروفيلتيم؛
لونغ لوغتيمي = جيتسيستيمتيمي ()؛
لونغ لوتلاتنسي = لوغتيمي - كومبوتيتيم؛
كوتمساج كوتمسيج = كوتمساج جديد (اقتباس)؛
لونغ سيرياليزيتيمي = جيتسيستيمتيمي ()؛
سيرياليزاتيونلاتنسي طويلة = سيرياليزيتيمي - لوغتيمي؛
لونت سنتيمي = جيتسيستيمتيمي ()؛
طويلة سيندلاتنسي = سنتيمي - سيرياليزيتيمي؛
لوغستاتس (بارسيلاتنسي، بروفيللاتنسي، كومبوتلاتنسي،
لوغلاتنسي، سيرياليزاتيونلاتنسي، سيندلاتنسي)؛
لاحظ أن الوقت المنقضي الذي يقاسه تطبيق العميل يتضمن الوقت اللازم لإرسال الطلب عبر الشبكة، وكذلك وقت إرسال الرد مرة أخرى. من ناحية أخرى، يقيس خادم الاقتباس الوقت المنقضي فقط من وصول الاقتباس إلى متى يتم إرساله (أو على نحو أدق، عندما ترجع طريقة الإرسال). ويمكن أن يكون سبب التناقض الذي يبلغ 350 ميكروثانية بين متوسط ​​زمن الاستجابة الذي يقاسه العميل والقياس المكافئ من جانب خادم الاقتباس من قبل الشبكة، ولكنه قد يكون أيضا نتيجة لتأخيرات داخل العميل أو الخادم. وعلاوة على ذلك، اعتمادا على لغة البرمجة ونظام التشغيل، والتحقق من ساعة النظام وتسجيل إحصاءات الكمون قد يعرض تأخيرات المواد.
هذا النهج هو تبسيط، ولكن عندما يقترن مع أدوات الترميز-التعليمات للعثور على التعليمات البرمجية الأكثر شيوعا تنفيذ والموارد الخلاف، وعادة ما تكون جيدة بما فيه الكفاية لتحديد الأهداف الأولى (وغالبا أسهل) لتحسين الكمون. من المهم الحفاظ على هذا التحديد في الاعتبار.
قياس الكمون الموزع نظم عبر التقاط حركة مرور الشبكة.
أنظمة الموزعة تشكل بعض التحديات الإضافية لقياس الكمون و [مدش]؛ فضلا عن بعض الفرص. في الحالات التي يتم فيها توزيع النظام عبر خوادم متعددة يمكن أن يكون من الصعب ربط الطوابع الزمنية للأحداث ذات الصلة. الشبكة نفسها يمكن أن تكون مساهما كبيرا في الكمون من النظام. ويمكن أن تكون الوسائط الوسيطة للرسائل والمداخن الشبكية لأنظمة التشغيل مصادر معقدة للكمون.
وفي الوقت نفسه، فإن تحلل النظام الشامل في عمليات منفصلة تعمل على خوادم مستقلة يمكن أن يسهل قياس بعض التفاعلات بدقة بين مكونات النظام عبر الشبكة. توفر العديد من أجهزة الشبكة (مثل المفاتيح والموجهات) آليات لصنع نسخ ذات طابع زمني للبيانات التي تجتاز الجهاز مع الحد الأدنى من التأثير على أداء الجهاز. معظم أنظمة التشغيل توفر قدرات مماثلة في البرمجيات، وإن كان مع خطر أعلى إلى حد ما لتأخير حركة المرور الفعلية. ويمكن أن تكون التقاطات حركة مرور الشبكة ذات الطابع الزمني (التي تسمى في كثير من الأحيان تسمى حزم الرزم) أداة مفيدة لقياس أكثر دقة عند تبادل رسالة بين جزأين من النظام. ويمكن الحصول على هذه القياسات دون تعديل التطبيق نفسه وعموما مع تأثير ضئيل جدا على أداء النظام ككل. (انظر ويريشارك و تكبدومب.)
ومن التحديات التي تواجه قياس الأداء على نطاقات زمنية قصيرة عبر الأنظمة الموزعة التزامن على مدار الساعة. بشكل عام، لقياس الوقت المنقضي من عندما يقوم تطبيق على الخادم A بإرسال رسالة إلى متى تصل الرسالة إلى تطبيق ثان على الخادم B، من الضروري التحقق من الوقت على الساعة A عند إرسال الرسالة وعلى مدار الساعة B عندما تصل الرسالة، ثم طرح هذين الطابعين الزمنيين لتحديد وقت الاستجابة. وإذا لم تكن الميقاتتان A و B متزامنة، فإن زمن الكمون المحسوب سيكون في الواقع الكمون الحقيقي بالإضافة إلى انحراف الساعة بين A و B.
عندما تكون هذه مشكلة في العالم الحقيقي؟ معدلات الانجراف في العالم الحقيقي لمذبذبات الكوارتز التي يتم استخدامها في معظم اللوحات الأم الخادم السلع هي في حدود 10 ^ -5، مما يعني أنه من المتوقع أن مذبذب إلى الانجراف بمقدار 10 ميكروثانية في الثانية الواحدة. إذا لم يتم تصحيحها، فإنها قد تكسب أو تفقد ما يصل إلى ثانية على مدار يوم واحد. وبالنسبة للأنظمة التي تعمل على نطاقات زمنية من الميلي ثانية أو أقل، فإن الانحراف على مدار الساعة قد يجعل الكمون المقاس بلا معنى. تتوفر مؤشرات التذبذب ذات معدلات الانجراف المنخفضة بشكل كبير، ولكن دون وجود شكل من أشكال المزامنة، فإنها سوف تنحرف في نهاية المطاف. هناك حاجة إلى آلية معينة لتحقيق الساعة المحلية لكل خادم في المحاذاة مع بعض الوقت المرجعي المشترك.
يجب على مطوري الأنظمة الموزعة فهم نتب (بروتوكول وقت الشبكة) كحد أدنى، ويتم تشجيعهم على التعرف على بتب (بروتوكول الوقت الدقة) واستخدام الإشارات الخارجية مثل نظام تحديد المواقع للحصول على تزامن الوقت عالية الدقة في الممارسة العملية. أولئك الذين يحتاجون إلى دقة الوقت على نطاق ميكروثانية الفرعي سوف تريد أن تصبح مألوفة مع تطبيقات الأجهزة من بتب (وخاصة في واجهة الشبكة)، فضلا عن أدوات لاستخراج المعلومات الوقت من الساعة المحلية كل الأساسية. (اطلع على tools. ietf / هتمل / rfc1305 و tools. ietf / هتمل / rfc5905 و nist. gov/el/isd/ieee/ieee1588.cfm و queue. acm / detail. cfm؟ إد = 2354406.)
التجريد مقابل الواقع.
وقد بنيت هندسة البرمجيات الحديثة على التجريدات التي تسمح للمبرمجين لإدارة تعقيد النظم أكبر من أي وقت مضى. الاستنتاجات تفعل ذلك عن طريق تبسيط أو تعميم بعض جوانب النظام الأساسي. هذا لا يأتي مجانا، على الرغم من & مداش؛ التبسيط هو عملية خاطئة بطبيعتها وبعض التفاصيل المفقودة قد تكون مهمة. وعلاوة على ذلك، غالبا ما يتم تعريف التجريدات من حيث الوظيفة بدلا من الأداء.
في مكان ما عميقا تحت التطبيق هي التيارات الكهربائية التي تتدفق من خلال أشباه الموصلات والبقول من الضوء السفر أسفل الألياف. نادرا ما يحتاج المبرمجون إلى التفكير في أنظمتهم بهذه المصطلحات، ولكن إذا كانت رؤيتهم المفاهيمية تنجرف بعيدا جدا عن الواقع، فمن المرجح أن يواجهوا مفاجآت غير سارة.
وتوضح أربعة أمثلة هذه النقطة:
والثور؛ يوفر تكب التجريد مفيدة على أودب (بروتوكول مخطط بيانات المستخدم) من حيث تسليم تسلسل من وحدات البايت. يضمن تكب تسليم البايتات بالترتيب الذي تم إرساله حتى إذا فقدت بعض وحدات بيانات أودب الأساسية. غير أن زمن انتقال كل بايت (وهو الوقت الذي يتم فيه كتابته إلى مقبس تكب في طلب الإرسال حتى يتم قراءته من مقبس استقبال التطبيق المقابل) غير مضمون. في بعض الحالات (على وجه التحديد عند فقدان مخطط البيانات المتداخل) قد تتأخر البيانات الواردة في مخطط بيانات أودب بشكل كبير من التسليم إلى التطبيق، في حين يتم استرداد البيانات المفقودة قبل ذلك.
والثور؛ يوفر الاستضافة السحابية الخوادم الافتراضية التي يمكن إنشاؤها على الطلب دون رقابة دقيقة على موقع الأجهزة. يمكن لتطبيق أو مسؤول إنشاء خادم ظاهري جديد "على السحابة" في أقل من دقيقة و [مدش]؛ إنجازا مستحيلا عند تجميع وتثبيت الأجهزة المادية في مركز البيانات. على عكس الخادم الفعلي، ومع ذلك، فإن موقع خادم السحابة أو موقعها في طوبولوجيا الشبكة قد لا تكون معروفة على وجه التحديد. إذا كان التطبيق الموزع يعتمد على التبادل السريع للرسائل بين الخوادم، فإن القرب الفعلي لهذه الخوادم قد يكون له تأثير كبير على أداء التطبيق بشكل عام.
والثور؛ وتسمح المواضيع بتفكيك المشكلة في تسلسل منفصل من التعليمات التي يمكن السماح بتشغيلها بشكل متزامن، مع مراعاة بعض قيود الطلب، والتي يمكن أن تعمل على الموارد المشتركة (مثل الذاكرة). وهذا يسمح للمطورين للاستفادة من المعالجات متعددة النوى دون الحاجة للتعامل مباشرة مع قضايا جدولة والتعيين الأساسية. في بعض الحالات، ومع ذلك، يمكن أن النفقات العامة من مفاتيح السياق وتمرير البيانات بين النوى تفوق المزايا المكتسبة من قبل التزامن.
والثور؛ تسمح بروتوكولات التخزين الهرمي وذاكرة التخزين المؤقت للمبرمجين بكتابة التطبيقات التي تستخدم كميات كبيرة من الذاكرة الظاهرية (بناء على ترتيب تيرابايت في خوادم السلع الحديثة)، بينما تواجه حالات تأخر تقاس في نانوثانية عندما يمكن تلبية الطلبات من قبل أقرب مخابئ. التجريد يخفي حقيقة أن أسرع الذاكرة محدودة جدا في القدرة (على سبيل المثال، تسجيل الملفات بترتيب بضعة كيلو بايت)، في حين أن الذاكرة التي تم تبديلها إلى القرص قد تتأخر في عشرات مليثانية.
كل من هذه التجريدات مفيد للغاية ولكن يمكن أن يكون لها عواقب غير متوقعة على تطبيقات الكمون المنخفض. هناك بعض الخطوات العملية التي يجب اتخاذها لتحديد وتخفيف مشكلات الكمون الناتجة عن هذه التجريدات.
التراسل وبروتوكولات الشبكة.
ويعني الانتشار الواسع الانتشار للشبكات القائمة على بروتوكول الإنترنت أنه بغض النظر عن منتج الرسائل قيد الاستخدام، تحت أغلفة البيانات التي يتم إرسالها عبر الشبكة كمجموعة من الرزم المنفصلة. خصائص أداء الشبكة واحتياجات التطبيق يمكن أن تختلف بشكل كبير و [مدش]؛ لذلك حجم واحد يكاد يكون من المؤكد لا يصلح كل عندما يتعلق الأمر الرسائل الوسيطة للنظم الموزعة حساسة الكمون.
ليس هناك بديل للحصول تحت غطاء محرك السيارة هنا. على سبيل المثال، إذا كان التطبيق يعمل على شبكة خاصة (يمكنك التحكم في الأجهزة)، والاتصالات تتبع نموذج الناشر / المشترك، ويمكن للتطبيق تحمل معدل معين من فقدان البيانات، ثم الإرسال المتعدد قد تقدم مكاسب أداء كبيرة على أي الوسيطة القائمة على على برنامج التعاون الفني. إذا تم توزيع تطبيق عبر مسافات طويلة جدا وترتيب البيانات ليست مهمة، ثم بروتوكول أودب المستندة إلى قد تقدم مزايا من حيث عدم المماطلة لإعادة إرسال حزمة غاب. إذا تم استخدام الرسائل المستندة إلى تكب، فإنه من الجدير بالذكر أن العديد من المعلمات (وخاصة أحجام المخزن المؤقت، بداية بطيئة، وخوارزمية ناجل) هي شكلي و "خارج من مربع" إعدادات وعادة ما تكون الأمثل ل الإنتاجية بدلا من الكمون (queue. acm / detail. cfm؟ إد = 2539132).
والقيود المادية التي لا يمكن أن تنتشرها المعلومات بشكل أسرع من سرعة الضوء هي اعتبار حقيقي جدا عند التعامل مع جداول زمنية قصيرة و / أو مسافات طويلة. ويقوم أكبر سوقين للأوراق المالية، هما ناسداك و نيس، بتشغيل محركاتهما المطابقة في مراكز البيانات في كارتيريت وماهوه، نيو جيرسي، على التوالي. ويأخذ شعاع الضوء 185 ميكروثانية للسفر مسافة 55.4 كم بين هذين الموقعين. ضوء في الألياف الزجاجية مع معامل الانكسار من 1.6 وبعد مسار أطول قليلا (حوالي 65 كم) يستغرق ما يقرب من 350 ميكروثانية لجعل نفس الرحلة في اتجاه واحد. وبالنظر إلى أن الحسابات التي تنطوي عليها قرارات التداول يمكن أن تتخذ الآن على نطاقات زمنية تبلغ 10 ميكروثانية أو أقل، لا يمكن تجاهل كمون انتشار الإشارة.
تحليل مشكلة في عدد من المواضيع التي يمكن تنفيذها في وقت واحد يمكن أن تزيد كثيرا من الأداء، وخاصة في أنظمة متعددة النوى، ولكن في بعض الحالات قد يكون في الواقع أبطأ من حل ترابط واحد.
وعلى وجه التحديد، تتكبد الشفرة متعددة الوصلات النفقات العامة بالطرق الثلاث التالية:
والثور؛ عندما تعمل مؤشرات الترابط متعددة على نفس البيانات، مطلوب الضوابط للتأكد من أن البيانات لا تزال متسقة. وقد يشمل ذلك اقتناء الأقفال أو تنفيذ حواجز القراءة أو الكتابة. في الأنظمة متعددة النواقص، تتطلب هذه الضوابط التزامن يتم تعليق تنفيذ مؤشر الترابط أثناء تمرير الرسائل بين النوى. إذا كان القفل محتفظ به بالفعل بواسطة مؤشر ترابط واحد، فستحتاج مؤشرات الترابط الأخرى التي تبحث عن هذا القفل إلى الانتظار حتى تنتهي العملية الأولى. إذا كانت العديد من سلاسل الترابط غالبا ما تصل إلى نفس البيانات، قد يكون هناك خلاف كبير للأقفال.
والثور؛ وبالمثل، عندما تعمل مؤشرات الترابط متعددة على نفس البيانات، يجب أن يتم تمرير البيانات نفسها بين النوى. إذا كان العديد من سلاسل الترابط الوصول إلى البيانات نفسها ولكن كل يؤدي سوى عدد قليل من الحسابات على ذلك، قد الوقت اللازم لنقل البيانات بين النوى تتجاوز الوقت الذي يقضيه تشغيل على ذلك.
والثور؛ وأخيرا، إذا كان هناك مواضيع أكثر من النوى، يجب أن يقوم نظام التشغيل بشكل دوري بإجراء مفتاح سياق يتم فيه إيقاف مؤشر الترابط الذي يتم تشغيله على نواة معينة، يتم حفظ حالته كما يسمح بتشغيل سلسلة محادثات أخرى. تكلفة مفتاح السياق يمكن أن تكون كبيرة. إذا كان عدد المواضيع يتجاوز بكثير عدد النوى، يمكن أن يكون تبديل السياق مصدرا هاما للتأخير.
بشكل عام، يجب أن يستخدم تصميم التطبيق سلاسل عمليات بطريقة تمثل التزامن المتأصل للمشكلة الأساسية. إذا كانت المشكلة تحتوي على حساب كبير يمكن القيام به في عزلة، ثم يتم استدعاء عدد أكبر من مؤشرات الترابط. من ناحية أخرى، إذا كان هناك درجة عالية من الترابط بين الحسابات أو (أسوأ حالة) إذا كانت المشكلة متسلسلة بطبيعتها، ثم قد يكون حل ترابط واحد أكثر منطقية. في كلتا الحالتين، يجب استخدام أدوات التنميط لتحديد التنافس المفرط على القفل أو تبديل السياق. هياكل البيانات الخالية من القفل (متاحة الآن لعدة لغات برمجة) هي بديل آخر للنظر (queue. acm / detail. cfm؟ إد = 2492433).
ومن الجدير بالذكر أيضا أن الترتيب المادي من النوى والذاكرة، وأنا / O قد لا تكون موحدة. على سبيل المثال، على معالجات إنتل الحديثة يمكن أن تتفاعل بعض النوى مع I / O الخارجية (على سبيل المثال، واجهات الشبكة) مع الكمون أقل بكثير من غيرها، وتبادل البيانات بين النوى معينة أسرع من غيرها. ونتيجة لذلك، قد يكون من المفيد بشكل واضح لربط المواضيع محددة إلى النوى محددة (queue. acm / detail. cfm؟ إد = 2513149).
التخزين الهرمي وذاكرة التخزين المؤقت تفتقد.
جميع أنظمة الحوسبة الحديثة استخدام تخزين البيانات الهرمي و [مدش]؛ كمية صغيرة من الذاكرة السريعة جنبا إلى جنب مع مستويات متعددة من أكبر (ولكن أبطأ) الذاكرة. يتم تخزين البيانات المدخلة مؤخرا بحيث يكون الوصول اللاحق أسرع. وبما أن معظم التطبيقات تظهر ميلا إلى الوصول إلى نفس الذاكرة عدة مرات في فترة قصيرة، وهذا يمكن أن تزيد كثيرا من الأداء. بيد أنه من أجل الحصول على أقصى فائدة، ينبغي إدراج العوامل الثلاثة التالية في تصميم التطبيق:
والثور؛ استخدام ذاكرة أقل عموما (أو على الأقل في أجزاء التطبيق التي حساسة للكمون) يزيد من احتمال أن البيانات المطلوبة ستكون متاحة في واحدة من مخابئ. على وجه الخصوص، لتطبيقات حساسة الكمون خاصة، وتصميم التطبيق بحيث يمكن الوصول إليها في كثير من الأحيان الوصول إلى البيانات داخل مخابئ وحدة المعالجة المركزية يمكن أن تحسن بشكل ملحوظ الأداء. تختلف المواصفات ولكن معالجات إنتل هاسويل، على سبيل المثال، توفر 32 كيلوبايت لكل نواة لذاكرة التخزين المؤقت للبيانات L1 وتصل إلى 40 ميغابايت من ذاكرة التخزين المؤقت L3 المشتركة لوحدة المعالجة المركزية بأكملها.
والثور؛ وينبغي تجنب التخصيص المتكرر وإطلاق الذاكرة إذا كان من الممكن إعادة الاستخدام. كائن أو بنية البيانات التي يتم تخصيصها مرة واحدة وإعادة استخدامها لديها فرصة أكبر بكثير لتكون موجودة في ذاكرة التخزين المؤقت من واحد الذي يتم تخصيصه مرارا وتكرارا. هذا صحيح بشكل خاص عند تطوير في بيئات حيث يتم إدارة الذاكرة تلقائيا، كما النفقات العامة الناجمة عن جمع القمامة من الذاكرة التي يتم إصدارها يمكن أن تكون كبيرة.
والثور؛ تخطيط هياكل البيانات في الذاكرة يمكن أن يكون لها تأثير كبير على الأداء بسبب بنية مخابئ في المعالجات الحديثة. في حين تختلف التفاصيل حسب المنصة وهي خارج نطاق هذه المقالة، فمن الأفضل عموما أن يفضل المصفوفات هياكل البيانات على القوائم والأشجار المرتبطة، وأن يفضل الخوارزميات التي الوصول إلى الذاكرة بالتتابع لأن هذه تسمح بريفيتشر الأجهزة (الذي يحاول تحميل البيانات بشكل استباقي من الذاكرة الرئيسية في ذاكرة التخزين المؤقت قبل أن يطلب من قبل التطبيق) لتشغيل أكثر كفاءة. لاحظ أيضا أن البيانات التي سيتم تشغيلها في وقت واحد من قبل النوى المختلفة يجب أن تكون منظمة بحيث أنه من غير المرجح أن تقع في نفس خط ذاكرة التخزين المؤقت (أحدث وحدات المعالجة المركزية إنتل استخدام 64-بايت مخبأ خطوط) لتجنب التنافس ذاكرة التخزين المؤقت-الاتساق.
ملاحظة حول تحسين سابق لأوانه.
وينبغي أن تعتبر التحسينات المقدمة فقط جزءا من عملية تصميم أوسع تأخذ في الاعتبار الأهداف الهامة الأخرى بما في ذلك صحة وظيفية، والصيانة، وما إلى ذلك نضع في اعتبارنا اقتباس كوث عن الأمثل سابق لأوانه كونها جذر كل الشر. حتى في معظم البيئات الحساسة للأداء، فمن النادر أن مبرمج يجب أن تكون مهتمة بتحديد العدد الصحيح من المواضيع أو بنية البيانات الأمثل حتى القياسات التجريبية تشير إلى أن جزء معين من التطبيق هو نقطة ساخنة. وينبغي أن ينصب التركيز بدلا من ذلك على ضمان فهم متطلبات الأداء في مرحلة مبكرة من عملية التصميم وأن تكون بنية النظام قابلة للتحليل بما فيه الكفاية للسماح بإجراء قياس تفصيلي للكمون عندما يصبح الأمر ضروريا. وعلاوة على ذلك (وكما نوقش في القسم التالي)، قد لا تكون التحسينات الأكثر فائدة في رمز التطبيق على الإطلاق.
التغييرات في التصميم.
وقد اقتصرت التحسينات المقدمة حتى الآن على تحسين أداء نظام لمجموعة معينة من المتطلبات الوظيفية. وقد تكون هناك أيضا فرص لتغيير التصميم الأوسع للنظام أو حتى لتغيير المتطلبات الوظيفية للنظام بطريقة لا تزال تفي بالأهداف العامة ولكنها تحسن الأداء بدرجة كبيرة. تحسين وقت الاستجابة ليس استثناء. وعلى وجه الخصوص، هناك في كثير من الأحيان فرص للتجارة خفض الكفاءة لتحسين الكمون.
وترد هنا ثلاثة أمثلة واقعية لمصطلحات التصميم بين الكفاءة والكمون، يليها مثال حيث تمثل المتطلبات نفسها أفضل فرصة لإعادة التصميم.
وفي بعض الحالات قد يكون من الممكن تحقيق الكفاءة التجارية للكمون، ولا سيما في الأنظمة التي تعمل بأقل من طاقتها القصوى. وعلى وجه الخصوص، قد يكون من المفيد حساب النواتج المحتملة مسبقا، خاصة عندما يكون النظام خاملا في معظم الأوقات، ولكن يجب أن يتفاعل بسرعة عند وصول المدخلات.
A real-world example can be found in the systems used by some firms to trade stocks based on news such as earnings announcements. Imagine that the market expects Apple to earn between $9.45 and $12.51 per share. The goal of the trading system, upon receiving Apple's actual earnings, would be to sell some number of shares Apple stock if the earnings were below $9.45, buy some number of shares if the earnings were above $12.51, and do nothing if the earnings fall within the expected range. The act of buying or selling stocks begins with submitting an order to the exchange. The order consists of (among other things) an indicator of whether the client wishes to buy or sell, the identifier of the stock to buy or sell, the number of shares desired, and the price at which the client wishes to buy or sell. Throughout the afternoon leading up to Apple's announcement, the client would receive a steady stream of market-data messages that indicate the current price at which Apple's stock is trading.
A conventional implementation of this trading system would cache the market-price data and, upon receipt of the earnings data, decide whether to buy or sell (or neither), construct an order, and serialize that order to an array of bytes to be placed into the payload of a message and sent to the exchange.
An alternative implementation performs most of the same steps but does so on every market-data update rather than only upon receipt of the earnings data. Specifically, when each market-data update message is received, the application constructs two new orders (one to buy, one to sell) at the current prices and serializes each order into a message. The messages are cached but not sent. When the next market-data update arrives, the old order messages are discarded and new ones are created. When the earnings data arrives, the application simply decides which (if either) of the order messages to send.
The first implementation is clearly more efficient (it has a lot less wasted computation), but at the moment when latency matters most (i. e., when the earnings data has been received), the second algorithm is able to send out the appropriate order message sooner. Note that this example presents application-level precomputation; there is an analogous process of branch prediction that takes place in pipelined processors which can also be optimized (via guided profiling) but is outside the scope of this article.
Keeping the system warm.
In some low-latency systems long delays may occur between inputs. During these idle periods, the system may grow "cold." Critical instructions and data may be evicted from caches (costing hundreds of nanoseconds to reload), threads that would process the latency-sensitive input are context-switched out (costing tens of microseconds to resume), CPUs may switch into power-saving states (costing a few milliseconds to exit), etc. Each of these steps makes sense from an efficiency standpoint (why run a CPU at full power when nothing is happening?), but all of them impose latency penalties when the input data arrives.
In cases where the system may go for hours or days between input events there is a potential operational issue as well: configuration or environmental changes may have "broken" the system in some important way that won't be discovered until the event occurs—when it's too late to fix.
A common solution to both problems is to generate a continuous stream of dummy input data to keep the system "warm." The dummy data needs to be as realistic as possible to ensure that it keeps the right data in the caches and that breaking changes to the environment are detected. The dummy data needs to be reliably distinguishable from legitimate data, though, to prevent downstream systems or clients from being confused.
It is common in many systems to process the same data through multiple independent instances of the system in parallel, primarily for the improved resiliency that is conferred. If some component fails, the user will still receive the result needed. Low-latency systems gain the same resiliency benefits of parallel, redundant processing but can also use this approach to reduce certain kinds of variable latency.
All real-world computational processes of nontrivial complexity have some variance in latency even when the input data is the same. These variations can be caused by minute differences in thread scheduling, explicitly randomized behaviors such as Ethernet's exponential back-off algorithm, or other unpredictable factors. Some of these variations can be quite large: page faults, garbage collections, network congestion, etc., can all cause occasional delays that are several orders of magnitude larger than the typical processing latency for the same input.
Running multiple, independent instances of the system, combined with a protocol that allows the end recipient to accept the first result produced and discard subsequent redundant copies, both provides the benefit of less-frequent outages and avoids some of the larger delays.
Stream processing and short circuits.
Consider a news analytics system whose requirements are understood to be "build an application that can extract corporate earnings data from a press release document as quickly as possible." Separately, it was specified that the press releases would be pushed to the system via FTP. The system was thus designed as two applications: one that received the document via FTP, and a second that parsed the document and extracted the earnings data. In the first version of this system, an open-source FTP server was used as the first application, and the second application (the parser) assumed that it would receive a fully formed document as input, so it did not start parsing the document until it had fully arrived.
Measuring the performance of the system showed that while parsing was typically completed in just a few milliseconds, receiving the document via FTP could take tens of milliseconds from the arrival of the first packet to the arrival of the last packet. Moreover, the earnings data was often present in the first paragraph of the document.
In a multistep process it may be possible for subsequent stages to start processing before prior stages have finished, sometimes referred to as stream-oriented or pipelined processing . This can be especially useful if the output can be computed from a partial input. Taking this into account, the developers reconceived their overall objective as "build a system that can deliver earnings data to the client as quickly as possible." This broader objective, combined with the understanding that the press release would arrive via FTP and that it was possible to extract the earnings data from the first part of the document (i. e., before the rest of the document had arrived), led to a redesign of the system.
The FTP server was rewritten to forward portions of the document to the parser as they arrived rather than wait for the entire document. Likewise, the parser was rewritten to operate on a stream of incoming data rather than on a single document. The result was that in many cases the earnings data could be extracted within just a few milliseconds of the start of the arrival of the document. This reduced overall latency (as observed by the client) by several tens of milliseconds without the internal implementation of the parsing algorithm being any faster.
استنتاج.
While latency requirements are common to a wide array of software applications, the financial trading industry and the segment of the news media that supplies it with data have an especially competitive ecosystem that produces challenging demands for low-latency distributed systems.
As with most engineering problems, building effective low-latency distributed systems starts with having a clear understanding of the problem. The next step is measuring actual performance and then, where necessary, making improvements. In this domain, improvements often require some combination of digging below the surface of common software abstractions and trading some degree of efficiency for improved latency.
LOVE IT, HATE IT? LET US KNOW.
Andrew Brook is the CTO of Selerity, a provider of realtime news, data, and content analytics. Previously he led development of electronic currency trading systems at two large investment banks and launched a pre-dot-com startup to deliver AI-powered scheduling software to agile manufacturers. His expertise lies in applying distributed, realtime systems technology and data science to real-world business problems. He finds Wireshark to be more interesting than PowerPoint.
&نسخ؛ 2018 ACM 1542-7730/14/0300 $10.00.
An apostate's opinion.
Ivan Beschastnikh, Patty Wang, Yuriy Brun, Michael D, Ernst - Debugging Distributed Systems.
Challenges and options for validation and debugging.
The accepted wisdom does not always hold true.
Lunchtime doubly so. - Ford Prefect to Arthur Dent in "The Hitchhiker's Guide to the Galaxy", by Douglas Adams.
Elios | Sat, 07 Nov 2018 09:29:52 UTC.
Thanks for the nice post. That's a great sum-up of problems in the design and implementation of distributed low latency systems.
I'm working on a distributed low-latency market data distribution system. In this system, one of the biggest challenge is how to measure its latency which is supposed to be several micro seconds.
In our previous system, the latency is measured in an end-to-end manner. We take timestamp in milli seconds on both publisher and subscriber side and record the difference between them. This works but we are aware that the result is not accurate because even with servers having clock synchronized with NTP, users complain sometimes that negative latency is observed.
Given we are reducing the latency to micro seconds, the end-to-end measurement seems to be too limited (it should be better with PTP but we can't force our users to support PTP in their infrastructure) and thus we are trying to get a round-trip latency. However, I can see immediately several cons with this method :
- extra complexity to configure and implement the system because we need to ensure two-way communication. - we can't deduce the end-to-end latency from the round trip one because the loads on both direction are not the same. (we want to send only some probes and get them back)
Do you have some experiences on the round-trip latency measurement and if so could you please share some best practices ?

Using C++ for Low-Latency Systems.
This class was taught in 2018 and is online for historical purposes only.
“Using C++ for Low-Latency Systems” is a two day training course taught by Patrice Roy of Sherbrooke University. It is offered at the Meydenbauer from 9AM to 5PM on Saturday and Sunday, September 17th and 18th (immediately prior to the conference). Lunch is included.
وصف المساقات.
To get the kind of performance required by some of the most demanding applications, such as games and high-frequency trading, requires the mastery of low-latency techniques not found in mainstream C++.
This class will give you the skills necessary to create low-latency systems in C++:
How to develop components for systems with low-latency constraints How to develop systems that have predictable performance, particularly where worst case execution time comes into play How to perform computation at compile-time instead of at runtime when this is an option How to reduce the space overhead of your programs How to make memory management more efficient, in many ways How to get the most out of cache memory How to get the most out of smart pointers How to measure the performance of your programs in a portable manner.
Emphasis will be put on portable code and will use C++11/C++14 features. Examples will be backed by measurement and open discussion is encouraged.
المتطلبات الأساسية.
Participants should have intermediate knowledge of the C++ language; emphasis will be put on robust C++ code with predictable — and fast — runtime behavior.
This course includes exercises, so bring your laptop and your favorite C++11/14 development environment.
Course Topics.
This course will focus on techniques programmers can use to get better or more stable performance from systems with low-latency constraints. It is subdivided in sections that cover selected subsets of this important topic. Each section discusses C++ features that help achieving the section’s objectives, with emphasis on C++ 11/14 features wherever that makes sense.
We define what we mean by “low-latency”; discuss the similarities and differences with real-time systems; introduce worst-case execution time concepts and discuss measurement utilities and techniques. Resilience-oriented aspects of C++ programming will be addressed here, but this will be a recurring theme throughout course.
C++ features used will include static_assert, utilities, variadic templates and automatic type deduction mechanisms.
Some C++ features have strong upsides and little to no downsides for low-latency system development. In this section of the course, we will explore and use some of the most relevant ones.
C++ features used will include unique_ptr and make_unique, constexpr, automatic type deduction mechanisms, type traits, enable_if, interesting uses of the using keyword, and move semantics.
C++ Features to Use with Care in Low-Latency Systems.
There are C++ features that can be used for low-latency systems but with particular care only, as they have costs that could be higher than their benefits. We will take a reasoned, measurement-based approach to build an informed judgement.
C++ features used will include shared_ptr and make_shared, exceptions, multiple inheritance, RTTI and used-defined replacements thereof. We will also discuss the role noexcept can play in such systems.
Leveraging Standard Containers and Algorithms in Low-Latency Systems.
Some companies rewrite some or all of the standards containers due to a belief that their needs cannot be satisfied by the tools this library offers. We will explore ways to get the most out of the containers and the algorithms provided by the standard library, and examine ways to enhance them when appropriate.
Concurrency and Parallel Programming.
Low-latency systems concerns overlap those of parallel and concurrent systems in different ways: reducing reliance on blocking operations and synchronization facilities, for example, is a strong trend in these two areas.
C++ features used will include C++ 11/14 threading and atomics tools, but with an emphasis on usage patterns that allow components to react in a timely manner to events.
C++ lets programmers manage memory allocation manually in various and interesting ways. We will explore ways to use these mechanisms to our advantage when building low-latency systems.
C++ features used will include specializing operators new and delete in many ways, understanding placement new, and how to write allocators before and since C++ 11.
There have been a number of interesting presentations on cache memory usage and its impact on program performance. We will explore the nuances of this question with examples.
C++ features used will include STL containers and algorithms, alignment control mechanisms, as well as parallel and concurrent programming utilities.
Of course, when it is practical to do so, the fastest programs are those that do nothing. We will explore some ways to combine metaprogramming techniques with small programs in order to move computation to compile time when there are benefits in so doing.
مدرس المقرر.
Patrice Roy has been playing with C++, either professionally, for pleasure or (most of the time) both for over 20 years. After a few years doing R&D and working on military flight simulators, he moved on to academics and has been teaching computer science since 1998. Since 2005, he’s been involved more specifically in helping graduate students and professionals from the fields of real-time systems and game programming develop the skills they need to face today’s challenges. The rapid evolution of C++ in recent years has made his job even more enjoyable.
He’s been a participating member in the ISO C++ Standards Committee since late 2017 and has been involved with the ISO Programming Language Vulnerabilities since late 2018. He has five kids, and his wife ensures their house is home to a continuously changing number of cats, dogs and other animals.
Attendee quote.
"This is the best, most open, most exciting C++ event in the world. Imagine: a whole week with friends who also love C++!"

Trading Floor Architecture.
Available Languages.
Download Options.
View with Adobe Reader on a variety of devices.
جدول المحتويات.
Trading Floor Architecture.
Executive Overview.
Increased competition, higher market data volume, and new regulatory demands are some of the driving forces behind industry changes. Firms are trying to maintain their competitive edge by constantly changing their trading strategies and increasing the speed of trading.
A viable architecture has to include the latest technologies from both network and application domains. It has to be modular to provide a manageable path to evolve each component with minimal disruption to the overall system. Therefore the architecture proposed by this paper is based on a services framework. We examine services such as ultra-low latency messaging, latency monitoring, multicast, computing, storage, data and application virtualization, trading resiliency, trading mobility, and thin client.
The solution to the complex requirements of the next-generation trading platform must be built with a holistic mindset, crossing the boundaries of traditional silos like business and technology or applications and networking.
This document's main goal is to provide guidelines for building an ultra-low latency trading platform while optimizing the raw throughput and message rate for both market data and FIX trading orders.
To achieve this, we are proposing the following latency reduction technologies:
• High speed inter-connect—InfiniBand or 10 Gbps connectivity for the trading cluster.
• High-speed messaging bus.
• Application acceleration via RDMA without application re-code.
• Real-time latency monitoring and re-direction of trading traffic to the path with minimum latency.
Industry Trends and Challenges.
Next-generation trading architectures have to respond to increased demands for speed, volume, and efficiency. For example, the volume of options market data is expected to double after the introduction of options penny trading in 2007. There are also regulatory demands for best execution, which require handling price updates at rates that approach 1M msg/sec. for exchanges. They also require visibility into the freshness of the data and proof that the client got the best possible execution.
In the short term, speed of trading and innovation are key differentiators. An increasing number of trades are handled by algorithmic trading applications placed as close as possible to the trade execution venue. A challenge with these "black-box" trading engines is that they compound the volume increase by issuing orders only to cancel them and re-submit them. The cause of this behavior is lack of visibility into which venue offers best execution. The human trader is now a "financial engineer," a "quant" (quantitative analyst) with programming skills, who can adjust trading models on the fly. Firms develop new financial instruments like weather derivatives or cross-asset class trades and they need to deploy the new applications quickly and in a scalable fashion.
In the long term, competitive differentiation should come from analysis, not just knowledge. The star traders of tomorrow assume risk, achieve true client insight, and consistently beat the market (source IBM: www-935.ibm/services/us/imc/pdf/ge510-6270-trader. pdf).
Business resilience has been one main concern of trading firms since September 11, 2001. Solutions in this area range from redundant data centers situated in different geographies and connected to multiple trading venues to virtual trader solutions offering power traders most of the functionality of a trading floor in a remote location.
The financial services industry is one of the most demanding in terms of IT requirements. The industry is experiencing an architectural shift towards Services-Oriented Architecture (SOA), Web services, and virtualization of IT resources. SOA takes advantage of the increase in network speed to enable dynamic binding and virtualization of software components. This allows the creation of new applications without losing the investment in existing systems and infrastructure. The concept has the potential to revolutionize the way integration is done, enabling significant reductions in the complexity and cost of such integration (gigaspaces/download/MerrilLynchGigaSpacesWP. pdf).
Another trend is the consolidation of servers into data center server farms, while trader desks have only KVM extensions and ultra-thin clients (e. g., SunRay and HP blade solutions). High-speed Metro Area Networks enable market data to be multicast between different locations, enabling the virtualization of the trading floor.
High-Level Architecture.
Figure 1 depicts the high-level architecture of a trading environment. The ticker plant and the algorithmic trading engines are located in the high performance trading cluster in the firm's data center or at the exchange. The human traders are located in the end-user applications area.
Functionally there are two application components in the enterprise trading environment, publishers and subscribers. The messaging bus provides the communication path between publishers and subscribers.
There are two types of traffic specific to a trading environment:
• Market Data—Carries pricing information for financial instruments, news, and other value-added information such as analytics. It is unidirectional and very latency sensitive, typically delivered over UDP multicast. It is measured in updates/sec. and in Mbps. Market data flows from one or multiple external feeds, coming from market data providers like stock exchanges, data aggregators, and ECNs. Each provider has their own market data format. The data is received by feed handlers, specialized applications which normalize and clean the data and then send it to data consumers, such as pricing engines, algorithmic trading applications, or human traders. Sell-side firms also send the market data to their clients, buy-side firms such as mutual funds, hedge funds, and other asset managers. Some buy-side firms may opt to receive direct feeds from exchanges, reducing latency.
Figure 1 Trading Architecture for a Buy Side/Sell Side Firm.
There is no industry standard for market data formats. Each exchange has their proprietary format. Financial content providers such as Reuters and Bloomberg aggregate different sources of market data, normalize it, and add news or analytics. Examples of consolidated feeds are RDF (Reuters Data Feed), RWF (Reuters Wire Format), and Bloomberg Professional Services Data.
To deliver lower latency market data, both vendors have released real-time market data feeds which are less processed and have less analytics:
– Bloomberg B-Pipe—With B-Pipe, Bloomberg de-couples their market data feed from their distribution platform because a Bloomberg terminal is not required for get B-Pipe. Wombat and Reuters Feed Handlers have announced support for B-Pipe.
A firm may decide to receive feeds directly from an exchange to reduce latency. The gains in transmission speed can be between 150 milliseconds to 500 milliseconds. These feeds are more complex and more expensive and the firm has to build and maintain their own ticker plant (financetech/featured/showArticle. jhtml? articleID=60404306).
• Trading Orders—This type of traffic carries the actual trades. It is bi-directional and very latency sensitive. It is measured in messages/sec. and Mbps. The orders originate from a buy side or sell side firm and are sent to trading venues like an Exchange or ECN for execution. The most common format for order transport is FIX (Financial Information eXchange—fixprotocol/). The applications which handle FIX messages are called FIX engines and they interface with order management systems (OMS).
An optimization to FIX is called FAST (Fix Adapted for Streaming), which uses a compression schema to reduce message length and, in effect, reduce latency. FAST is targeted more to the delivery of market data and has the potential to become a standard. FAST can also be used as a compression schema for proprietary market data formats.
To reduce latency, firms may opt to establish Direct Market Access (DMA).
DMA is the automated process of routing a securities order directly to an execution venue, therefore avoiding the intervention by a third-party (towergroup/research/content/glossary. jsp? page=1&glossaryId=383). DMA requires a direct connection to the execution venue.
The messaging bus is middleware software from vendors such as Tibco, 29West, Reuters RMDS, or an open source platform such as AMQP. The messaging bus uses a reliable mechanism to deliver messages. The transport can be done over TCP/IP (TibcoEMS, 29West, RMDS, and AMQP) or UDP/multicast (TibcoRV, 29West, and RMDS). One important concept in message distribution is the "topic stream," which is a subset of market data defined by criteria such as ticker symbol, industry, or a certain basket of financial instruments. Subscribers join topic groups mapped to one or multiple sub-topics in order to receive only the relevant information. In the past, all traders received all market data. At the current volumes of traffic, this would be sub-optimal.
The network plays a critical role in the trading environment. Market data is carried to the trading floor where the human traders are located via a Campus or Metro Area high-speed network. High availability and low latency, as well as high throughput, are the most important metrics.
The high performance trading environment has most of its components in the Data Center server farm. To minimize latency, the algorithmic trading engines need to be located in the proximity of the feed handlers, FIX engines, and order management systems. An alternate deployment model has the algorithmic trading systems located at an exchange or a service provider with fast connectivity to multiple exchanges.
Deployment Models.
There are two deployment models for a high performance trading platform. Firms may chose to have a mix of the two:
• Data Center of the trading firm (Figure 2)—This is the traditional model, where a full-fledged trading platform is developed and maintained by the firm with communication links to all the trading venues. Latency varies with the speed of the links and the number of hops between the firm and the venues.
Figure 2 Traditional Deployment Model.
• Co-location at the trading venue (exchanges, financial service providers (FSP)) (Figure 3)
The trading firm deploys its automated trading platform as close as possible to the execution venues to minimize latency.
Figure 3 Hosted Deployment Model.
Services-Oriented Trading Architecture.
We are proposing a services-oriented framework for building the next-generation trading architecture. This approach provides a conceptual framework and an implementation path based on modularization and minimization of inter-dependencies.
This framework provides firms with a methodology to:
• Evaluate their current state in terms of services.
• Prioritize services based on their value to the business.
• Evolve the trading platform to the desired state using a modular approach.
The high performance trading architecture relies on the following services, as defined by the services architecture framework represented in Figure 4.
Figure 4 Service Architecture Framework for High Performance Trading.
Table 1 Service Descriptions and Technologies.
Ultra-low latency messaging.
Instrumentation—appliances, software agents, and router modules.
OS and I/O virtualization, Remote Direct Memory Access (RDMA), TCP Offload Engines (TOE)
Middleware which parallelizes application processing.
Middleware which speeds-up data access for applications, e. g., in-memory caching.
Hardware-assisted multicast replication through-out the network; multicast Layer 2 and Layer 3 optimizations.
Virtualization of storage hardware (VSANs), data replication, remote backup, and file virtualization.
Trading resilience and mobility.
Local and site load balancing and high availability campus networks.
Wide Area application services.
Acceleration of applications over a WAN connection for traders residing off-campus.
Thin client service.
De-coupling of the computing resources from the end-user facing terminals.
Ultra-Low Latency Messaging Service.
This service is provided by the messaging bus, which is a software system that solves the problem of connecting many-to-many applications. The system consists of:
• A set of pre-defined message schemas.
• A set of common command messages.
• A shared application infrastructure for sending the messages to recipients. The shared infrastructure can be based on a message broker or on a publish/subscribe model.
The key requirements for the next-generation messaging bus are (source 29West):
• Lowest possible latency (e. g., less than 100 microseconds)
• Stability under heavy load (e. g., more than 1.4 million msg/sec.)
• Control and flexibility (rate control and configurable transports)
There are efforts in the industry to standardize the messaging bus. Advanced Message Queueing Protocol (AMQP) is an example of an open standard championed by J. P. Morgan Chase and supported by a group of vendors such as Cisco, Envoy Technologies, Red Hat, TWIST Process Innovations, Iona, 29West, and iMatix. Two of the main goals are to provide a more simple path to inter-operability for applications written on different platforms and modularity so that the middleware can be easily evolved.
In very general terms, an AMQP server is analogous to an E-mail server with each exchange acting as a message transfer agent and each message queue as a mailbox. The bindings define the routing tables in each transfer agent. Publishers send messages to individual transfer agents, which then route the messages into mailboxes. Consumers take messages from mailboxes, which creates a powerful and flexible model that is simple (source: amqp/tikiwiki/tiki-index. php? page=OpenApproach#Why_AMQP_).
Latency Monitoring Service.
The main requirements for this service are:
• Sub-millisecond granularity of measurements.
• Near-real time visibility without adding latency to the trading traffic.
• Ability to differentiate application processing latency from network transit latency.
• Ability to handle high message rates.
• Provide a programmatic interface for trading applications to receive latency data, thus enabling algorithmic trading engines to adapt to changing conditions.
• Correlate network events with application events for troubleshooting purposes.
Latency can be defined as the time interval between when a trade order is sent and when the same order is acknowledged and acted upon by the receiving party.
Addressing the latency issue is a complex problem, requiring a holistic approach that identifies all sources of latency and applies different technologies at different layers of the system.
Figure 5 depicts the variety of components that can introduce latency at each layer of the OSI stack. It also maps each source of latency with a possible solution and a monitoring solution. This layered approach can give firms a more structured way of attacking the latency issue, whereby each component can be thought of as a service and treated consistently across the firm.
Maintaining an accurate measure of the dynamic state of this time interval across alternative routes and destinations can be of great assistance in tactical trading decisions. The ability to identify the exact location of delays, whether in the customer's edge network, the central processing hub, or the transaction application level, significantly determines the ability of service providers to meet their trading service-level agreements (SLAs). For buy-side and sell-side forms, as well as for market-data syndicators, the quick identification and removal of bottlenecks translates directly into enhanced trade opportunities and revenue.
Figure 5 Latency Management Architecture.
Cisco Low-Latency Monitoring Tools.
Traditional network monitoring tools operate with minutes or seconds granularity. Next-generation trading platforms, especially those supporting algorithmic trading, require latencies less than 5 ms and extremely low levels of packet loss. On a Gigabit LAN, a 100 ms microburst can cause 10,000 transactions to be lost or excessively delayed.
Cisco offers its customers a choice of tools to measure latency in a trading environment:
• Bandwidth Quality Manager (BQM) (OEM from Corvil)
• Cisco AON-based Financial Services Latency Monitoring Solution (FSMS)
Bandwidth Quality Manager.
Bandwidth Quality Manager (BQM) 4.0 is a next-generation network application performance management product that enables customers to monitor and provision their network for controlled levels of latency and loss performance. While BQM is not exclusively targeted at trading networks, its microsecond visibility combined with intelligent bandwidth provisioning features make it ideal for these demanding environments.
Cisco BQM 4.0 implements a broad set of patented and patent-pending traffic measurement and network analysis technologies that give the user unprecedented visibility and understanding of how to optimize the network for maximum application performance.
Cisco BQM is now supported on the product family of Cisco Application Deployment Engine (ADE). The Cisco ADE product family is the platform of choice for Cisco network management applications.
BQM Benefits.
Cisco BQM micro-visibility is the ability to detect, measure, and analyze latency, jitter, and loss inducing traffic events down to microsecond levels of granularity with per packet resolution. This enables Cisco BQM to detect and determine the impact of traffic events on network latency, jitter, and loss. Critical for trading environments is that BQM can support latency, loss, and jitter measurements one-way for both TCP and UDP (multicast) traffic. This means it reports seamlessly for both trading traffic and market data feeds.
BQM allows the user to specify a comprehensive set of thresholds (against microburst activity, latency, loss, jitter, utilization, etc.) on all interfaces. BQM then operates a background rolling packet capture. Whenever a threshold violation or other potential performance degradation event occurs, it triggers Cisco BQM to store the packet capture to disk for later analysis. This allows the user to examine in full detail both the application traffic that was affected by performance degradation ("the victims") and the traffic that caused the performance degradation ("the culprits"). This can significantly reduce the time spent diagnosing and resolving network performance issues.
BQM is also able to provide detailed bandwidth and quality of service (QoS) policy provisioning recommendations, which the user can directly apply to achieve desired network performance.
BQM Measurements Illustrated.
To understand the difference between some of the more conventional measurement techniques and the visibility provided by BQM, we can look at some comparison graphs. In the first set of graphs (Figure 6 and Figure 7), we see the difference between the latency measured by BQM's Passive Network Quality Monitor (PNQM) and the latency measured by injecting ping packets every 1 second into the traffic stream.
In Figure 6, we see the latency reported by 1-second ICMP ping packets for real network traffic (it is divided by 2 to give an estimate for the one-way delay). It shows the delay comfortably below about 5ms for almost all of the time.
Figure 6 Latency Reported by 1-Second ICMP Ping Packets for Real Network Traffic.
In Figure 7, we see the latency reported by PNQM for the same traffic at the same time. Here we see that by measuring the one-way latency of the actual application packets, we get a radically different picture. Here the latency is seen to be hovering around 20 ms, with occasional bursts far higher. The explanation is that because ping is sending packets only every second, it is completely missing most of the application traffic latency. In fact, ping results typically only indicate round trip propagation delay rather than realistic application latency across the network.
Figure 7 Latency Reported by PNQM for Real Network Traffic.
In the second example (Figure 8), we see the difference in reported link load or saturation levels between a 5-minute average view and a 5 ms microburst view (BQM can report on microbursts down to about 10-100 nanosecond accuracy). The green line shows the average utilization at 5-minute averages to be low, maybe up to 5 Mbits/s. The dark blue plot shows the 5ms microburst activity reaching between 75 Mbits/s and 100 Mbits/s, the LAN speed effectively. BQM shows this level of granularity for all applications and it also gives clear provisioning rules to enable the user to control or neutralize these microbursts.
Figure 8 Difference in Reported Link Load Between a 5-Minute Average View and a 5 ms Microburst View.
BQM Deployment in the Trading Network.
Figure 9 shows a typical BQM deployment in a trading network.
Figure 9 Typical BQM Deployment in a Trading Network.
BQM can then be used to answer these types of questions:
• Are any of my Gigabit LAN core links saturated for more than X milliseconds? Is this causing loss? Which links would most benefit from an upgrade to Etherchannel or 10 Gigabit speeds?
• What application traffic is causing the saturation of my 1 Gigabit links?
• Is any of the market data experiencing end-to-end loss?
• How much additional latency does the failover data center experience? Is this link sized correctly to deal with microbursts?
• Are my traders getting low latency updates from the market data distribution layer? Are they seeing any delays greater than X milliseconds?
Being able to answer these questions simply and effectively saves time and money in running the trading network.
BQM is an essential tool for gaining visibility in market data and trading environments. It provides granular end-to-end latency measurements in complex infrastructures that experience high-volume data movement. Effectively detecting microbursts in sub-millisecond levels and receiving expert analysis on a particular event is invaluable to trading floor architects. Smart bandwidth provisioning recommendations, such as sizing and what-if analysis, provide greater agility to respond to volatile market conditions. As the explosion of algorithmic trading and increasing message rates continues, BQM, combined with its QoS tool, provides the capability of implementing QoS policies that can protect critical trading applications.
Cisco Financial Services Latency Monitoring Solution.
Cisco and Trading Metrics have collaborated on latency monitoring solutions for FIX order flow and market data monitoring. Cisco AON technology is the foundation for a new class of network-embedded products and solutions that help merge intelligent networks with application infrastructure, based on either service-oriented or traditional architectures. Trading Metrics is a leading provider of analytics software for network infrastructure and application latency monitoring purposes (tradingmetrics/).
The Cisco AON Financial Services Latency Monitoring Solution (FSMS) correlated two kinds of events at the point of observation:
• Network events correlated directly with coincident application message handling.
• Trade order flow and matching market update events.
Using time stamps asserted at the point of capture in the network, real-time analysis of these correlated data streams permits precise identification of bottlenecks across the infrastructure while a trade is being executed or market data is being distributed. By monitoring and measuring latency early in the cycle, financial companies can make better decisions about which network service—and which intermediary, market, or counterparty—to select for routing trade orders. Likewise, this knowledge allows more streamlined access to updated market data (stock quotes, economic news, etc.), which is an important basis for initiating, withdrawing from, or pursuing market opportunities.
The components of the solution are:
• AON hardware in three form factors:
– AON Network Module for Cisco 2600/2800/3700/3800 routers.
– AON Blade for the Cisco Catalyst 6500 series.
– AON 8340 Appliance.
• Trading Metrics M&A 2.0 software, which provides the monitoring and alerting application, displays latency graphs on a dashboard, and issues alerts when slowdowns occur (tradingmetrics/TM_brochure. pdf).
Figure 10 AON-Based FIX Latency Monitoring.
Cisco IP SLA.
Cisco IP SLA is an embedded network management tool in Cisco IOS which allows routers and switches to generate synthetic traffic streams which can be measured for latency, jitter, packet loss, and other criteria (cisco/go/ipsla).
Two key concepts are the source of the generated traffic and the target. Both of these run an IP SLA "responder," which has the responsibility to timestamp the control traffic before it is sourced and returned by the target (for a round trip measurement). Various traffic types can be sourced within IP SLA and they are aimed at different metrics and target different services and applications. The UDP jitter operation is used to measure one-way and round-trip delay and report variations. As the traffic is time stamped on both sending and target devices using the responder capability, the round trip delay is characterized as the delta between the two timestamps.
A new feature was introduced in IOS 12.3(14)T, IP SLA Sub Millisecond Reporting, which allows for timestamps to be displayed with a resolution in microseconds, thus providing a level of granularity not previously available. This new feature has now made IP SLA relevant to campus networks where network latency is typically in the range of 300-800 microseconds and the ability to detect trends and spikes (brief trends) based on microsecond granularity counters is a requirement for customers engaged in time-sensitive electronic trading environments.
As a result, IP SLA is now being considered by significant numbers of financial organizations as they are all faced with requirements to:
• Report baseline latency to their users.
• Trend baseline latency over time.
• Respond quickly to traffic bursts that cause changes in the reported latency.
Sub-millisecond reporting is necessary for these customers, since many campus and backbones are currently delivering under a second of latency across several switch hops. Electronic trading environments have generally worked to eliminate or minimize all areas of device and network latency to deliver rapid order fulfillment to the business. Reporting that network response times are "just under one millisecond" is no longer sufficient; the granularity of latency measurements reported across a network segment or backbone need to be closer to 300-800 micro-seconds with a degree of resolution of 100 ì ثواني.
IP SLA recently added support for IP multicast test streams, which can measure market data latency.
A typical network topology is shown in Figure 11 with the IP SLA shadow routers, sources, and responders.
Figure 11 IP SLA Deployment.
Computing Services.
Computing services cover a wide range of technologies with the goal of eliminating memory and CPU bottlenecks created by the processing of network packets. Trading applications consume high volumes of market data and the servers have to dedicate resources to processing network traffic instead of application processing.
• Transport processing—At high speeds, network packet processing can consume a significant amount of server CPU cycles and memory. An established rule of thumb states that 1Gbps of network bandwidth requires 1 GHz of processor capacity (source Intel white paper on I/O acceleration intel/technology/ioacceleration/306517.pdf).
• Intermediate buffer copying—In a conventional network stack implementation, data needs to be copied by the CPU between network buffers and application buffers. This overhead is worsened by the fact that memory speeds have not kept up with increases in CPU speeds. For example, processors like the Intel Xeon are approaching 4 GHz, while RAM chips hover around 400MHz (for DDR 3200 memory) (source Intel intel/technology/ioacceleration/306517.pdf).
• Context switching—Every time an individual packet needs to be processed, the CPU performs a context switch from application context to network traffic context. This overhead could be reduced if the switch would occur only when the whole application buffer is complete.
Figure 12 Sources of Overhead in Data Center Servers.
• TCP Offload Engine (TOE)—Offloads transport processor cycles to the NIC. Moves TCP/IP protocol stack buffer copies from system memory to NIC memory.
• Remote Direct Memory Access (RDMA)—Enables a network adapter to transfer data directly from application to application without involving the operating system. Eliminates intermediate and application buffer copies (memory bandwidth consumption).
• Kernel bypass — Direct user-level access to hardware. Dramatically reduces application context switches.
Figure 13 RDMA and Kernel Bypass.
InfiniBand is a point-to-point (switched fabric) bidirectional serial communication link which implements RDMA, among other features. Cisco offers an InfiniBand switch, the Server Fabric Switch (SFS): cisco/application/pdf/en/us/guest/netsol/ns500/c643/cdccont_0900aecd804c35cb. pdf.
Figure 14 Typical SFS Deployment.
Trading applications benefit from the reduction in latency and latency variability, as proved by a test performed with the Cisco SFS and Wombat Feed Handlers by Stac Research:
Application Virtualization Service.
De-coupling the application from the underlying OS and server hardware enables them to run as network services. One application can be run in parallel on multiple servers, or multiple applications can be run on the same server, as the best resource allocation dictates. This decoupling enables better load balancing and disaster recovery for business continuance strategies. The process of re-allocating computing resources to an application is dynamic. Using an application virtualization system like Data Synapse's GridServer, applications can migrate, using pre-configured policies, to under-utilized servers in a supply-matches-demand process (networkworld/supp/2005/ndc1/022105virtual. html? page=2).
There are many business advantages for financial firms who adopt application virtualization:
• Faster time to market for new products and services.
• Faster integration of firms following merger and acquisition activity.
• Increased application availability.
• Better workload distribution, which creates more "head room" for processing spikes in trading volume.
• Operational efficiency and control.
• Reduction in IT complexity.
Currently, application virtualization is not used in the trading front-office. One use-case is risk modeling, like Monte Carlo simulations. As the technology evolves, it is conceivable that some the trading platforms will adopt it.
Data Virtualization Service.
To effectively share resources across distributed enterprise applications, firms must be able to leverage data across multiple sources in real-time while ensuring data integrity. With solutions from data virtualization software vendors such as Gemstone or Tangosol (now Oracle), financial firms can access heterogeneous sources of data as a single system image that enables connectivity between business processes and unrestrained application access to distributed caching. The net result is that all users have instant access to these data resources across a distributed network (gridtoday/03/0210/101061.html).
This is called a data grid and is the first step in the process of creating what Gartner calls Extreme Transaction Processing (XTP) (gartner/DisplayDocument? ref=g_search&id=500947). Technologies such as data and applications virtualization enable financial firms to perform real-time complex analytics, event-driven applications, and dynamic resource allocation.
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. Today's data grids are localized in data centers connected by Metro Area Networks (MAN). This is mainly because the applications themselves have limits—they 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 servers—one 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 brokerage's 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 Groups/Channels 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 returns—there 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:
Another example is the Nasdaq Totalview service, broken up this way:
This approach allows for straight forward network/application 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.
Details of Anycast RP can be found in:
The classic high availability design for Tibco in the brokerage network is documented in:
Bidirectional PIM.
PIM-Bidir is an optimization of PIM Sparse Mode for many-to-many applications. It has several key advantages over a PIM-SM deployment:
• Better support for intermittent sources.
• No data-triggered events.
One of the weaknesses of PIM-SM is that the network continually needs to react to active data flows. This can cause non-deterministic behavior that may be hard to troubleshoot. PIM-Bidir has the following major protocol differences over PIM-SM:
– No source registration.
Source traffic is automatically sent to the RP and then down to the interested receivers. There is no unicast encapsulation, PIM joins from the RP to the first hop router and then registration stop messages.
All PIM-Bidir traffic is forwarded on a *,G forwarding entry. The router does not have to monitor the traffic flow on a *,G and then send joins when the traffic passes a threshold.
– No need for an actual RP.
The RP does not have an actual protocol function in PIM-Bidir. The RP acts as a routing vector in which all the traffic converges. The RP can be configured as an address that is not assigned to any particular device. This is called a Phantom RP.
– No need for MSDP.
MSDP provides source information between RPs in a PIM-SM network. PIM-Bidir does not use the active source information for any forwarding decisions and therefore MSDP is not required.
Bidirectional PIM is ideally suited for the brokerage network in the data center of the exchange. In this environment there are many sources sending to a relatively few set of groups in a many-to-many traffic pattern.
The key components of the PIM-Bidir implementation are:
Further details about Phantom RP and basic PIM-Bidir design are documented in:
Source Specific Multicast.
PIM-SSM is an optimization of PIM Sparse Mode for one-to-many applications. In certain environments it can offer several distinct advantages over PIM-SM. Like PIM-Bidir, PIM-SSM does not rely on any data-triggered events. Furthermore, PIM-SSM does not require an RP at all—there is no such concept in PIM-SSM. The forwarding information in the network is completely controlled by the interest of the receivers.
Source Specific Multicast is ideally suited for market data delivery in the financial service provider. The FSP can receive the feeds from the exchanges and then route them to the end of their network.
Many FSPs are also implementing MPLS and Multicast VPNs in their core. PIM-SSM is the preferred method for transporting traffic in VRFs.
When PIM-SSM is deployed all the way to the end user, the receiver indicates his interest in a particular S, G with IGMPv3. Even though IGMPv3 was defined by RFC 2236 back in October, 2002, it still has not been implemented by all edge devices. This creates a challenge for deploying an end-to-end PIM-SSM service. A transitional solution has been developed by Cisco to enable an edge device that supports IGMPv2 to participate in an PIM-SSM service. This feature is called SSM Mapping and is documented in:
Storage Services.
The service provides storage capabilities into the market data and trading environments. Trading applications access backend storage to connect to different databases and other repositories consisting of portfolios, trade settlements, compliance data, management applications, Enterprise Service Bus (ESB), and other critical applications where reliability and security is critical to the success of the business. The main requirements for the service are:
Storage virtualization is an enabling technology that simplifies management of complex infrastructures, enables non-disruptive operations, and facilitates critical elements of a proactive information lifecycle management (ILM) strategy. EMC Invista running on the Cisco MDS 9000 enables heterogeneous storage pooling and dynamic storage provisioning, allowing allocation of any storage to any application. High availability is increased with seamless data migration. Appropriate class of storage is allocated to point-in-time copies (clones). Storage virtualization is also leveraged through the use of Virtual Storage Area Networks (VSANs), which enable the consolidation of multiple isolated SANs onto a single physical SAN infrastructure, while still partitioning them as completely separate logical entities. VSANs provide all the security and fabric services of traditional SANs, yet give organizations the flexibility to easily move resources from one VSAN to another. This results in increased disk and network utilization while driving down the cost of management. Integrated Inter VSAN Routing (IVR) enables sharing of common resources across VSANs.
Figure 18 High Performance Computing Storage.
Replication of data to a secondary and tertiary data center is crucial for business continuance. Replication offsite over Fiber Channel over IP (FCIP) coupled with write acceleration and tape acceleration provides improved performance over long distance. Continuous Data Replication (CDP) is another mechanism which is gaining popularity in the industry. It refers to backup of computer data by automatically saving a copy of every change made to that data, essentially capturing every version of the data that the user saves. It allows the user or administrator to restore data to any point in time. Solutions from EMC and Incipient utilize the SANTap protocol on the Storage Services Module (SSM) in the MDS platform to provide CDP functionality. The SSM uses the SANTap service to intercept and redirect a copy of a write between a given initiator and target. The appliance does not reside in the data path—it is completely passive. The CDP solutions typically leverage a history journal that tracks all changes and bookmarks that identify application-specific events. This ensures that data at any point in time is fully self-consistent and is recoverable instantly in the event of a site failure.
Backup procedure reliability and performance are extremely important when storing critical financial data to a SAN. The use of expensive media servers to move data from disk to tape devices can be cumbersome. Network-accelerated serverless backup (NASB) helps you back up increased amounts of data in shorter backup time frames by shifting the data movement from multiple backup servers to Cisco MDS 9000 Series multilayer switches. This technology decreases impact on application servers because the MDS offloads the application and backup servers. It also reduces the number of backup and media servers required, thus reducing CAPEX and OPEX. The flexibility of the backup environment increases because storage and tape drives can reside anywhere on the SAN.
Trading Resilience and Mobility.
The main requirements for this service are to provide the virtual trader:
• Fully scalable and redundant campus trading environment.
• Resilient server load balancing and high availability in analytic server farms.
• Global site load balancing that provide the capability to continue participating in the market venues of closest proximity.
A highly-available campus environment is capable of sustaining multiple failures (i. e., links, switches, modules, etc.), which provides non-disruptive access to trading systems for traders and market data feeds. Fine-tuned routing protocol timers, in conjunction with mechanisms such as NSF/SSO, provide subsecond recovery from any failure.
The high-speed interconnect between data centers can be DWDM/dark fiber, which provides business continuance in case of a site failure. Each site is 100km-200km apart, allowing synchronous data replication. Usually the distance for synchronous data replication is 100km, but with Read/Write Acceleration it can stretch to 200km. A tertiary data center can be greater than 200km away, which would replicate data in an asynchronous fashion.
Figure 19 Trading Resilience.
A robust server load balancing solution is required for order routing, algorithmic trading, risk analysis, and other services to offer continuous access to clients regardless of a server failure. Multiple servers encompass a "farm" and these hosts can added/removed without disruption since they reside behind a virtual IP (VIP) address which is announced in the network.
A global site load balancing solution provides remote traders the resiliency to access trading environments which are closer to their location. This minimizes latency for execution times since requests are always routed to the nearest venue.
Figure 20 Virtualization of Trading Environment.
A trading environment can be virtualized to provide segmentation and resiliency in complex architectures. Figure 20 illustrates a high-level topology depicting multiple market data feeds entering the environment, whereby each vendor is assigned its own Virtual Routing and Forwarding (VRF) instance. The market data is transferred to a high-speed InfiniBand low-latency compute fabric where feed handlers, order routing systems, and algorithmic trading systems reside. All storage is accessed via a SAN and is also virtualized with VSANs, allowing further security and segmentation. The normalized data from the compute fabric is transferred to the campus trading environment where the trading desks reside.
Wide Area Application Services.
This service provides application acceleration and optimization capabilities for traders who are located outside of the core trading floor facility/data center and working from a remote office. To consolidate servers and increase security in remote offices, file servers, NAS filers, storage arrays, and tape drives are moved to a corporate data center to increase security and regulatory compliance and facilitate centralized storage and archival management. As the traditional trading floor is becoming more virtual, wide area application services technology is being utilized to provide a "LAN-like" experience to remote traders when they access resources at the corporate site. Traders often utilize Microsoft Office applications, especially Excel in addition to Sharepoint and Exchange. Excel is used heavily for modeling and permutations where sometime only small portions of the file are changed. CIFS protocol is notoriously known to be "chatty," where several message normally traverse the WAN for a simple file operation and it is addressed by Wide Area Application Service (WAAS) technology. Bloomberg and Reuters applications are also very popular financial tools which access a centralized SAN or NAS filer to retrieve critical data which is fused together before represented to a trader's screen.
Figure 21 Wide Area Optimization.
A pair of Wide Area Application Engines (WAEs) that reside in the remote office and the data center provide local object caching to increase application performance. The remote office WAEs can be a module in the ISR router or a stand-alone appliance. The data center WAE devices are load balanced behind an Application Control Engine module installed in a pair of Catalyst 6500 series switches at the aggregation layer. The WAE appliance farm is represented by a virtual IP address. The local router in each site utilizes Web Cache Communication Protocol version 2 (WCCP v2) to redirect traffic to the WAE that intercepts the traffic and determines if there is a cache hit or miss. The content is served locally from the engine if it resides in cache; otherwise the request is sent across the WAN the initial time to retrieve the object. This methodology optimizes the trader experience by removing application latency and shielding the individual from any congestion in the WAN.
WAAS uses the following technologies to provide application acceleration:
• Data Redundancy Elimination (DRE) is an advanced form of network compression which allows the WAE to maintain a history of previously-seen TCP message traffic for the purposes of reducing redundancy found in network traffic. This combined with the Lempel-Ziv (LZ) compression algorithm reduces the number of redundant packets that traverse the WAN, which improves application transaction performance and conserves bandwidth.
• Transport Flow Optimization (TFO) employs a robust TCP proxy to safely optimize TCP at the WAE device by applying TCP-compliant optimizations to shield the clients and servers from poor TCP behavior because of WAN conditions. By running a TCP proxy between the devices and leveraging an optimized TCP stack between the devices, many of the problems that occur in the WAN are completely blocked from propagating back to trader desktops. The traders experience LAN-like TCP response times and behavior because the WAE is terminating TCP locally. TFO improves reliability and throughput through increases in TCP window scaling and sizing enhancements in addition to superior congestion management.
Thin Client Service.
This service provides a "thin" advanced trading desktop which delivers significant advantages to demanding trading floor environments requiring continuous growth in compute power. As financial institutions race to provide the best trade executions for their clients, traders are utilizing several simultaneous critical applications that facilitate complex transactions. It is not uncommon to find three or more workstations and monitors at a trader's desk which provide visibility into market liquidity, trading venues, news, analysis of complex portfolio simulations, and other financial tools. In addition, market dynamics continue to evolve with Direct Market Access (DMA), ECNs, alternative trading volumes, and upcoming regulation changes with Regulation National Market System (RegNMS) in the US and Markets in Financial Instruments Directive (MiFID) in Europe. At the same time, business seeks greater control, improved ROI, and additional flexibility, which creates greater demands on trading floor infrastructures.
Traders no longer require multiple workstations at their desk. Thin clients consist of keyboard, mouse, and multi-displays which provide a total trader desktop solution without compromising security. Hewlett Packard, Citrix, Desktone, Wyse, and other vendors provide thin client solutions to capitalize on the virtual desktop paradigm. Thin clients de-couple the user-facing hardware from the processing hardware, thus enabling IT to grow the processing power without changing anything on the end user side. The workstation computing power is stored in the data center on blade workstations, which provide greater scalability, increased data security, improved business continuance across multiple sites, and reduction in OPEX by removing the need to manage individual workstations on the trading floor. One blade workstation can be dedicated to a trader or shared among multiple traders depending on the requirements for computer power.
The "thin client" solution is optimized to work in a campus LAN environment, but can also extend the benefits to traders in remote locations. Latency is always a concern when there is a WAN interconnecting the blade workstation and thin client devices. The network connection needs to be sized accordingly so traffic is not dropped if saturation points exist in the WAN topology. WAN Quality of Service (QoS) should prioritize sensitive traffic. There are some guidelines which should be followed to allow for an optimized user experience. A typical highly-interactive desktop experience requires a client-to-blade round trip latency of <20ms for a 2Kb packet size. There may be a slight lag in display if network latency is between 20ms to 40ms. A typical trader desk with a four multi-display terminal requires 2-3Mbps bandwidth consumption with seamless communication with blade workstation(s) in the data center. Streaming video (800x600 at 24fps/full color) requires 9 Mbps bandwidth usage.
Figure 22 Thin Client Architecture.
Management of a large thin client environment is simplified since a centralized IT staff manages all of the blade workstations dispersed across multiple data centers. A trader is redirected to the most available environment in the enterprise in the event of a particular site failure. High availability is a key concern in critical financial environments and the Blade Workstation design provides rapid provisioning of another blade workstation in the data center. This resiliency provides greater uptime, increases in productivity, and OpEx reduction.
Advanced Encryption Standard.
Advanced Message Queueing Protocol.
Application Oriented Networking.
The Archipelago® Integrated Web book gives investors the unique opportunity to view the entire ArcaEx and ArcaEdge books in addition to books made available by other market participants.
ECN Order Book feed available via NASDAQ.
شيكاغو مجلس التجارة.
Class-Based Weighted Fair Queueing.
Continuous Data Replication.
Chicago Mercantile Exchange is engaged in trading of futures contracts and derivatives.
Central Processing Unit.
Distributed Defect Tracking System.
الوصول المباشر إلى السوق.
Data Redundancy Elimination.
Dense Wavelength Division Multiplexing.
Electronic Communication Network.
Enterprise Service Bus.
Enterprise Solutions Engineering.
FIX Adapted for Streaming.
Fibre Channel over IP.
Financial Information Exchange.
Financial Services Latency Monitoring Solution.
Financial Service Provider.
Information Lifecycle Management.
Instinet Island Book.
Internetworking Operating System.
Keyboard Video Mouse.
Low Latency Queueing.
Metro Area Network.
Multilayer Director Switch.
Markets in Financial Instruments Directive.
Message Passing Interface is an industry standard specifying a library of functions to enable the passing of messages between nodes within a parallel computing environment.
Network Attached Storage.
Network Accelerated Serverless Backup.
Network Interface Card.
Nasdaq Quotation Dissemination Service.
نظام إدارة النظام.
Open Systems Interconnection.
Protocol Independent Multicast.
PIM-Source Specific Multicast.
جودة الخدمة.
Random Access Memory.
Reuters Data Feed.
Reuters Data Feed Direct.
Remote Direct Memory Access.
Regulation National Market System.
Remote Graphics Software.
Reuters Market Data System.
RTP Control Protocol.
Real Time Protocol.
Reuters Wire Format.
Storage Area Network.
Small Computer System Interface.
Sockets Direct Protocol—Given that many modern applications are written using the sockets API, SDP can intercept the sockets at the kernel level and map these socket calls to an InfiniBand transport service that uses RDMA operations to offload data movement from the CPU to the HCA hardware.
Server Fabric Switch.
Secure Financial Transaction Infrastructure network developed to provide firms with excellent communication paths to NYSE Group, AMEX, Chicago Stock Exchange, NASDAQ, and other exchanges. It is often used for order routing.

No comments:

Post a Comment