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)




"Everything is working great with the API. I love it." - Comment from Calvin
"I've never had DTN go out on me since switching. ******* would go down a couple times every month when I was using them." - Comment from Bryce in AL.
"If someone needs the best quality data and backfill beyond what their broker provides at a rate that is the best in the industry, I highly recommend IQFeed." - Comment from Josh via Public Forum
"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
"Excellent datafeed !!!" - Comment from Arely
"Very impressed with the quality of your feed - ******* is a real donkey in comparison." - Comment from A.C. via Email
"I noticed that ******* quotes locked up shortly after the interest rate announcement yesterday while yours stayed stable." - Comment from Ron in Utah
"I will tell others who want to go into trading that DTN ProphetX is an invaluable tool, I don't think anyone can trade without it..." - Comment from Luther
"After all the anxiety I had with my previous data provider it is a relief not to have to worry about data speed and integrity." - Comment from Eamonn
"I was with ******* for 4 years at $230 a month, this is a huge savings for me, GOD BLESS YOU PEOPLE," - Comment from T.S. 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 »when busy trading,CPU usage up to 100%
Author Topic: when busy trading,CPU usage up to 100% (4 messages, Page 1 of 1)

milcloud
-Interested User-
Posts: 8
Joined: Oct 14, 2016


Posted: Oct 21, 2016 10:34 AM          Msg. 1 of 4
we just register about 40 symbols from iqconnect, such as CL,HG,GC,SI and so on.
during day trading, when the trading is busy, the traffic form iqconnect will up to 600kb/s some time 1000kb/s ,then cpu will run up to 100%, and when that happens, the tick will stay in buffer, and our software can not deal it as qucik as the new tick reached.

the software we receive tick do not do much complex work, just parse the tick line form iqconnect and convert to the struct we need.

my process method:
1.recv string line form iqconnect in threadA and put tick string in RingBuffer
2.parse the string line in another threadB

server: 2Core 2G Windows2003
language: C#

so questions
1.any other one meet this problem too? how to deal this problem.
2.do iqfeed provider snapshot of the tick such as 250ms or 500ms? then we will no need do handle so much Ticks.



i have put the tick parse function in the attachment.
Edited by milcloud on Oct 21, 2016 at 10:35 AM
Edited by milcloud on Oct 21, 2016 at 10:37 AM



File Attached: parse_function.txt (downloaded 1586 times)

milcloud
-Interested User-
Posts: 8
Joined: Oct 14, 2016


Posted: Oct 21, 2016 10:39 AM          Msg. 2 of 4
i saved the statistic of server as attachement.



File Attached: server statistic.png (downloaded 1214 times)

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


Posted: Oct 21, 2016 02:21 PM          Msg. 3 of 4
Unfortunately we don't provide a snapshot data option at this time and if implemented, the likely lower limit would be 1s.

With that said, I took a look at the code you provided and the obvious thing that jumps out at me is the use of String.Split. This function allocates a new array and a new string object for each and every field on each and every message. When dealing with potentially thousands of messages per second (possibly 10s of thousands), this is going to be very inefficient, especially since these are temporary objects and you are immediately converting the fields to binary. In order to efficiently process the feed, you need to eliminate as many of these types of temporary variables as possible in your processing.

Also, make sure you are using the dynamic fieldsets feature of the feed to eliminate any fields that you aren't interested in processing. I can't tell from the code snipit if you are using this or not but make sure you are.

milcloud
-Interested User-
Posts: 8
Joined: Oct 14, 2016


Posted: Oct 22, 2016 08:01 AM          Msg. 4 of 4
i use dynamic fieldsets, and thanks for your suggestion, i will try to get some efficient way to handle this problem.

thanks.
 

 

Time: Fri May 17, 2024 4:07 AM CFBB v1.2.0 13 ms.
© AderSoftware 2002-2003