Wake Up Windows Sharepoint Services

Se si apre un sito Sharepoint dopo periodo di inutilizzo occorre attendere che il sito venga caricato, il comportamento non è un issue, ma è devuto al fatto che probabilmente è intervenuto il worker process cycle di IIS come spiegato in questo post Warm Up your SharePoint Servers…

“Ever thought things on ASP.NET were a bit slow the first time accessing them?  Many of you are aware that ASP.NET from a web admin perspective know that things have to recompile and things just aren’t as fast the first time.  In fact some times things are incredibly slow the first time and are incredibly slow.  Ever had users say, for some odd reason some times when I hit my SharePoint site it takes 30 seconds to load, then after a refresh it goes sub second, even clearing their cache the page is fast.  That’s because it’s not a user issue, its simply compiling, caching, etc… on the server after an IISReset or app pool reset or worker process cycle.”

Nel post è suggerito un metodo per ovviare al problema, ripreso poi in questo progetto SPWakeUp – Wake up your Sharepoint and WSS Sites che implementa un’applicazione per SharePoint.

In alternativa, dal momento che in IIS per default il recycle del worker process avviene ogni 120 minuti, è anche possibile schedulare durante l’orario di lavoro l’esecuzione ogni 90 minuti di uno script che esegue la richiesta dei siti che si desidera mantenere attivi.

Option Explicit
Dim objHTTP
Dim text

Set objHTTP = CreateObject(“MSXML2.XMLHTTP”)

objHTTP.Open “GET”, “http://localhost”, false
objHTTP.Send()
text = objHTTP.ResponseText
WScript.Echo(text)

objHTTP.Open “GET”, http://localhost/site01, false
objHTTP.Send()
text = objHTTP.ResponseText
WScript.Echo(text)

objHTTP.Open “GET”, http://localhost/site02, false
objHTTP.Send()
text = objHTTP.ResponseText
WScript.Echo(text)

Set objHTTP = Nothing