Tag Archives: IIS

Speed up SharePoint using the IIS Blobcache

Requirement

You can turn on the disk-based caching feature in IIS for your SharePoint sites. By default, this stores picture, video, and audio files on disk so that the files do not need to be retrieved again from the SQL server. This can greatly improve the end-user experience as large files are retrieved much faster. It also reduces the load on the SQL server having to send the file to the web front end server each time it is accessed.

Solution

To configure the Blobcache in IIS:

  1. Open IIS Manager
  2. Right click on your SharePoint site and click explore.
  3. Open the web.config file in Notepad
  4. Locate the line <BlobCache location
  5. At the end of the line, change the enabled=”false” to enabled=”true”.
  6. You may wish to configure the maxSize as well, this specifies the maximum size of the entire Blob cache.

Recommenadations:

It is recommended to set the location on the blob cache to a disk other than the disk you use for your server logs or paging file, so as to reduce issues that may arise due to disk contention.

For more information, refer to the following links:

http://technet.microsoft.com/en-us/library/cc770229(v=office.14).aspx

http://msdn.microsoft.com/en-us/library/aa604896(v=office.14).aspx

 

Comments ( 0 )

Remote Blob Storage Maintainer Configuration

Requirement

When you implement Remote Blob Storage for SharePoint 2010, you also need to configure the RBS Maintainer as a scheduled task on your SharePoint database server in order to periodically clean the blob stores from orphaned objects (files that have been permanently removed from SharePoint do not get automatically deleted from the blob store!).

Solution

Step 1 – Install the Remote Blob Storage tool from Microsoft on your SQL Server

You may download the tool from http://www.microsoft.com/en-us/download/details.aspx?id=26728

Assuming that you have already configured RBS on your SharePoint farm, you will need to run the following command to install the tool.

Open an administrator Command Prompt and type the following in:

msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi DBNAME=”WSS_Content” DBINSTANCE=”DBInstanceName” ADDLOCAL=Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer

Replace WSS_Content and DBInstanceName to suit your environment as required.

Check the rbs_install_log.txt file and look for the line at near the bottom of the file ‘Product: SQL Server 2008 R2 Remote Blob Store — Installation completed successfully.’

Step 2 – Configure the RBS Maintainer

Assuming you have installed the 64 bit version of the tool, browse to C:\Program Files\Microsoft SQL Remote Blob Storage 10.50\Maintainer and type the following commands:

Note that you only need to do the following if you have configured RBS on more than one database. The first RBS database should already exist in the file and its default ConnectionStringName is RBSMaintainerConnection

Decrypt the configuration file using ASPNET_REGIIS

rename Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config web.config
c:\windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pdf connectionStrings .

*Note that the word connectionStrings is case sensitive.

Add the connection strings to all your RBS enabled databases

Add your connection strings following the same format as the existing one. MAke sure you add it under <connectionStrings>here</connectionStrings>

Encrypt the configuration file using ASPNET_REGIIS

c:\windows\Microsoft.NET\Framework\v2.0.50727\-pef connectionStrings . -prov DataProtectionConfigurationProvider
rename web.config Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config

Step 3 – Set the RBS Maintainer to run as a scheduled task

Go to Start -> Administrative Tools -> Task Scheduler

Create a new Basic Task called ‘RBS Maintenance’ and give it a useful description.

Under actions -> Set it to ‘Start a program’.

Browse to “C:\Program Files\Microsoft SQL Remote Blob Storage 10.50\Maintainer\Microsoft.Data.SqlRemoteBlobs.Maintainer.exe”

Add arguments (optional): -ConnectionStringName RBSMaintainerConnection -Operation GarbageCollection ConsistencyCheck -GarbageCollectionPhases rdo -ConsistencyCheckMode r

Click OK to Save

Set the task to run however often you like, it is preferable to run the RBS Maintainer after-hours.

Testing

The default Garbage collection period is 30 days, this means that only objects that have been orphaned for more than 30 days will be deleted by the RBS Maintainer. For your testing purposes, you may wish to reconfigure this to delete immediately, but be sure to change it back to 30 days once you have finished testing.

To set Garbage collection to delete immediately:

exec mssqlrbs.rbs_sp_set_config_value 'garbage_collection_time_window', 'time 00:00:00';
exec mssqlrbs.rbs_sp_set_config_value 'delete_scan_period', 'time 00:00:00';
exec mssqlrbs.rbs_sp_set_config_value 'orphan_scan_period', 'time 00:00:00';

To set it back to 30 days:

exec mssqlrbs.rbs_sp_set_config_value 'garbage_collection_time_window', 'days 30';
exec mssqlrbs.rbs_sp_set_config_value 'delete_scan_period', 'days 30';
exec mssqlrbs.rbs_sp_set_config_value 'orphan_scan_period', 'days 30';

Note that you must delete the files from the End User Recycle bin for RBS to recognise that the file has actually been deleted.

Another thing to take note of is that the blob files only get deleted after 2 log backups and 2 checkpoints on the database. This is when the garbage collector deems that the files are no longer needed. To test this:

  • Backup your database log file
  • Type the command ‘checkpoint’ -> Execute
  • Backup your database log file
  • Type the command ‘checkpoint’ -> Execute

Browse to your blob store, the blobs should now be deleted from the file system.

Comments ( 1 )

Central Administration Site 503 error and Application Pool crashes

Problem

You install SharePoint 2010 and just after running the SharePoint Farm Configuration Wizard, you browse to the Central Administration Site. However, you get a 503 error and the page does not load. After checking IIS Manager, you find the application pool process for the Central Administration site has stopped. You restart it and browse to the site, only to find that browsing to the site actually crashes the application pool process.

Solution

Check to ensure that all your SharePoint application pool processes have ‘Enable 32-Bit Applications’ set to False.

Run Inetmgr -> Application Pools

Select your SharePoint Application Pool -> Advanced Settings -> Enable 32-Bit Applications

Set the value to False.

Do an IISReset /noforce

Comments ( 1 )

Improving SharePoint performance using IIS compression

Requirement

With the roll-out of SharePoint over WAN links to different parts of the business, we have had to look at squeezing every bit of performance we could out of SharePoint. A big part of this was to reduce page / file size so as to reduce the amount of bandwidth required.

Solution

We decided to experiment with IIS compression and the results were rather favorable. Upon enabling IIS compression, the page size of our Intranet was reduced by 26%.

To enable IIS compression, log in to each of your Web Front End servers and do the following:

Open Command Prompt using ‘Run as Administrator’.

Type the following command:

%windir%\system32\inetsrv\Appcmd.exe set config -section:httpCompression -[name='gzip'].staticCompressionLevel:9 -[name='gzip'].dynamicCompressionLevel:7

followed by:

%windir%\system32\inetsrv\Appcmd.exe list config -section:httpCompression

If it worked, you should see that ‘staticCompressionLevel’ and ‘dynamicCompressionLevel’ has been configured.

Do an IISRESET /noforce on each of your Web Front Ends for the changes to take effect.

It is a good idea to run a program like ‘Fiddler’  so that you can check the difference before and after applying compression.

You can set both dynamic and Static compression levels to a value between 1 and 9, with 9 being the most resource intensive and highest compression. Typically, you would allow higher compression on Static files and less compression on dynamic ones so as not to overload your web front ends. Play around with the values and find out what is best for your environment.

Implications

Always test your changes in a test environment prior to applying it on your production systems :-). Enabling compression puts an additional load on your web front ends, especially on CPU. If your web front ends are already struggling, I would suggest you hold off until you get more resources for your SharePoint environment.

 

Comments ( 0 )

Changing service accounts in SharePoint 2007

Requirement

We have an old installation of SharePoint 2007 that functions as a stand-alone server. Recently, it has been running out of space so I decided to move the database to a separate server. My approach was to do detach the database from the old server, copy it to the new server, and re-attach it.

Problem

I found that all the service accounts on the old SharePoint server was using ‘Network Service’. This resulted in the following error when I tried to re-attach the content database.

SQL Database ‘SP_CONTENT’ on SQL Server instance ‘<new dbserver>’ not found. Additional error information from SQL Server is included below.

Cannot open database “SP_CONTENT” requested by the login. The login failed.

Login failed for user ‘domain\<servername>$’.

Solution

One approach was to use the following SQL command to give domain\<servername>$ access to the database in question:

CREATE LOGIN [domain\server$] FROM WINDOWS;

This would work but would also cause a security risk, since anyone with access to our old SharePoint server could easily break into the database server.

The next approach was to change the service accounts from ‘Network Service’ to domain accounts and assign the required permissions on the database server. I used the following command to do so:

stsadm -o updatefarmcredentials -userlogin DomainName\UserName -password NewPassword

This command updates the ‘Windows SharePoint Services Timer’ service account and the Central Administration IIS pool account.

I then reconfigured all our web applications to use domain accounts using Central Administration -> Operations -> Service Accounts

After performing the above steps, the database attach work perfectly and my site collection was up and running without any problems.

Comments ( 0 )