I have a WCF application hosted on Windows Azure. It has IIS v8.0
I used the IProcessHostPreloadClient's Preload() method to warm up the application
Now I have two questions:
1) whenever my application pool is processed, the Preload() function is called twice. I have some static variables that are initialized in the Preload() method, which will be saved in my workflow (w3wp.exe) .
What I saw is interesting:
My current workflow ID ( w3wp.exe 1234 , say)
when reused, preload is called twice:
1st time: in w3wp.exe, which has Process ID : 5678 , say (new workflow)
2nd Time: in w3wp.exe, which has Process ID: 1234 (same as output)
Now I have configured my application pool so that there is only one instance of w3wp.exe. Therefore, after reprocessing, there is w3wp.exe that exists, this is the process identifier: 5678.
My question is why the dying w3wp.exe with process id: 1234 preloaded
Between them there is a gap of 3ms.
EDIT I just found out that this is exactly what happens due to the utilization of the pool application, the old w3wp.exe terminates and the new w3wp.exe starts. What causes the preload call twice:
1) new process w3wp.exe - calls preload () to call a new process (process ID: 5678 in our example)
2) the old w3wp.exe process (process ID: 1234): its application domain is restarted before it is destroyed. Therefore, when the application domain restarts, preload () is called
Now, my question is why the last app domain w3wp.exe was restarted. He was going to die anyway in the next 3 ms (as mentioned above)
2) I started the service and I did some testing. Meanwhile, for some time, the workflow did not serve any requests. But my w3wp.exe has a thread that runs continuously.
After some time, we observed that the existing instance of w3wp.exe (process identifier 1234, say) ended abruptly and preload () was called in the same process ( w3wp.exe with process identifier 1234)
I guess for some reason the preload was called again. I used to think that preload will be called only when a new w3wp.exe is created (in turn, this means that the application pool has processed)
This behavior has been observed twice. Can someone tell me something about this?
EDIT
Answer: Partial: due to restarting the application. I still donβt know why the domain application was restarted