Part of the application I'm working on is swf, which shows a test with 80 questions. Each question is stored in SQL Server through WebORB and ASP.NET.
If the candidate completes the test, the session should be verified. The problem is that sometimes 350 candidates finish their test at the same moment, and the processor on the web server and SQL Server explodes (350 confirmations at the same time).
Now, how should I implement the queue here? The database has a table in which there is an entry for each session. One column contains status. 1 completed, 2 verified.
I could implement the order in two ways (as I see, maybe you have other suggestions):
- A process that checks the table for records with status 1. If it finds one, it checks the session. In this way, sessions are checked one by one.
- If the candidate ends his session, the message is sent to the MSMQ queue. Another process listens for the queue and checks the sessions one by one.
Now:
- What would be a better approach?
- Where do you start the process that will check the sessions? In your global.asax (application_start)? How is the windows service? How to exe in the root of the site that is running in application_start?
It’s most convenient for me to use a table and look for records with status 1.
source
share