I have a Windows Service which executes large number of tasks in parallel using the Task Parallel Library (TPL). This is about to be extended to handle tasks which interact with an SQL Server on an external server.
TPL is supposed to be good at measuring load and assigning the right number of parallel threads to the tasks. Is there a way to make it aware of load to the external SQL Server instance? The actual code to run for each task on the local server is quite small, but the calls to the database can be quite heavy.
Am I not likely to end up with my service bogging down the database with request because TPL sees that the local server has loads of free resources, or is there a known way to handle this?