A Master Key to Your Content

Once in a while I find myself in a situation where workflow hasn’t been completed but users have begun content entry or cleanup. Normally these users also have not been setup as site admins, but with some level of custom accesses. This causes the editors to spend time dealing with locking and unlocking items for editing. At times they’ll not even realize and they locked the item, and you start to get a trail of items edited then forgotten.

What’s an admin to do?

Without too much work you can turn-on the gutter icon for ‘Locked Items’, then drill through the tree visual identifying and jotting down what’s locked and who.

Locked Items Gutter Setting

But that’s tedious (and a bit error prone). As with all cool administrative tasks in Sitecore we are best to turn our attention to Sitecore PowerShell Extensions (SPE) in the marketplace

The SPE ships with function that gives us the ability to see and react to locked items on our site.

Get-LockedChildItem

Step 1 – Import Function

By default the function Get-LockedChildItem is not callable. You must first ‘import’ it into your console or ISE session.

Import-Function Get-LockedChildItem

 Import-Function Get-LockedChildItem

If you don’t perform an import of the function, then you’ll receive a red error message like the following

Get-LockedChildItem : The term ‘Get-LockedChildItem’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Step 2 – Get a Report

Before performing any sort of automation on our content tree, we should always produce a report that provides some context of what may get changed. In this case we want to get a listing of all items that are locked

Get-LockedChildItem -Recurse | Show-ListView

Here we are using the ‘Recurse’ flag to walk the entire tree. The collection of items locked are then piped to the very nice Show-ListView, allowing for easy review and export.

Get-LockedChildItem as a Report

We can also run the report for specific users via the -LockedBy parameter

Get-LockedChildItem -Recurse -LockedBy 'sitecore\editor' | Show-ListView

Step 3 – Time to Free the Content

Once we understand who has what locked we can start performing some mass freeing of content with the -Unlock parameter. To unlock everything, we run

Get-LockedChildItem -Recurse -Unlock

If we want to perform some hand picking of section of the site, we can either open the console to a certain node of the tree and run the above or define the start point with -Path parameter. This will unlock all the children of the item defined by path, even providing a nice output of what was unlocked.

Get-LockedChildItem -Recurse -Unlock -Path {85E0AF8C-ED9F-4CDA-BFB2-084015E17634}
#or
Get-LockedChildItem -Recurse -Unlock -Path /sitecore/content/Coffeehouse/Home/About-Us

Unlock for a path

Finally, if we want to unlock for a specific individual we can re-use the -LockedBy parameter,

Get-LockedChildItem -Recurse -Unlock -LockedBy 'sitecore\editor'

Not a Replacement for workflow (i.e. the Disclaimer)

Being able to execute unlocking of content on a mass scale is helpful, but this shouldn’t be the replacement for properly planned and built workflow on your site.

Advertisements

Planning for Cache in Sitecore

This is a follow-up to my Unofficial Sitecore Planning Checklist, where I try to consolidate as much information as I can find on Sitecore’s built in caching.

One of the easiest ways to improve a visitor’s perceived impression of any website visit is through a well-tuned cache. A cache which has been properly tuned will be able to server of requested content quicker, sometimes magnitudes faster than rebuilding the HTML for a page on each request.

Sophisticated caching scenarios can be configured through third-party tools and applications, but even for the most highly trafficked site properly tuning Sitecore’s different cache options should provide the desired performance gains. As site cache is configured and tuned, be aware the need for vertical or horizontal scaling may become necessary. (For details on scaling Sitecore checkout Scalability)

Determine the cache limits required

The general practice for Sitecore caching tuning is to turn all cache limits off via the following simple cache patch config:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <settings>
      <setting name="Caching.DisableCacheSizeLimits">
    <patch:attribute name="value">true</patch:attribute>
    </settings>
  </sitecore>
</configuration>

With the cache limits now disabled, Sitecore will try to manage based on current traffic and available resources to cache as much as possible. By performing well structured load test or allowing the site to run in this manner, the team should monitor both server resource utilization as well as the Sitecore cache levels to determine areas that should be manually limited to maximize performance.

To monitor what Sitecore has cached you can use the Sitecore admin page, http://&lt; your domain >/Sitecore/admin/cache.aspx, or leverage the Sitecore Marketplace module Caching Manager, https://marketplace.sitecore.net/en/Modules/Caching_Manager.aspx.

Cache Manager Options

After data collection has occurred you are ready to begin to evaluate which caches need their limits adjusted from the default level. For more information on the different cache limits that can be set see Sitecore CMS 7.0 – 7.2 CMS Performance Tuning Guide.pdf and Sitecore CMS 6.6 or later Cache Configuration Reference.pdf.

Configuring HTML Cache of Components

The first level of caching to configure to is review each rendering that is created and set the appropriate HTML level caching on it.

Rendering Cache Option

To turn HTML cache on for the rendering, select the first option Cacheable. From here you can customize the how different variations of the control should be cached via the different ‘Vary By’ options. Finally, you can mark that all cache be cleared when the search index is updated via the ‘Clear on Index Update’ selection.

The following fuller description of each cache option is taken from Chapter 4: Output Caching in Sitecore CMS 7.0 or later Presentation Component Reference.pdf.

Clear on Index Update

The Clear on Index Update property controls whether or not a control clears its cache when an item that is associated with the control is updated in the index. This is useful for any control that uses the new Search API to populate its data sources. For example:

  • You have a control that returns all the products that are on special offer from the index.
  • The Clear on Index Update property for this control is set to True.
  • The price of each product is stored in the index.

If someone updates the price of one of the products on special offer, the Clear on Index Update property will the trigger the control to clear its cache because something has been updated in the index that is bound to the control.

VaryByData

The VaryByData property controls whether or not output caching varies based on the data source of the presentation component.

Set the VaryByData property:

  • To False for components that do not generate different output when used with different data sources.
  • To True for components that generate different output when used with different data sources.

VaryByDevice

The VaryByDevice property controls whether or not caching varies based on the name of the context device.

Set the VaryByDevice property:

  • To False for components that do not generate different output when used with different devices.
  • To True for components that generate different output when used with different devices.

VaryByLogin

The VaryByLogin property controls whether or not output caching varies based on whether or not the user has authenticated. For caching configuration involving the VaryByLogin property, the layout engine treats all anonymous users as a single authenticated user.

Set the VaryByLogin property:

  • To False for components that do not generate different output for authenticated than for unauthenticated visitors.
  • To True for components that generate different output for authenticated than for unauthenticated visitors.

VaryByParm

The VaryByParm property controls whether or not output caching varies based on rendering parameters passed to the presentation component. Solutions built with earlier versions of Sitecore may have used the token VaryByParam instead of VaryByParm. Update any instances of VaryByParam to VaryByParm.

Developers set the VaryByParm property:

  • To False for components that do not generate different output when passed different rendering parameters.
  • To True for components that generate different output when passed different parameters.

VaryByQueryString

The VaryByQueryString property controls whether or not output caching varies based on query string parameters passed in the URL. The VaryByParm property causes output caching to vary based on rendering parameter values passed by the developer. The VaryByQueryString property causes output caching to vary based on parameters passed in the URL query string.

Developers set the VaryByQueryString property:

  • To True for components that generate different output when supplied different query string parameters.
  • To False for components that do not generate different output when supplied different query string parameters.

VaryByUser

The VaryByUser property controls whether or not output caching varies by the domain and username of the context user.

Developers set the VaryByUser property:

  • To False for components that do not generate different output for different users.
  • To True for components that generate different output for different users, when the number of active users between publishing operations is relatively small. The VaryByUser treats all anonymous users as a single authenticated user.

To avoid excess memory consumption, avoid using the VaryByUser property except in solutions with relatively small numbers of users, or monitor cache utilization closely. The VaryByLogin property causes Sitecore to generate different output depending based on whether or not a user has authenticated, differentiating anonymous users from authenticated users. The VaryByUser property causes Sitecore to generate different output for each user

Other Caches

Sitecore contains a number of other caches that help to lower the number of calls required to the database for item information and indexes. These are best described in a post from the Sitecore Tactics blog entitled How Sitecore caching work.

Additional Helpful references

One Final Note

Starting in Sitecore 8.2, the Cache APIs where refactored, creating breaking changes to any custom cache providers used in previous versions. Be sure to check out the change list, https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/cache_api_changes.

 

How to plan for performance

Recently I had the opportunity to sit through a series of management courses. One of the main focuses was how to provide an environment to help motivate your team members and increase performance. In parallel to these courses I was working with a client to define the steps required to properly secure and architect a scalable Sitecore installation. After some extensive research and reading, followed by re-reading I’ve tried to compile the ‘Unofficial Sitecore Planning Checklist’.

As Sitecore has matured as a product so has the method of documenting the product, sadly it seems we continue to be in a slow shift to easily consumable and discoverable documentation, it reminds me of the early days of my SharePoint work, where the community documented better the product team. Because of this positive growing pain, you may end up on really old blog posts as well as some ‘ancient’ PDF documentation, which is still plenty applicable. Finally, this checklist is a starting point as documentation and feature sets continue to change and growth with the product always check for the latest before finalizing your organizations plans.

Some Basics

Begin with Sitecore Experience Platform 8.0 the ability to scale both horizontally and vertically was introduced through flexibility to place different Sitecore components on individual or combined servers.

The key components to be accounted for during server architecture is

  • Content delivery (CD) server (including personalization)
    • the touch point to the visitors, HTML, personalization, etc..flow from here
  • Content management (CM) server
    • Central nerve to the entire site, authoring and reporting occur here
  • Content databases (SQL)
    • SQL databases that houses your content
  • Session state server
    • This is the method you choose to track contacts while the actively visit the site.
    • Listed as an actual server this can take the form of a server, SQL database, MongoDB collection, or just ran in memory.
  • Collection database (MongoDB)
    • Storehouse for xAnalytics as data is collected
  • Processing server
    • Performs the heavy lifting job number crunching
  • Reporting database (SQL)
    • Just a database that all the pretty tables and charts come from
  • Reporting service
    • Service that moves data from SQL to those pretty tables and charts
  • Email Experience Manager Dispatch database (SQL)
    • Finally a clearly named item (database used to manage the queueing and sending of emails)
  • Email Experience Manager Dispatch service
    • Another straight named item (API that the servers use to perform the actual sending, dispatching, of emails)

You’ll notice there are a number of SQL databases that are required to support the system. These can all run on the same SQL instance or cluster without issue.

If you plan to place any of the service components on individual servers, you will need be properly licensed by Sitecore for an additional server install as they all require an installation of Sitecore just like a content delivery or management server.

Checkpoint 1: CM and CD Setup

  • CD Server
    • Bare minimum requirements: 16GB RAM, 4 cores resulting in 8 threads
    • Things to watch out for
      • Site must process heavy business or search logic making it computationally heavy CPU increase may be needed
      • Caching strategy may require additional RAM to support better cache retrieval of HTML and images
      • In-Proc Session State will be store to RAM, in which case a high traffic site is going to need more RAM
  • CM Server
    • Bare minimum: 16GB RAM, 4 cores resulting in 8 threads
    • Things to watch out for
      • As increase of con-current authors editing increases additional RAM becomes required to provide the better experience (this number may be around 10 to 15)
      • In a standard installation the CM server performs the additional duties of processing server, reporting service, and EXM Dispatch manager
        • All these will impact the performance of the CM requiring both additional CPU (helps with processing) to additional RAM (helpful for large EXM dispatches as each email is built in memory before being sent.)

Checkpoint 2: Experience Database (xDB)

The Experience Database commonly referred to as the ‘xDB’, is based on the NoSQL solution MongoDB. The xDB is the primary storage for all analytics information and the registry of contacts and engagement automation states. Both Content Delivery and Content Management servers talk to the xDB performing read and write actions against it.

Because data is written and read at high rates from the xDB as visitor’s sessions start and end requires a proper amount of RAM and high speed disk, such as SSD, to maximize performance.

Using MongoDB as your collection database, you should install plenty of RAM and use SSD drives. Sharding can also improve performance significantly. Read the documentation on the MongoDB website to learn about the MongoDB architecture, replication, sharding, and configuration options. (taken from xDB Hardware Guidelines)

Depending on the version of Sitecore running there are official supported MongoDB versions. This does not mean a newer/older version will not work with your version of Sitecore, but Paragon nor Sitecore can guarantee the behavior.

Sitecore XP 7.5 series Sitecore XP 8.0 Initial Release to Update 4 Sitecore XP 8.0 Update 5 and later Sitecore XP 8.1 and later Sitecore XP 8.2 and later
Mongo 2.6 mmapv1 Yes Yes Yes Yes Yes
Mongo 3.0 mmapv1 No No Yes Yes Yes
Mongo 3.0 Wired Tiger No No Yes Yes Yes
Mongo 3.2.1 mmapv1 No No No No Yes
Mongo 3.2.1 Wired Tiger No No No No Yes
Mongo 3.2.1 Enterprise with data-at-rest encryption (Wired Tiger only) No No No No Yes

For the latest supported version table see Sitecore’s documentation: https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/platform/software_recommendations.

Sitecore recommends that MongoDB is setup in a replication architecture with sharding enabled. The minimum configuration is to run two full capacity MongoDB servers for data and a third lower capacity server to act as the arbiter. This third server would not need to handle any data in the basic configuration.

MongoDB can run on either Windows or Linux/Unix servers, as long as the proper version of MongoDB is used the Sitecore application does not care.

Additional Helpful references

Cleaning up log messages for Geo IP Location

Starting with Sitecore 8.1 Geo IP lookup services come pre-installed and configured. All a site owner than need to do is log into the App Center and purchase the service. This is great from an implementer standpoint this is great as it’s one less configuration step that we have to take.

On the downside, if the site owners never purchase the lookup service the log will quickly clutter with ERROR messages.

ManagedPoolThread #12 16:01:15 ERROR Failed to perform GeoIp lookup for dd4795c0-1dca-ea8d-93c4-06d7f7aa5063
Exception: System.Net.WebException
Message: The remote name could not be resolved: ‘discovery-ces.cloud.sitecore.net’
Source: System
at System.Net.HttpWebRequest.GetResponse()
at Sitecore.CES.Client.WebClient.ExecuteRequest(String requestUri)
at Sitecore.CES.Client.ResourceConnector`1.Request(String endpoint, Object[] parameters)
at Sitecore.CES.Discovery.EndpointSource.GetEndpoint(String serviceName)
at Sitecore.CES.GeoIp.SitecoreProvider.GetInformationByIp(String ip)
at Sitecore.Analytics.Lookups.GeoIpManager.GetDataFromLookupProvider(GeoIpHandle geoIpHandle)

The Fix

The fix isn’t hard; all it requires is a simple patch config to disable the lookup service.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <settings>
            <setting name="Analytics.PerformLookup">
                <patch:attribute name="value">false</patch:attribute>
            </setting>
        </settings>
    </sitecore>
</configuration>

For the full details on the lookup service checkout the full documentation at https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/ip_geolocation/setting_up_sitecore_ip_geolocation.

Guide Book to Sitecore Reporting

Taking a journey without a good guidebook can be exciting and scary all at the same time. Having looked at the journey our data moves through from collection, squeezing through formatting to arrive at reporting, I thought we should have some more detailed guiding points (the cheap man’s guide book) as to what we can ‘do’ on the journey.

My first guide book takes a detailed look into the built-in reporting of Sitecore, http://www.paragon-inc.com/resources/blogs-posts/guide_book_to_built_in_reporting.

Journey Into the Aggregation Process Part 2

hope you are not feeling to weary just yet, as we embark on the second leg of the Sitecore Experience Platform data journey. In this leg of the journey we will see how the data points go from living in tables into bright, colorful, and insightful tables and charts. Understanding how these tables and charts populate will allow you to take control of your organizations data and make meaningful decisions to further engage customers. http://www.paragon-inc.com/resources/blogs-posts/journey_into_the_aggregation_process_part_2

 

Sitecore Experience Analytics Quick Start

One of the awesome selling points of Sitecore Experience Manager is the vast amount of data that can fairly easily be collected on site visitors. The information can be used to trigger engagement plans, site personalization, etc.…to help the visitor feel a connection to your organization. When giving a demo, I always get the most ooohs and ahhhs when showing of the Experience Analytics Dashboard and the Experience Profiles, but behind all that flash is some serious data complexity and planning that is required.

 

My first post in a series exploring Experience Analytics is ready for your exploration, http://www.paragon-inc.com/resources/blogs-posts/engagement-analytics-quickstart.