I have a .NET Windows Service that has a timer with interval set to 10 seconds. Every 10 seconds, it queries the database for any work to be done, picks up top 3 work items and processes them. The time taken to process each work item would depend on the user. It might range from a few seconds to several minutes.
I feel that 10 seconds is too short. I picked a low interval as the user is waiting for the process to be completed (they see a progress bar in the front end) and the faster the service picks up the work, the better. Also, the # of work items (three) was picked in random.
I do have "lock(this)" in my code to prevent one thread from stepping over the other. Is a short duration of 10 seconds okay in production environments?
EDIT: Also, does it make sense that I am picking only 3 items every time to be processed.