c# - Best design for long process in Web Service -
i have design question on how best approach process within existing dotnet2 web service have inherited.
at high level process @ moment follows
client
- user starts new request via web service call client/server app
- request , tasks created , saved database.
- new thread created begins processing request
- request id returned client (client polls using id).
thread
- loads request detail , multiple tasks
- for each task requests xml via service (approx 2 sec wait)
- passes xml service processing (approx 3 sec wait)
- repeat until tasks complete
- marks request completed (client know finished)
overall takes approximately 30 seconds request of 6 tasks. each task being performed sequentially inefficient.
would better break out each task again on separate thread , when complete mark request completed?
my reservation duplicating number of threads factor of 6-10 (number of tasks) , concerned on how impact on iis. estimate cut normal 30 second call down around 5 seconds if had each task processing concurrently under load design suffer?
the current design operating , users have no problem time taken process prefer work faster if possible.
is bad design , if there better approach? limited current dotnet version @ present.
thanks
if worried iis performance want keep jobs outside of iis, imo consider queueing tasks , creating separate service work. approach more scaleable in add or remove front end iis servers or task processors address varying load. large-scale system perform processing off of front end server.
Comments
Post a Comment