Monday, April 2, 2012

Disk-based BLOB caching SharePoint 2010

This section describes the disk-based BLOB cache, and provides important information about how to plan to use the cache with a SharePoint deployment. It tells how to decide when to use the BLOB cache, where to store it, how to enable it, and how to configure the size of the cache in order to get the best performance for users.

BLOB cache overview

The disk-based BLOB cache controls the caching for binary large objects (BLOBs), such as frequently used image, audio, and video files, and other files that are used to display Web pages, such as .css and .js files. The BLOB cache is enabled on a front-end Web server and improves performance by retrieving BLOB files from the database and storing them in a directory on the front-end Web end server where they are served to users. This reduces the network traffic to and load on the database server.
The BLOB cache also provides features that support serving media files to users. One such feature is support for byte-range requests, which lets users select a later point in the video and immediately begin playback. Another feature is progressive caching, which starts serving the beginning of a large video file while the rest of the file is being cached. Video files are divided and retrieved in smaller sections to reduce the load between the front-end and back-end servers. An administrator can configure the size of the sections

Decide whether to use the BLOB cache

When enabled, the BLOB cache caches various image, audio, and video files, together with .css and .js files. An administrator can modify the settings to add or remove file name extensions of file types to be cached. This functionality lets you either cache as many file types as possible, or to restrict the cache to certain kinds of files. For example, if you have an Internet-facing portal with read-only files such as .doc or .pdf files, you can specify that those files be cached so that they are displayed more quickly to users. If you have a collaboration site that contains files that are frequently updated, as well as media assets, you can specify that the cache is to store only audio or video types by including only file name extensions for those files in the cache settings.
Before you enable the BLOB cache, carefully consider the scenario in which you plan to use it. If your site will be used for heavy collaboration, enabling the BLOB cache might temporarily affect the performance of your site while the files to be cached are first written to the disk. After the files have been stored in the cache, site performance will improve, so take this into consideration when you decide whether or not to enable the cache. Base your decision to enable BLOB caching on the following criteria:
  • For a publishing site for which most of the visitors are anonymous or where most of the files are static content, enable the BLOB cache for as many file types as possible.
  • For other sites that contain lots of media assets that are read-only, or where only a small percentage of the media assets are updated, enable the BLOB cache for media files only.
There is one BLOB cache per Web application. If you plan to use the BLOB cache together with an asset library that you expect will be large, or together with a site that will receive lots of traffic, consider putting the site collection that contains the asset library into its own Web application so that it receives its own BLOB cache. This will ensure that other assets are not using up space in the BLOB cache that you want allocated to items in the asset library. It will also ensure that sites which receive lots of traffic do not prevent other sites which receive less traffic from benefitting from the BLOB cache

Store the BLOB cache

When you enable the BLOB cache, you must specify a location on the front-end Web server where the files will be stored. By default, the cache will be created on the drive on which SharePoint is installed. Make sure that you put the BLOB cache on a drive that has sufficient disk space available in which to store the cache. Also, select a drive that will be used by as few processes as possible so that the BLOB cache process does not encounter conflicts when it tries to access the drive. If too many processes compete for disk access on the drive where the BLOB cache is located, BLOB cache performance and other processes will be adversely affected.
If you plan to use the BLOB cache in a scenario with heavy cache use, such as serving videos in a high traffic environment, and if you will use ULS logging, consider placing the BLOB cache on a separate physical drive from the ULS log — not on a separate partition. Storing the BLOB cache and the ULS log on the same drive can result in poor server performance. If you place the BLOB cache and the ULS log on the same physical drive, make sure that you closely monitor the disk queue length for any performance effect.
Each front-end Web server has its own local copy of the BLOB cache that is built as requests for files are received. If you use load balancing with multiple front-end Web servers, each server contains its own cache. When a file is requested by the first server, it is cached to that server only. If the next request for the same file comes from a second server, a second request is sent to the database server to retrieve the file to the cache on the second server.

Enable the BLOB cache

The BLOB cache is configured in the web.config file for each Web application and, by default, is not enabled. You must specifically enable the BLOB cache in order to get the performance advantage it provides. For information about how to enable the BLOB cache, see Configure cache settings for a Web application (SharePoint Server 2010).

Specify the size of the BLOB cache

When you decide how large to make the BLOB cache, you must consider the number and size of the files to determine the total size of the data to be stored in the cache. By default, the BLOB cache is set to 10 gigabytes (GB). Allow at least 20 percent more space on the drive than the size of the cache. For example, if you have 10 GB of content, set the size of the cache to 12 GB on a drive that has at least 15 GB of space. If the BLOB cache is too small, serving files to users slows, reducing the performance of your site.

No comments:

Post a Comment