How reduce delay between sending messages using Ema C++ Consumer

Hello everyone, can you please tell me exist possibility decrease delay between sended messages using Ema C++ interface.
I using default approach with next code. And it's in the cycle without any delay from my side.
consumer->submit(PostMsg()
.streamId(_postStreamID)
.postId(postID).domainType(MMT_MARKET_PRICE)
.solicitAck(true).complete()
.payload(UpdateMsg()
.streamId(_postStreamID)
.name(RIC)
.payload(fieldList))
.complete(),
_subStreamHandle);
I expected performance as 1~10ms between sended messages and get next result.
<!-- Time: 7:00:01:887 -->
<key flags="0x2 (RSSL_MKF_HAS_NAME)" name="GBPSZB10YD=RAIS"/>
<!-- Time: 7:00:01:965 -->
<key flags="0x2 (RSSL_MKF_HAS_NAME)" name="AUDSZB4YD=RAIS"/>
It's spended in average 80~120ms, i found it's very large delay. And I try to find any solution how I can decrease this delay. I used simple configuration for my Ema interface.
Any information from your side about this will be heplfull. Thanks in advance.
Best Answer
-
I assume that you are contributing data to Refinitiv Contributions Channel and you get the timestamp from the XML trace in EMA.
I modified the code to send messages in a for loop to verify the timestamps in the XML trace.
for (int i = 0; i <= 4; i++) {
_pOmmConsumer->submit(PostMsg()
.streamId(_postStreamID)
.postId(_postID).domainType(MMT_MARKET_PRICE)
.solicitAck(true).complete()
.payload(UpdateMsg().streamId(_postStreamID)
.name("TRCCTEST01")
.payload(FieldList()
.addReal(22, _BID, OmmReal::ExponentNeg2Enum)
.addReal(25, _ASK, OmmReal::ExponentNeg2Enum)
.complete()))
.complete(),
_subStreamHandle);
_postID++;
_BID++;
_ASK++;
}If I enable XmlTraceToStdout, the delay is around 10-50 ms.
<XmlTraceToStdout value="1"/>
<XmlTraceToFile value="0"/><!-- Time: 11:08:57:414 -->
<!-- Time: 11:08:57:461 -->
<!-- Time: 11:08:57:504 -->
<!-- Time: 11:08:57:521 -->
<!-- Time: 11:08:57:568 -->However, If I enable XmlTraceToFile, there is no delay in millisecond in the XML trace file.
<XmlTraceToStdout value="0"/>
<XmlTraceToFile value="1"/><!-- Time: 11:21:04:513 -->
<!-- Time: 11:21:04:513 -->
<!-- Time: 11:21:04:513 -->
<!-- Time: 11:21:04:513 -->
<!-- Time: 11:21:04:513 -->In conclusion, enabling XML tracing will impact the performance of the application, especially XmlTraceToStdout. In the production environment, you should disable tracing and use the release build.
0
Answers
-
How I some investigate my point i keep wait answer ACK responce for continue sending next message, i remove this logic. And try to send messages immidiatly when it possible.Could you please look my configuration, maybe another parameters loose my performance in production case.Current my result with not wait ACK equal 15ms, it's good but not enough.
0 -
@mikhail.maryankou
You may need to log timestamps when the application called the submit method to post messages. It may be a delay in the application.
0 -
Also, please be aware that you are not required to wait for an ACK before sending the next message. If you send too many Posts and exceed any RCC Queue limits, then you will receive a NACK.
0 -
I solved my problem. For the first i don't wait ACK responce for increase performance. For the second as delay bad case using Sleep() function, because this method do not guarantee that's 1ms sleeping it's 1ms awaking. In my case it's spend 15~20ms. Exist two ways for using in this case. It's WaitForSingleObject or more modern with condition variable:
std::mutex mtx;
std::unique_lock lk(mtx);
std::condition_variable cv;
while (fSvcStopPauseFlag != 1)
{
cv.wait_for(lk, std::chrono::milliseconds(1)); // guarantee delay 1ms
// send you message
}I hope that's my explanation can help anybody in future.
Thank you all for your participation in this thread.0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛