Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have developed a .NET windows service which polls for a timer interval and fetches data from the database. Then the application, builds some XML file and sends across the xml files to a web service and receives response. The application uses Parallel.Foreach loop to get parallely process all the records fetched from database.

The ParallelOptions object is created and a configurable MaxDegreeOfParallelism is assigned to the object. (The value is set to 5 in app.config).


The application works fine with limited records in database. But the records went to 1000+ and from which I need to read 100 of records and do the parallel processing.(construct the xml file and send to webservice and get response).

Please let me know the best way to get the maximum parallel performance from the above scenario.
Posted
Comments
virusstorm 11-May-15 13:13pm    
The first question I have, what is the desired performance you are looking for? The .NET parallel library is very powerful, but still has it limits. Keep in mind that parallel operations are meant for CPU related tasks. When you are working with networking and disk I/O, parallel operations will often not work as intended.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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