Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharepoint site takes a while to load first thing in the morning

Our team has built a site using Sharepoint and a few custom webparts. We've noticed that the site takes a while to load when first accessing the site in the morning. Subsequent accesses are fine. We suspect that Sharepoint is reindexing its lists, etc.

Has anyone else seen this problem with Sharepoint? Does anyone have a suggested fix?

like image 880
Fuzzy Purple Monkey Avatar asked Dec 11 '08 03:12

Fuzzy Purple Monkey


2 Answers

By default an IIS application will recycle its worker processes during the night. You can turn this off in IIS manager, but a better option may be to just add a warmup script to a timed job. You can do this in SharePoint but simpler is probably to just add a scheduled task in Windows to fire off the a warmup script after the recycling is done.

A google for "sharepoint warmup script" will yield several results, including this, which actually also explains the same situation :-)

like image 149
Bjørn Furuknap Avatar answered Oct 26 '22 21:10

Bjørn Furuknap


My guess is that the application pool's worker processes are set to recycle at a certain time every night in IIS, which causes the delay first thing in the morning. Right-click the application pool in IIS -> Properties -> and look under where it says "Recycle worker processes at the following times:" to see for yourself.

You could disable this option to fix your problem but I don't recommend it because having the worker processes recycle every night will reclaim any memory that may have leaked. Memory leaks are especially possible during SharePoint development because as you may know many of the objects in the SharePoint object model perform most of their work in unmanged memory. If these objects are not properly disposed of a large amount of memory may be occupied while adding little memory pressure on the .NET garbage collector, delaying garbage collection.

Best Practices: Using Disposable Windows SharePoint Services Objects

I agree with seanb's suggestion of setting up a scheduled task to load the site in the morning to solve the delay problem. Just make sure you schedule it for a time after the worker processes have recycled obviously.

like image 43
Mike Rodey Avatar answered Oct 26 '22 19:10

Mike Rodey