An IIS website is defined with an application pool having 4 worker processes. So, when looking in the Task Manager, we see 4 w3wp.exe.
On their first hit, each of those instance will initialize and load things in memory.
This occurs when a deployment happens. Thus, when new DLLs are being sent, the first hit on each of them will take longer as it will go through an initializing process loading the data dictionary in memory and so on.
The problem I have detected is that, sometimes, once a deployment occurs, the IIS worker process in memory does not detect that a new version of the DLLs is in place. Thus, it never goes in the initialization process for the first hit.
Basically, I rely on this for the detection.
Public Class App
Public Shared oApp As App = New App()
Public lInitialize As Boolean = False
End Class
This is a shared object that remains in memory, once initialized, for all incoming hits.
Then, on each hit, I have something like this:
If Not oApp.lInitialize Then
oApp.lInitialize = True
End If
Only in the first hit, it should go in that condition. As oApp is shared, its variable oApp.lInitialize should follow.
However, for some kind of reason, very rarely, once I send a new compile, an instance of the IIS Worker Process does not recognize that a new compile has been sent, thus it never restarts, resulting in never entering that condition.
Anyone would know what could cause this?