Join the 80,000 other DTN customers who enjoy the fastest, most reliable data available. There is no better value than DTN!

(Move your cursor to this area to pause scrolling)




"You have an excellent product !!!!!!" - Comment from Arely
"I "bracket trade" all major news releases and I have not found one lag or glitch with DTN.IQ feed. I am very comfortable with their feed under all typical news conditions (Fed releases, employment numbers, etc)." - Comment from Public Forum
"Excellent datafeed !!!" - Comment from Arely
"I am keeping IQFeed, much better reliabilty than *******. I may refer a few other people in the office to switch as well." - Comment from Don
"The service is great, I see a noticeable improvement in my volume profiles over [broker]'s data feed" - Comment from Larry
"Boy, probably spent a thousand hours trying to get ******* API to work right. And now two hours to have something running with IQFeed. Hmmm, guess I was pretty stupid to fight rather than switch all this time. And have gotten more customer service from you guys already than total from them… in five years." - Comment from Jim
"Very impressed with the quality of your feed - ******* is a real donkey in comparison." - Comment from A.C. via Email
"Can I get another account from you? I am tired of ******* going down so often" - Comment from George
"Version 4.0.0.2 has been working well for me and I appreciate that it is now a much tighter client to work with. I feel I can go to press with my own application and rely on a stable platform" - Comment from David in IA.
"Thanks for the great product and support. During this week of high volume trading, my QuoteTracker + IQ Feed setup never missed a beat. Also, thanks for your swiftness in responding to data issues. I was on ******* for a few years before I made the switch over early this year, and wish I had done it a long time ago." - Comment from Ken
Home  Search  Register  Login  Recent Posts

Information on DTN's Industries:
DTN Oil & Gas | DTN Trading | DTN Agriculture | DTN Weather
Follow DTNMarkets on Twitter
DTN.IQ/IQFeed on Twitter
DTN News and Analysis on Twitter
»Forums Index »Archive (2017 and earlier) »IQFeed Developer Support »HTT Data Receive Speed
Author Topic: HTT Data Receive Speed (6 messages, Page 1 of 1)

DavidG
-Interested User-
Posts: 8
Joined: Sep 29, 2009


Posted: Mar 10, 2010 11:12 PM          Msg. 1 of 6
I think this may be more of a socket programming issue than an IQFeed issue, but I don't seem to be receiving tick data via HTT data at reasonable speeds.

Programming is in VS2008-VB.NET using the native socket support. In short, I use the VS2008 TCPClient class to connect to IQFeed, and assign it to a NetworkStream via .GetStream(). Two threads connect to IQFeed simultaneously, but one thread is always idle when the other is receiving data.

Upon sending the HTT request, I basically just poll the NetworkStream until .DataAvailable = true, and then grab the data using .Read when available and process it - all in a dedicated thread. The thread is idle about 97% of the time (i.e. .DataAvailable = true about 3% of the time) so it is not a processor speed issue. This is running on a new quad-core processor machine.

Also, I have an "okay" DSL connection that typically clocks just slightly under 3 Mbps receive speed.

By this method, right now I`m getting about 500-600 ticks per second. I don`t know how many bits are transmitted to get one tick, but I would think it has to be less that 300, even considering any other fruit salad that gets sent along. So, that works out to less than 0.2 Mbps.

Any suggestions as to how I might go about speeding this up? I'm wondering if I should use .BeginRead (which I believe is asynchronous) instead of .Read.

Thanks,
David.

redblue
-Interested User-
Posts: 51
Joined: Oct 29, 2009


Posted: Mar 11, 2010 03:58 AM          Msg. 2 of 6
Hi,

I don't use VS2008-VB.NET, but it's always a bad idea to poll for a socket. As you are already using threads, block on the socket instead. If you can't block (because you need to process other events) use select with a timeout. I suspect what is happening is that your poll is either too long or that you aren't reading all the data on the socket when .DataAvailable=true. You should be getting significantly faster than 500 ticks a second.

Regards,

red.

DTN_Steve_S
-DTN Guru-
Posts: 2093
Joined: Nov 21, 2005


Posted: Mar 11, 2010 11:16 AM          Msg. 3 of 6
As redblue said, you should certainly be getting much faster than 500 ticks per second.

But I am hesitant to say that the socket polling is the sole responsibility of the decreased performance that you are seeing. For example, I modified the vb example app (which also uses socket polling) to output statistics for datapoints per second for each request and was able to get significantly higher results.

I am wondering if you get similar results using the example app as you do using your own app? Let me know if you want me to email the changes I made to the vb example app to track this down.

DavidG
-Interested User-
Posts: 8
Joined: Sep 29, 2009


Posted: Mar 11, 2010 03:48 PM          Msg. 4 of 6
Hi Steve,
Please send me your VB example and I'll give that a try.
Many thanks,
David.

DTN_Steve_S
-DTN Guru-
Posts: 2093
Joined: Nov 21, 2005


Posted: Mar 11, 2010 04:31 PM          Msg. 5 of 6
Sent

DavidG
-Interested User-
Posts: 8
Joined: Sep 29, 2009


Posted: Mar 15, 2010 11:20 AM          Msg. 6 of 6
FYI: I didn't get the example working as the conversion wizard flubbed it up, and I didn't feel like manually fixing it. I did, however, try the blocking socket read method, and that - together with fixing a couple other bugs - got me up to just under 100,000 ticks/s (which I can live with).
Thanks for the help.
 

 

Time: Fri May 24, 2024 5:45 PM CFBB v1.2.0 15 ms.
© AderSoftware 2002-2003