Best practices for EMS performance

Running the Kentico EMS on-line marketing functionality typically increases the performance requirements for websites with very heavy traffic. This page provides best practices for optimizing the performance of such websites and helps to determine the hosting requirements for EMS projects.

Project parameters and hosting requirements

Kentico EMS has been tested with the following on-line marketing parameters:

Two different hosting configurations were tested with the following traffic loads:

Hosting configuration

Page requests per second

Concurrent visitors

Load balanced web farm with 4 servers (Kentico instances)

  • 1 of the servers designated to perform all recalculations of on-line marketing data
  • Session state synchronized using Azure Redis Cache (Standard C6)

1600 (800 from new contacts)

25000

1 web server

600 (300 from new contacts)

9000

With the above traffic loads, the page load time was under 1 second for at least 95% of all live site web requests.

The following server specifications were used:

Web server

  • Processor: 2,4 GHz Intel Xeon E5-2673 v3, 8 cores
  • RAM: 28 GB
  • Drive: 400 GB, 500 IOPS

Database server

  • Processor: 2,4 GHz Intel Xeon E5-2673 v3, 16 cores
  • RAM: 56 GB
  • Drives: 3x SSD 1024 GB, 5000 IOPS (1 for data, 2 in RAID0 for the database log file)

Important

  • The specifications described above assume that the environment and Kentico instances follow all performance best practices.
  • The hosting requirements may vary based on the used on-line marketing features and their configuration.

Higher parameters may be achievable with more powerful hosting configurations. In general, the following scaling recommendations apply:

  • To increase the supported traffic load (requests per second, new contacts per second, concurrent visitors), increase the number of servers in the web farm.
  • To increase the supported volume of on-line marketing data, increase the size and performance of the database server.

Performance best practices

To achieve optimal performance with Kentico EMS websites, follow the recommendations in the sections below.

Note: In addition to the instructions listed on this page, also follow the general performance best practices for all types of websites: Optimizing performance of Portal Engine sites

Set up a web farm environment

You may need to host your website in a web farm with multiple servers to handle high traffic loads. To learn how to set up the web farm synchronization features in Kentico, see Configuring web farm servers.

When using a static web farm, you can optimize on-line marketing performance by having one designated server perform all recalculation of on-line marketing data (contact scorescontact groupspersonasmarketing automation triggers).

To configure recalculation on only one designated web farm server, you need to disable the recalculation on all other servers. Set the CMSCreateContactActionsLogWorker web.config key to false in the appSettings section of the web.config file on all servers except for the selected recalculation server:




<add key="CMSCreateContactActionsLogWorker" value="false" />



Keep in mind that you must always leave recalculation enabled on one server.

Note: Using one server for recalculation improves the web farm’s overall performance, but you may experience longer delays between actions on the website and results in the administration interface (calculation of contacts scores, assignment of contacts to contact groups or personas, etc.).

Separate the on-line marketing database

Running the on-line marketing features on a high-traffic website places a significant load on the database server. To distribute the load of Kentico’s standard and on-line marketing functionality, separate your on-line marketing database to a second database server.

Set up the SQL server

If you have the option to administer the website’s database server, we recommend that you perform the following steps:

  • Optimize the database’s Log and Data files:

    • Set a large initial size for the data file and disable Autogrowth
    • Store the log and data files on different drives
    • Store the SQL server error log files on the same drive as the main data file
    • Store the server’s tempdb database to the same drive as the main data file
  • Enable the Lock Pages in Memory Option on the database server

Optimize database indexes

By default, the Kentico database tables have indexes optimized for the most common scenarios. However, each EMS website uses a different set of on-line marketing features, with different visitor behavior, and a unique distribution of data.

For optimal performance, we recommend that you regularly use a tool (for example the Database Engine Tuning Advisor) to analyze your database performance. Consider the suggestions and implement any database index adjustments that are suitable for your specific project.

Additionally, the default database indexes are optimized for live site performance, not for operations in the Kentico administration interface. With extremely large volumes of data (millions of records), you may encounter slow performance or timeouts in object lists – for example if you change the default list ordering or when filtering according to certain fields. You can address these problems by creating custom database indexes with the corresponding columns (note that this may have a negative impact on live site performance).

Optimizing Salesforce integration

The default Kentico indexes are optimized without considering the Salesforce integration. If you are using the Salesforce integration with a large number of contacts, we recommend that you optimize database operations by manually creating a database index with the following columns on the OM_Contact table:

  1. ContactSalesForceLeadID
  2. ContactSalesForceLeadReplicationDisabled
  3. ContactSalesForceLeadReplicationSuspensionDateTime

The index should be non-clustered and non-unique. See the Create Nonclustered Indexes article for more information.

Use JavaScript logging for analytics and activities

For optimal performance and data accuracy, make sure that JavaScript logging is enabled for web analytics and activities:

  1. Open the Settings application in Kentico.
  2. Navigate to On-line marketing -> Web Analytics.
  3. Enable the Log via JavaScript snippet setting.
  4. Save the settings.

For more information, see Enabling web analytics.

Optimize send out of marketing emails

Optimize the number of macros in emails

Composing marketing emails for a large number of recipients can decrease the system’s performance, particularly if the emails contain macros and use other email marketing features. Approximately 5% of the email generation time is spent on Tracking clicked linksTracking opened emails, and Logging on-line marketing activities, when these features are enabled. The time spent on resolving macros grows linearly with the number of macros used in the emails, however this takes up only a small portion of the total email generation time. Note that the growth of the macro resolving time is linear only if all data is cached and no database operations are performed within the macros.

As a result, we recommend minimizing the number of macros in the content of your marketing emails to ensure a shorter email generation time.

EMS email generation performance tests

These recommendations were put together based on the results of several tests performed on Kentico EMS.

The marketing email send out was tested for performance in an environment with no real traffic, measuring only the generation of emails. The testing environment consisted of a web server and database server, without a separated on-line marketing database. The tested emails contained up to 50 data macros and up to 5 macros using recipient properties.

In addition to the information stated above, the results also show that the email generation time grows linearly with the number of email recipients.

Disable CSS inlining

Inlining of the CSS markup included in marketing email templates can have a negative influence on the performance of your system when composing emails. We recommend disabling CSS inlining to reduce the email generation time.

Enable the email queue

When generating a large amount of emails, we recommend configuring the system to use the email queue and setting the Network delivery method for your SMTP server. When using the Network delivery method with the email queue enabled, the system temporarily stores all outgoing emails in the database instead of sending them directly to the SMTP server.

Set up automatic deleting of contacts

The contact management features create contacts and log activities for every visitor, which generates a very large amount of data on high‑traffic websites. Extremely large numbers of stored contacts and activities may slow down certain operations in the system and be overwhelming for your marketers.

To reduce the volume of data, we recommend that you configure the system to regularly delete contacts that meet certain conditions and are no longer relevant.

Disable event logging for automation and marketing emails

To reduce system overhead on EMS instances with a very large number of contacts, we recommend that you disable event logging for the following actions:

Add the following keys to the appSettings section of the web.config file:




<add key="CMSLogMATransitions" value="false" />
<add key="CMSLogNewsletterIssueEvents" value="false" />


Optimize scoring and contact group recalculation

Recalculation of contact scores and contact groups can be a resource intensive process that may reduce website performance.

  • When scheduling score recalculations and contact group rebuilds, avoid your website’s peak traffic hours.
  • If you use custom macro rules in your scoring rules or contact group conditions, implement translators to significantly improve recalculation performance.