Click here to Skip to main content
13,259,427 members (55,578 online)
Rate this:
 
Please Sign up or sign in to vote.
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 11-May-15 7:38am
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


Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 11 May 2015
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100