forwardReplaying Log Files   Table of ContentConfiguration Filesforward
Low Latency Best Practices

There are several tips to achieve minimum latency.

  • Configure process priority and affinity.
  • Turn off logging.

Configure process priority and affinity.

To achieve minimum latency process priority of using application, Handler should be set to High or even Realtime.

Handler uses several threads, that's why application should not be limited to single processor core.

C#
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;
//Process.GetCurrentProcess().ProcessorAffinity = new IntPtr(2); // If this line 
//              will be uncommented, apllication will be limited to second processor core only.
Turn off logging.

When TraceSwitch based logging is used, all trace switches should be turned off via App.config file or static properties of the Handler class.

For example:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.diagnostics>
    <switches>
      <!-- This switch controls general messages. In order to receive general trace messages change the value to the appropriate level.          
         "0" gives nothing
         "1" gives error messages, 
         "2" gives error and warning messages, 
         "3" gives error, warning and info messages, 
         "4" gives error, warning, info and verbose messages.
         -->
      <add name="OnixS.CmeMdHandler" value="0"/>
      <add name="OnixS.CmeMdHandler.Receivers" value="0"/>
      <add name="OnixS.CmeMdHandler.FixMessages" value="0"/>
      <add name="OnixS.CmeMdHandler.OrderBook" value="0"/>
    </switches>
  </system.diagnostics>
</configuration>

or:

C#
Handler.TraceSwitch.Level = TraceLevel.Off;
Handler.ReceiversTraceSwitch.Level = TraceLevel.Off;
Handler.FixMessagesTraceSwitch.Level = TraceLevel.Off;
Handler.OrderBookTraceSwitch.Level = TraceLevel.Off;