We are currently enhancing an ASP.NET app that performs quotes on a number of products.
At present the existing quote engine is basically a big stored procedure (2-3 secs per call) followed by a small amount of business logic that runs after the procedure call.
We are looking into multi-threading the call to each product in order to speed up a set of quotes.
Our current approach is to encapsulate each product quote work in a ThreadPool thread. This seems to perform much better, but I'm a little concerned that though it's performing well with a small number of users, will it scale well in a production environment?
Please note at present we are not using async ADO.NET methods.
Note: Our code that calls the ThreadPool has a throttle that queues requests so we can only use a configurable amount of threads from the ThreadPool at one time. We also don't need to wait for the quote results on the same page, we allow the user to progress and check for updates (a quote results page uses AJAX to check for results).
Further note: The preferred solution would be to use a message queue as the quote service is a one-way operation. However, the timescales for the project didn't provide us time to do this.
In the meantime we are going to revise the implementation to use the async methods of ADO.NET (as that is where all the long running aspect of the process is) saving the need to use ThreadPool threads.