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)




"IQ feed is brilliant. The support is mind-bending. What service!" - Comment from Public Forum Post
"I am very pleased with the DTNIQ system for quotes and news." - Comment from Larry
"IQFeed version 4 is a real screamer compared to anything else I have seen." - Comment from Tom
"Awesome response, as usual. It is a sincere and refreshing pleasure to do business with DTN, compared to your competition." - Comment from Ryan
"If you want customer service that answers the phone, your best bet is IQFeed. I cannot stop praising them or their technical support. They are always there for you, and they are quick. I have used ****** too but the best value is IQFeed." - Comment from Public Forum
"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
"Thank God for your Data Feed as the only Zippers I see are on my pants (LOL), and no more 200 pip spikes to mess up charts." - Comment from Spiro via Email
"I would just like to say that IQFeed version 4 is running very well and I am very happy with its performance. I would also like to extend a big thanks for the fast and efficient help that I always receive. My questions and concerns are always addressed promptly. Way to go!" - Comment from Josh in CO.
"I was on the phone with a friend who uses CQG and right after the Fed announcement, CQG was as much as 30 seconds behind DTN.IQ. Some quotes were off by as much as 15-18 cents. Your feed never missed a beat." - Comment from Roger
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
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 17, 2024 10:58 PM CFBB v1.2.0 27 ms.
© AderSoftware 2002-2003