locked
What is sharepoint warm up script?

    Question

  • I would like to know what is sharepoint warmup script?

    What is purpose?

    When it should be use?

    Is it necessary to schedule/run warm up script?

    I googled, and noticed there are various articles/scripts and everyone created differrent type script. I am not sure which one I should use and why?


    Please addvise

    • Changed type Mike Walsh FIN Friday, February 13, 2009 5:01 AM Always use the Question type. Otherwise people get no credit for answers
    Friday, February 13, 2009 2:11 AM

Answers

  • Mike is completely correct, I just wanted to try and provide a little more background on why people have scripts like this and when they may be useful to you.

    SharePoint is built upon the Microsoft .NET Framework and ASP.NET, specically the 2.0 releases of those technologies. ASP.NET is architected so that its pages are not compiled until the first time a server request is submitted to view them, which means that the server takes a little bit longer to display that content to an end user because it first has to compile the page before it can be sent. Since SharePoint is built on top of ASP.NET and uses its rendering engine to display its pages, it suffers from this issue as well. And even if a page has been previously compiled, if its code is updated or if the page has not been accessed for a period of time (I apologize, I do not know how this is) then IIS will have to recompile it when a request is submitted for it. Likewise, if you reset IIS or an IIS application pool for a SharePoint web application, the site's pages will also need to be recompiled the first time they are requested.

    Warmup scripts send a scripted request to your IIS server that forces it to recompile those pages ahead of a user's request to view them through a browser, preventing your users from seeing a delay when making that first request. That's pretty much all they do, and the only purpose most (that I'm aware of) of them serve is to "warm up" your server by having precompile your site's ASP.NET pages ahead of an actual user request.

    So when is something like this helpful? The two primary situations are in a development environment or for a demonstration of SharePoint functionality. 
    • In a development environment you are likely to be frequently submitting changes to your SharePoint code that may require an IIS or application pool reset, which means that ASP.NET must recompile a site before you can test your changes and view the results in a browser. Using a warmup script in the background can save you time, because your site is more likely to load quickly because its pages have already been compiled.
    • In a demonstration environment, speed is important. You want your site to be responsive so you can stick to your script and show your users a performant and responsive solution. If you're waiting on a page to load b/c its compiling, it can make things difficult for you as a speaker and make your audience less confident in your SharePoint presentation.
    Would I recommend something like this in a Production environment? No, for two reasons:
    1. You should not be resetting IIS or its application pools frequently in your Production environment, which means that ASP.NET will not have to recompile your pages as frequently. If you are, you likely have bigger issues than making users wait while the page gets compiled.
    2. Usage of your Production environment should be high enough that it is far more likely that a user is going to take that compilation hit than your warmup script, making it much less effective. On top of that once one user forces IIS to recompile the code, no other user will experience the problem. That means its a much smaller issue, one not worth adding another tool to track and maintain.
    Does that help?

    John

    MCTS: WSS v3, MOSS 2007, and SCOM 2007 ******* Now Available on Amazon - the SharePoint 2007 Disaster Recovery Guide: http://is.gd/da9q
    • Marked as answer by Mike Walsh FIN Friday, February 13, 2009 3:29 PM
    Friday, February 13, 2009 3:13 PM

All replies

  • It's not necessary to use one. I've never seen the need, myself.

    It speeds up initial access to a SharePoint system.

     


    WSS FAQ sites: WSS 2.0: http://wssv2faq.mindsharp.com WSS 3.0 and MOSS 2007: http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 and MOSS 2007 Books (including foreign language titles) http://wss.asaris.de/sites/walsh/Lists/WSSv3%20FAQ/V%20Books.aspx
    Friday, February 13, 2009 5:02 AM
  • Mike is completely correct, I just wanted to try and provide a little more background on why people have scripts like this and when they may be useful to you.

    SharePoint is built upon the Microsoft .NET Framework and ASP.NET, specically the 2.0 releases of those technologies. ASP.NET is architected so that its pages are not compiled until the first time a server request is submitted to view them, which means that the server takes a little bit longer to display that content to an end user because it first has to compile the page before it can be sent. Since SharePoint is built on top of ASP.NET and uses its rendering engine to display its pages, it suffers from this issue as well. And even if a page has been previously compiled, if its code is updated or if the page has not been accessed for a period of time (I apologize, I do not know how this is) then IIS will have to recompile it when a request is submitted for it. Likewise, if you reset IIS or an IIS application pool for a SharePoint web application, the site's pages will also need to be recompiled the first time they are requested.

    Warmup scripts send a scripted request to your IIS server that forces it to recompile those pages ahead of a user's request to view them through a browser, preventing your users from seeing a delay when making that first request. That's pretty much all they do, and the only purpose most (that I'm aware of) of them serve is to "warm up" your server by having precompile your site's ASP.NET pages ahead of an actual user request.

    So when is something like this helpful? The two primary situations are in a development environment or for a demonstration of SharePoint functionality. 
    • In a development environment you are likely to be frequently submitting changes to your SharePoint code that may require an IIS or application pool reset, which means that ASP.NET must recompile a site before you can test your changes and view the results in a browser. Using a warmup script in the background can save you time, because your site is more likely to load quickly because its pages have already been compiled.
    • In a demonstration environment, speed is important. You want your site to be responsive so you can stick to your script and show your users a performant and responsive solution. If you're waiting on a page to load b/c its compiling, it can make things difficult for you as a speaker and make your audience less confident in your SharePoint presentation.
    Would I recommend something like this in a Production environment? No, for two reasons:
    1. You should not be resetting IIS or its application pools frequently in your Production environment, which means that ASP.NET will not have to recompile your pages as frequently. If you are, you likely have bigger issues than making users wait while the page gets compiled.
    2. Usage of your Production environment should be high enough that it is far more likely that a user is going to take that compilation hit than your warmup script, making it much less effective. On top of that once one user forces IIS to recompile the code, no other user will experience the problem. That means its a much smaller issue, one not worth adding another tool to track and maintain.
    Does that help?

    John

    MCTS: WSS v3, MOSS 2007, and SCOM 2007 ******* Now Available on Amazon - the SharePoint 2007 Disaster Recovery Guide: http://is.gd/da9q
    • Marked as answer by Mike Walsh FIN Friday, February 13, 2009 3:29 PM
    Friday, February 13, 2009 3:13 PM
  • John:
     
    We recycle our app pools in our production farm nightly as suggested by JoelO in his blog (http://blogs.msdn.com/joelo/archive/2007/10/29/sharepoint-app-pool-settings.aspx).

    You seem to contradict Joel's recommendation for not resetting app pools in a production environment. Can you explain the contradiction?

    Regards,

    Jeffrey Oliver
    Thursday, March 05, 2009 11:37 PM
  • Jeff --

    I apologize for the delayed response, things have been crazy lately.

    Regularly recycling your application pool as recommended by JoelO is one area where you may see some benefit from using a warmup script, but I'm not completely certain of that. For some reasons I thought that the need for that app pool recycling was removed by Service Pack 1, the Infrastructure Updates, or one of the Cumulative Updates, but I couldn't find anything to support that. I did talk to a couple of other SharePoint IT Pros on Twitter and no one really had a definitive answer one way or another.

    Personally, right now I don't think I would implement that kind of recycling for my server's application pools unless I was seeing abnormal memory consumption by the worker process associated with that app pool over time. It just feels to me like something I may not actually need, and I'd rather base the decision to do it off of an actual issue rather than a recommendation. Joel's definitely the expert on stuff like this, and his post was definitely relevant at the time it was published, I just don't know if it still is after so many updates for SharePoint have been rolled out, so that's why I'm hesitant to advocate doing that in a production environment without cause.

    John

    MCTS: WSS v3, MOSS 2007, and SCOM 2007 ******* Now Available on Amazon - the SharePoint 2007 Disaster Recovery Guide: http://is.gd/da9q
    Wednesday, March 18, 2009 9:34 PM
  • Hey guys.  Great discussion. My thoughts.

     

    The warm up script was originally designed to warm up a demo box for a technology specialist demoing SharePoint.

     

    It's evolution and the concept of warming up SharePoint after an IIS recycle or App pool cycle is something that is still highly desired and who knows if we may get some type of capability in the future from pipeline from an IIS module or SharePoint Module for IIS.

     

    Essentially after an App pool is cycled you'll find it may take up to a minute or longer depending on what needs to be compiled as has been explained in these other responses.

     

    In response to the other questions brought up on whether an app pool should be cycled nightly.... YES.  I believe the default IIS behavior of naturally cycling an app pool automatically somewhere between 1am and 3am or off hours if there is such a thing is healthy to clean out the memory space in IIS.  If we lived in an ideal world where no one sinned, then we would not need this.

    I am NOT suggesting that you setup a script to do an IIS reset.  I'm not a fan of people who boot their boxes every night.  I'm simply suggesting that memory can be reclaimed by leveraging the default behavior of flushing cache and reloading.  Simply running warm up after that is a decent idea.

    I highly recommend watching the memory on your App Pool.  Try once a week and once a night and compare how much memory it uses in a 24 hour vs 1 week, and you tell me how much more it consumes.  I think you'll convince yourself that the nightly cycle is important.  Maybe some day in the future we'll never need spdisposecheck.  As for now, I'm one of those that believes we don't live in a perfect world.

    Joel

    Wednesday, March 24, 2010 6:41 PM
  • Hi Joel,

    I have a SharePoint site(Moss 2007) which is using Windows Authentication. I need a warm up script to bounce the pages. The issue that I am facing is that the warm up scripts that I am using are working correctly if there is no authentication required initially.

    I have looked at your blog

    http://blogs.msdn.com/b/joelo/archive/2006/08/13/697044.aspx and tried the script.

    The script works wonderfully well for my site which has Form Based Authentication and the pages open instantly after an IISReset.

    But In another of my site which uses windows authentication the pages do not seem to warm up. On this site before opening any page I need to authenticate by entering the credentials so I think when this warm up script runs, it does not get the authentication required and as a result is unable to warm up the pages.

    Could you please suggest me something in this case? Any suggestion will be greately appreciated.

    Thanks,

    Raj

    Friday, August 26, 2011 10:10 AM