Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I write a multi thread socket program that listen to 10 ports and receive data then save data to my database. although i use tasks but execution of my program very slow. this program slow where it work with database.
how i can speed up my program with parallel class and task?

What I have tried:

i have try speed up my task for saving data in database
Posted
Updated 24-May-16 9:29am
Comments
Richard MacCutchan 24-May-16 4:05am    
Without more information it is anyone's guess.

Relational databases were not designed for rapid ingest of data, try looking at non-relational data stores like Key/Value, Document etc.

RaptorDB - The Document Store[^]
 
Share this answer
 
Comments
Member 7956511 24-May-16 15:32pm    
i do not familiar with non-relational data stores and work with these
Matt T Heffron 24-May-16 16:54pm    
This is making a huge assumption that the problem is overwhelming the database.
It could be a poor implementation of multi-threading.
Like Richard MacCutchan stated, there really isn't enough information to know where the bottleneck is.
Without gaining much more information I think that using Parallel programming or tasks are not the best tool for the job. Have a read of this

Listen on multiple ports.[^]
 
Share this answer
 
v2
I use tasks and parallel programming but I do not know how to save(insert) data into my database with tasks and parallel
 
Share this answer
 
Comments
Matt T Heffron 24-May-16 16:50pm    
Don't post a comment on someone else's solution as a new Solution.
Use the "Have a Question or Comment?" button below the Solution.
Or in the case of replying to a comment, use the "Reply" button next to the comment.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900