<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
<!--
@font-face
{font-family:Cambria}
@font-face
{font-family:Calibri}
@font-face
{font-family:Tahoma}
@font-face
{font-family:"Futura Bk"}
@font-face
{font-family:"Futura Hv"}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif"}
h5
{margin-right:0in;
margin-left:0in;
font-size:10.0pt;
font-family:"Times New Roman","serif";
font-weight:bold}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
p
{margin-right:0in;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif"}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif"}
span.Heading5Char
{font-family:"Cambria","serif";
color:#243F60}
span.BalloonTextChar
{font-family:"Tahoma","sans-serif"}
p.msochpdefault, li.msochpdefault, div.msochpdefault
{margin-right:0in;
margin-left:0in;
font-size:10.0pt;
font-family:"Times New Roman","serif"}
span.emailstyle19
{font-family:"Calibri","sans-serif";
color:#1F497D}
span.balloontextchar0
{font-family:"Tahoma","sans-serif"}
span.emailstyle22
{font-family:"Calibri","sans-serif";
color:#1F497D}
span.EmailStyle25
{font-family:"Calibri","sans-serif";
color:#1F497D}
span.EmailStyle26
{font-family:"Calibri","sans-serif";
color:#1F497D}
.MsoChpDefault
{font-size:10.0pt}
@page WordSection1
{margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
{}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">This is exactly how I do it. I have no throughput issues with this pattern.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> Quickfixn [mailto:quickfixn-bounces@lists.quickfixn.com]
<b>On Behalf Of </b>Rettenmier, Curt<br>
<b>Sent:</b> Wednesday, November 05, 2014 12:56 PM<br>
<b>To:</b> Mailing list for QuickFIX/n<br>
<b>Subject:</b> Re: {{Quickfixn}} SendingTime accuracy issue</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">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.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<div>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Futura Hv"; color:#595959">CURT RETTENMIER</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Futura Hv"; color:#595959">Information Developer</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Futura Hv"; color:#595959">Avista Utilities</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Futura Hv"; color:#595959">HP Enterprise Services</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Futura Hv"; color:#595959">Telephone</span><span style="font-size:8.0pt; font-family:"Futura Bk"; color:#595959"> +1 509.495.8492</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Futura Hv"; color:#595959">Email</span><span style="font-size:8.0pt; font-family:"Futura Bk"; color:#595959">
<a href="mailto:curt.rettenmier@avistacorp.com"><span style="color:#595959">curt.rettenmier@avistacorp.com</span></a></span><span style="font-size:8.0pt; font-family:"Futura Bk"; color:blue">
</span><span style="font-size:8.0pt; font-family:"Futura Bk"; color:#595959"> </span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt; font-family:"Futura Bk"; color:#595959">MSC - 28</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt; font-family:"Futura Bk"; color:#595959">1411 E. Mission, Spokane, WA 99202</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt; font-family:"Futura Bk"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"><img border="0" width="35" height="17" id="Picture_x0020_1" src="cid:image001.png@01CFF8FA.07898840" alt="Description: cid:image001.png@01CD29CD.B57A0640"></span><span style="color:blue"></span></p>
<p class="MsoNormal"><span style="color:blue"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:navy">This message and any attached files or documents may contain information that is confidential and considered proprietary to Avista Corporation.</span></b><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:navy">
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.</span><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:blue"></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> Quickfixn [mailto:quickfixn-bounces@lists.quickfixn.com]
<b>On Behalf Of </b>Estes, Craig<br>
<b>Sent:</b> Wednesday, November 05, 2014 10:50 AM<br>
<b>To:</b> 'Mailing list for QuickFIX/n'<br>
<b>Subject:</b> Re: {{Quickfixn}} SendingTime accuracy issue</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">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. </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> Quickfixn
<a href="mailto:[mailto:quickfixn-bounces@lists.quickfixn.com]">[mailto:quickfixn-bounces@lists.quickfixn.com]</a>
<b>On Behalf Of </b>Shamon, John<br>
<b>Sent:</b> Wednesday, November 05, 2014 12:47 PM<br>
<b>To:</b> Mailing list for QuickFIX/n<br>
<b>Subject:</b> Re: {{Quickfixn}} SendingTime accuracy issue</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Staffan:</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">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.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">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.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">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.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">And as I mentioned in my previous email, I got to process 700 messages then I crash with time accuracy issue.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">-John</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> Quickfixn
<a href="mailto:[mailto:quickfixn-bounces@lists.quickfixn.com]">[mailto:quickfixn-bounces@lists.quickfixn.com]</a>
<b>On Behalf Of </b>Staffan Ulfberg<br>
<b>Sent:</b> Wednesday, November 05, 2014 9:57 AM<br>
<b>To:</b> Mailing list for QuickFIX/n<br>
<b>Subject:</b> Re: {{Quickfixn}} SendingTime accuracy issue</span></p>
<p class="MsoNormal"> </p>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,</p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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. :) ).</p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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?</p>
</div>
<div>
<p class="MsoNormal">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.</p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
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.</p>
</div>
<div>
<p class="MsoNormal">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.)</p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
Staffan</p>
</div>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">On Wed, Nov 5, 2014 at 8:53 AM, Shamon, John <<a href="mailto:jshamon@semprausgp.com" target="_blank">jshamon@semprausgp.com</a>> wrote:</p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Hello All,</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">I’m using QuickFix with ICE</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">I have been experiencing the issue with timing, latency, network traffic whatever you call it as in the below 2 errors.</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">I understand that the callbacks are time sensitive,</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">My application was crashing after receiving 20-40 trades (AE messages).</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Also I realized there are 4 factors</span></p>
<p><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">1-</span><span style="font-size:7.0pt">
</span><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Overhead through the code</span></p>
<p><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">2-</span><span style="font-size:7.0pt">
</span><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Virus scanner spamware filters</span></p>
<p><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">3-</span><span style="font-size:7.0pt">
</span><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">sTunnel</span></p>
<p><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">4-</span><span style="font-size:7.0pt">
</span><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Resources – CPU and RAM</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Now here is what I changed</span></p>
<p><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">1-</span><span style="font-size:7.0pt">
</span><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Used 8 CPU – 16 GB RAM</span></p>
<p><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">2-</span><span style="font-size:7.0pt">
</span><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Remove the overhead (sending data to DB), to multithread process, so the main thread with OnMessage(s) keep going without slowing down.</span></p>
<p><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">3-</span><span style="font-size:7.0pt">
</span><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Stopped virus scanner temporary</span></p>
<p><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">4-</span><span style="font-size:7.0pt">
</span><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">sTunnel … can’t do anything about it
</span></p>
<p><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">5-</span><span style="font-size:7.0pt">
</span><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">set the Max latency to 4000 form 380</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">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.</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Now I decided to benchmark this, so I have created 1000 trades in ICE test market</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">I was able to load no more than 700 trades (AE messages), then the Sending Time Accuracy happened again!!</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">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.</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">I failed again around 700 trades (AE) messages</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> </span></p>
<p class="MsoNormal"> </p>
<p>1-<span style="font-size:7.0pt"> </span><u>I’m getting the error below:</u></p>
<p class="MsoNormal">System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host</p>
<p class="MsoNormal"> at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)</p>
<p class="MsoNormal"> </p>
<p>2-<span style="font-size:7.0pt"> </span><u>Another error that I get:</u></p>
<p class="MsoNormal">SendingTime accuracy </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">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?</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Can someone share with me how much data they can download at a time?</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">Any other suggestions?</span></p>
<p class="MsoNormal"><span style="color:#888888"> </span></p>
<p class="MsoNormal"><span style="color:#888888">-John</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a></p>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="100%" align="center">
</div>
<h5><span style="color:gray">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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.
</span></h5>
</div>
<hr>
<h5><font color="gray">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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.
</h5>
</font>
</body>
</html>