Optimizing order processing across multiple ASP.NET websites

I’ve built about 10 different ASP.NET websites for a client and each one handles order creation differently. Right now I’m using a console app that goes through each site one by one to check for pending orders that need processing. This approach isn’t working well because when one site has lots of orders (like 1000+ waiting), all the other sites have to wait their turn.

I’m thinking about a few solutions:

  1. Using separate threads for each site with some kind of limit
  2. Maybe using SQL Server Agent to trigger web service calls

What would be the best way to handle this? The websites are built with ASP.NET WebForms, C# and SQL Server 2008. I need something that can process orders from multiple sites at the same time without one site blocking the others.

honestly i’d go with option 2 - sql server agent jobs are pretty solid for this kinda thing. set up seperate jobs for each site and schedule them to run every few minutes. way less complex than threading and you dont have to worry about memory leaks or crashes taking down the whole process. been using this approach for years and it just works.

I encountered a similar bottleneck when managing multiple client portals that processed transactions independently. The threading approach you mentioned works well, but I’d recommend implementing a task-based solution using TPL (Task Parallel Library) instead of raw threads for better resource management. Create a main service that spawns parallel tasks for each website, with each task handling its own database connection and order processing loop. Use Task.Factory.StartNew() with a bounded task scheduler to prevent resource exhaustion. This way, a site with 1000 orders won’t block others since each runs independently. For SQL Server 2008, consider adding a priority column to your orders table. Process high-priority orders first within each site’s task. Also implement proper connection pooling and use async/await patterns where possible to avoid thread blocking during database operations. The key improvement over your current approach is concurrent processing rather than sequential. Each website gets its own processing thread that runs continuously, checking for new orders at regular intervals.

curious about your database setup - are all 10 sites sharing the same sql server instance or seperate ones? this could really impact which approach works best. also wondering how many orders per hour you’re typically processing across all sites combined?