Reputation:
In my web service that takes about one hour and half to get its work done I am doing my processing in it in a Task.Factory.Run()
method and my web service was inside the default application pool
in IIS
on the VM machine. After about 30 minutes my WebService stopped working. I went to windows event log and its was default application pool was shut down after 20 minutes due to inactivity on the worker thread.
So does that mean this is the reason my WebService also stopped working? And if yes they why does it think it was inactive? Is it because of Task.Factory.Run()
?
Upvotes: 0
Views: 260
Reputation: 116636
This is indeed the reason. The web service was inactive because it didn't receive any requests.
WebServices
should be a stateless layer for requests and responses, handled by the application pool. If you need to perform long term processing, you should do it in a different process (for example, a windows service you queue work for using WCF inter-process communication).
Upvotes: 1