Tuesday, May 13, 2014

Tune your SharePoint Farm for better performance Part 2: BLOB Cache and Remote BLOB Storage RBS


1- Enabling BLOB Cache:
To enable the BLOB cache you just need to modify some parameters in your web.config
find the the following line:
<BlobCache location="" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$" maxSize="10" enabled="false" />

change the enabled attribute, from "false" to "true".
choose the location by changing the location attribute example: location="D:\BlobCache"

2- Install and configure RBS in your SharePoint Farm:
-Enable FILESTREAM on the database server
By default, the FILESTREAM feature is installed when you install SQL Server 2008. But it is not enabled. You must enable and configure FILESTREAM on the computer that is running SQL Server 2008 that hosts the SharePoint 2013 databases. You must:
Enable FILESTREAM for file I/O streaming access.
Allow remote clients to have streaming access to FILESTREAM data.

follow these steps:

  • Go to SQL Server Configuration Manager and right-click SQL Server Services to open it.
  • Right-click on the instance of the SQL server on which you’re enabling FILESTREAM and select Properties.


  • Select the FILESTREAM tab and check the box to Enable FILESTREAM for Transact-SQL access.
  • Type the name of the Windows share.
  • Select Allow remote clients to have streaming access to FILESTREAM data, then select Apply.


  • Next, open the SQL Server Management Studio, then click on Query.
  • Type the following command in the Query editor (also shown in the image below). When completed, execute the command.
  • EXEC sp_configure filestream_access_level, 2
    RECONFIGURE
  • When the query completes, restart the SQL services.
Provision a BLOB store for each content database:
To provision a BLOB store

  1. Confirm that the user account performing these steps is a member of the db_owner fixed database role on each database that you are configuring RBS for.
  2. Click Start, click All Programs, click Microsoft SQL Server 2008, and then click SQL Server Management Studio.
  3. Connect to the instance of SQL Server that hosts the content database.
  4. Expand Databases.
  5. Click the content database for which you want to create a BLOB store, and then click New Query.
  6. Paste the following SQL queries in Query pane, and then execute them in the sequence listed. In each case, replace [WSS_Content] with the content database name, and replace c:\BlobStore with the volume\directory in which you want the BLOB store created. The provisioning process creates a folder in the location that you specify. Be aware that you can provision a BLOB store only one time. If you attempt to provision the same BLOB store multiple times, you'll receive an error.

use [WSS_Content]
if not exists 
(select * from sys.symmetric_keys 
where name = N'##MS_DatabaseMasterKey##')
create master key encryption by password = N'Admin Key Password !2#4'
use [WSS_Content]
if not exists 
(select groupname from sysfilegroups 
where groupname=N'RBSFilestreamProvider')
alter database [WSS_Content]
add filegroup RBSFilestreamProvider contains filestream
use [WSS_Content] 
alter database [WSS_Content]
 add file (name = RBSFilestreamFile, filename = 
'c:\Blobstore') 
to filegroup RBSFilestreamProvider
Install the RBS client library on each web server


To install the RBS client library on the on the first web server
Confirm that the user account performing these steps is a member of the Administrators group on the computer where you are installing the library.
On any web server, browse to http://go.microsoft.com/fwlink/p/?LinkId=271938 and download the RBS_amd64.msi file.
Click Start, click Run, type cmd into the Run text box, and then click OK.
Copy and paste the following command into the Command Prompt window. Replace WSS_Content with the database name, and replace DBInstanceName with the SQL Server instance name. You should run this command by using the specific database name and SQL Server instance name only one time. The action should finish within approximately one minute.


  • msiexec /qn /lvx* rbs_install_log.txt /i RBS_amd64.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_Content" DBINSTANCE="DBInstanceName" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1
    
  • To install the RBS client library on all additional web and application servers
    Confirm that the user account performing these steps is a member of the Administrators group on the computer where you are installing the library.
    On any web server, browse to http://go.microsoft.com/fwlink/p/?LinkId=271938 and download the RBS_amd64.msi file.
    Click Start, click Run, type cmd into the Run text box, and then click OK.
    Copy and paste the following command into the Command Prompt window. Replace WSS_Content with the database name, and replace DBInstanceName with the name of the SQL Server instance. The action should finish within approximately one minute.

    1. msiexec /qn /lvx* rbs_install_log.txt /i RBS_amd64.msi DBNAME="WSS_Content" DBINSTANCE="DBInstanceName" ADDLOCAL=Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer
    Repeat this procedure for all web servers and application servers in the SharePoint farm.
    To confirm the RBS client library installati
    on
    The rbs_install_log.txt log file is created in the same location as the RBS_amd64.msi file. Open the rbs_install_log.txt log file by using a text editor and scroll toward the bottom of the file. Within the last 20 lines of the end of the file, an entry should read as follows: Product: SQL Remote Blob Storage – Installation completed successfully.


    On the computer that is running SQL Server 2008, verify that the RBS tables were created in the content database. Several tables should be listed under the content database that have names that are preceded by the letters "mssqlrbs".

    Enabling RBS for each content database
    To enable RBS by using Windows PowerShell

    Start the SharePoint 2013 Management Shell.
    For Windows Server 2008 R2:
    On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.
    For Windows Server 2012:
    On the Start screen, click SharePoint 2013 Management Shell.
    If SharePoint 2013 Management Shell is not displayed on the Start screen:
    Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.
    At the Windows PowerShell command prompt, type the following command:
      1. $cdb = Get-SPContentDatabase <ContentDatabaseName>
        $rbss = $cdb.RemoteBlobStorageSettings
        $rbss.Installed()
        $rbss.Enable()
        $rbss.SetActiveProviderName($rbss.GetProviderNames()[0])
        $rbss 



    Where: <ContentDatabaseName> is the name of the content database.


    Test the RBS installation

    You should test the RBS installation on one web server in the SharePoint farm to make sure that the system works correctly.To test the RBS data store

    On the computer that contains the RBS data store, click Start, and then click Computer.

    Browse to the RBS data store directory.

    Confirm that the folder is empty.

    On the SharePoint farm, upload a file that is at least 100 kilobytes (KB) to a document library.

    On the computer that contains the RBS data store, click Start, and then click Computer.

    Browse to the RBS data store directory.

    Browse to the file list and open the file that has the most recent changed date. This should be the file that you uploaded.


    reference Technet article.

    No comments:

    Post a Comment