---
title: Best practices for EMS performance
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

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

## Project parameters and hosting requirements

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

- **Total number of stored contacts**: 100 million (108)
- **Total number of logged activities**: 1 billion (109)
- **Used on-line marketing features**:

  - 10 condition-based [contact groups](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/segmenting-contacts-into-contact-groups.md)
  - 2 [scores](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/scoring-contacts.md) for evaluating contacts
  - 2 [personas](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/personas.md)
  - 3 [marketing automation processes](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/marketing-automation.md) (process triggers: 1 activity-based, 2 score-based)
  - 2 running [campaigns](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/campaigns.md)

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)<br>1 of the servers designated to perform all recalculations of on-line marketing data<br>Session state synchronized using [Azure Redis Cache](https://azure.microsoft.com/en-us/services/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<br>RAM: 28 GB<br>Drive: 400 GB, 500 IOPS                                                               |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Database server | Processor: 2,4 GHz Intel Xeon E5-2673 v3, 16 cores<br>RAM: 56 GB<br>Drives: 3x SSD 1024 GB, 5000 IOPS (1 for data, 2 in RAID0 for the database log file) |

> **Note:** **Important**
>
> - The specifications described above assume that the environment and Kentico instances follow all [performance best practices](#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.

> **Info:** **Note**: In addition to the instructions listed on this page, also follow the general performance best practices for all types of websites: [Optimizing website performance](https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance.md)

### Set up a web farm environment

You may need to host your website in a [web farm](https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/setting-up-web-farms.md) 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](https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/setting-up-web-farms/configuring-web-farm-servers.md).

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 scores](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/scoring-contacts.md), [contact groups](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/segmenting-contacts-into-contact-groups.md), [personas](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/personas.md), [marketing automation triggers](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/marketing-automation.md)).

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:

```xml

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


```

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

> **Info:** **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](https://docs.kentico.com/k10/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/separating-the-contact-management-database.md) 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](https://msdn.microsoft.com/en-us/library/ms189253\(v=sql.120\).aspx):

  - 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](https://msdn.microsoft.com/en-us/library/ms190768\(v=sql.120\).aspx) to the same drive as the main data file
- [Enable the Lock Pages in Memory Option](https://msdn.microsoft.com/en-us/library/ms190730\(v=sql.120\).aspx) 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](https://technet.microsoft.com/en-us/library/ms188639\(v=sql.105\).aspx)) 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).

> **Info:** **Optimizing Salesforce integration**
>
> The default Kentico indexes are optimized without considering the [Salesforce integration](https://docs.kentico.com/k10/integrating-3rd-party-systems/salesforce-integration.md). 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](https://docs.microsoft.com/en-us/sql/relational-databases/indexes/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](https://docs.kentico.com/k10/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-web-analytics/enabling-web-analytics.md).

### Set up automatic deleting of contacts

The contact management features create [contacts](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/working-with-contacts.md) and log [activities](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/tracking-contact-activities.md) 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](https://docs.kentico.com/k10/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-contacts/setting-up-automatic-deletion-of-contacts.md) 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](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/working-with-contacts.md), we recommend that you disable [event logging](https://docs.kentico.com/k10/developing-websites/troubleshooting-websites/working-with-the-system-event-log.md) for the following actions:

- Transitions between steps of [automation processes](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/marketing-automation.md)
- Sending of marketing emails (within [email feeds](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/email-marketing.md))

Add the following keys to the _appSettings_ section of the _web.config_ file:

```xml

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

```

### Optimize scoring and contact group recalculation

Recalculation of [contact scores](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/scoring-contacts.md) and [contact groups](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/segmenting-contacts-into-contact-groups.md) 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](https://docs.kentico.com/k10/macro-expressions/writing-macro-conditions/creating-macro-rules.md) in your scoring rules or contact group conditions, [implement translators](https://docs.kentico.com/k10/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/on-line-marketing-macros/improving-custom-macro-performance-in-scoring-and-contact-groups.md) to significantly improve recalculation performance.
