{{Quickfixn}} SendingTime accuracy issue

Rettenmier, Curt Curt.Rettenmier at avistacorp.com
Wed Nov 5 10:55:35 PST 2014


I had an issue recently with an error related to a socket buffer filling up with Security Definitions and modified the app to store them in a Concurrent Queue object as they came in. I then created another thread to process the queue.

CURT RETTENMIER
Information Developer
Avista Utilities
HP Enterprise Services
Telephone +1 509.495.8492
Email curt.rettenmier at avistacorp.com<mailto:curt.rettenmier at avistacorp.com>
MSC - 28
1411 E. Mission, Spokane, WA 99202

[Description: cid:image001.png at 01CD29CD.B57A0640]

This message and any attached files or documents may contain information that is confidential and considered proprietary to Avista Corporation. Any unauthorized use, transfer, or disclosure of the information contained herein is strictly forbidden. If you believe that this message has been sent to you in error, please reply to the sender that you have received the message in error and delete the message.

From: Quickfixn [mailto:quickfixn-bounces at lists.quickfixn.com] On Behalf Of Estes, Craig
Sent: Wednesday, November 05, 2014 10:50 AM
To: 'Mailing list for QuickFIX/n'
Subject: Re: {{Quickfixn}} SendingTime accuracy issue

As they arrive, can you push the AE messages onto an internal Queue or Stack type structure and have the secondary thread popping them off and persisting/processing them.

From: Quickfixn [mailto:quickfixn-bounces at lists.quickfixn.com]<mailto:[mailto:quickfixn-bounces at lists.quickfixn.com]> On Behalf Of Shamon, John
Sent: Wednesday, November 05, 2014 12:47 PM
To: Mailing list for QuickFIX/n
Subject: Re: {{Quickfixn}} SendingTime accuracy issue

Staffan:

I’m not sure what Market are you hitting, but in my case I have (ICE) they do have a security definition to be pulled up first, that is around 320 lines as a library.
I don’t just have data push just bunch of AE messages like that, every AE message has to be parsed immediately to get my data from or referenced to the Security Definition (the 320 lines), I think that is burdening the process a bit, however I don’t do anything with the data yet, I just save them in an object, but I don’t think I have a choice here, the 320 lines have to be in the memory and parsed every time I get an AE message.
After all the AE messages are done, then I will create independent thread from the main one, it pushes the data to the database, and the main one keeps getting the heartbeats, after that I will be realtime and I won’t get many messages at a time, so it is not an issue, unless we hire 1000 traders and they click every second.

And as I mentioned in my previous email, I got to process 700 messages then I crash with time accuracy issue.

-John

From: Quickfixn [mailto:quickfixn-bounces at lists.quickfixn.com]<mailto:[mailto:quickfixn-bounces at lists.quickfixn.com]> On Behalf Of Staffan Ulfberg
Sent: Wednesday, November 05, 2014 9:57 AM
To: Mailing list for QuickFIX/n
Subject: Re: {{Quickfixn}} SendingTime accuracy issue

Hi,
I just started testing Quickfixn, and after fixing some initial issues I can definitely say that 1000 messages is no problem. Our test code pushes 5000 messages per second over a session and can run indefinitely (this is on my development machine that was fast in 2007. :) ).
To find the cause of your issue, I would try to find the first error and understand what causes it. Maybe the closed connection is the remote detecting a timing accuracy problem as well?
In my experience timing accuracy problems happen either when the computer clock is off (the intended cause), or that more processing than you think takes place in the reader thread.

Look at the logged fix messages (if they are not logged add some logging...), and compare the timestamp of the log message with the timestamps inside the FIX messages to check if they drift apart when many messages arrive.
Also, it could be useful to add logging for how long processing of a single message takes. (I.e., get the time first thing in the ToApp method and then compute the spend time and log it before returning.)

Staffan

On Wed, Nov 5, 2014 at 8:53 AM, Shamon, John <jshamon at semprausgp.com<mailto:jshamon at semprausgp.com>> wrote:
Hello All,
I’m using QuickFix with ICE

I have been experiencing the issue with timing, latency, network traffic whatever you call it as in the below 2 errors.
I understand that the callbacks are time sensitive,
My application was crashing after receiving 20-40 trades (AE messages).

Also I realized there are 4 factors

1-    Overhead through the code

2-    Virus scanner spamware filters

3-    sTunnel

4-    Resources – CPU and RAM

Now here is what I changed

1-    Used 8 CPU – 16 GB RAM

2-    Remove the overhead (sending data to DB), to multithread process, so the main thread with OnMessage(s) keep going without slowing down.

3-    Stopped virus scanner temporary

4-    sTunnel … can’t do anything about it

5-    set the Max latency to 4000 form 380

After consider improving all of the above, I was able to resolve the 2 below errors that they always happen, so now running on 100 trades (AE message) is pretty smooth.

Now I decided to benchmark this, so I have created 1000 trades in ICE test market
I was able to load no more than 700 trades (AE messages), then the Sending Time Accuracy happened again!!

After that I stopped from doing any other process (like sending data over to DB), #1 above (completely eliminated for the sake of testing), so I did have nothing except the callbacks AQ AE messages and heartbeats.

I failed again around 700 trades (AE) messages



1-     I’m getting the error below:
System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)


2-     Another error that I get:
SendingTime accuracy


Can I say I reached the limit when I try to download bunch of AE messages on a snapshot- initial start as in this test?
Can someone share with me how much data they can download at a time?
Any other suggestions?

-John





_______________________________________________
Quickfixn mailing list
Quickfixn at lists.quickfixn.com<mailto:Quickfixn at lists.quickfixn.com>
http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com

________________________________
Although this information has been obtained from sources which we believe to be reliable, we do not guarantee its accuracy, and it may be incomplete or condensed. This is for informational purposes only and is not intended as an offer or solicitation with respect to the purchase or sale of any security. All herein listed securities are subject to availability and change in price. Past performance is not indicative of future results, while changes in any assumptions may have a material effect on projected results. Ratings on all securities are subject to change.

FTN Financial (FTN) is not registered as a municipal advisor with the SEC or MSRB. FTN is not acting as your advisor and does not owe a fiduciary duty under the securities laws to you, any municipal entity, or any obligated person with respect to, among other things, the information and material contained in this communication. Instead, FTN is acting for its own interests. You should discuss any information or material contained in this communication with any and all internal or external advisors and experts that you deem appropriate before acting on this information or material.

FTN Financial Group, FTN Financial Capital Markets, and FTN Financial Portfolio Advisors are divisions of First Tennessee Bank National Association (FTB). FTN Financial Securities Corp (FFSC), FTN Financial Main Street Advisors, LLC, and FTN Financial Capital Assets Corporation are wholly owned subsidiaries of FTB. FFSC is a member of FINRA and SIPC—http://www.sipc.org/. FTN Financial Group, through FTB or its affiliates, offers investment products and services.

This message is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, employee or agent responsible to deliver it to the intended recipient, you are hereby notified that reading, disseminating, distributing or copying this communication is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20141105/8a807916/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 749 bytes
Desc: image001.png
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20141105/8a807916/attachment-0001.png>


More information about the Quickfixn mailing list