A contact with an excessive number of interactions might cause high resource consumption on the xConnect instance and SQL databases. This might result in HTTP Server errors because the requests take a long time to execute. For example:
Sitecore.XConnect.Operations.GetEntityOperation`1[Sitecore.XConnect.Interaction]: Sitecore.Xdb.Collection.Failures.DataProviderException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out
This article describes how to locate and analyze the data to find contacts with an excessive number of interactions for the SQL collection database provider.
The following query must be executed against all shard databases that are present in the solution. It is supposed to show the contact ID and the number of interactions for this contact.
SELECT TOP (100) ContactId, COUNT(ContactId) as Count
FROM [xdb_collection].[Interactions]
GROUP BY ContactId
ORDER BY Count DESC
Contacts with several thousand interactions must be checked further because they might cause harm to the system. The following query is needed to retrieve the top 100 interactions of a contact that was found during the previous operation. Interactions must be investigated as defined in the "Analyzing the data" section.
SELECT TOP (100) *
FROM [xdb_collection].[Interactions]
WHERE ContactId = '6ffc58de-6c56-0000-0000-05d6639738da'
To analyze the located data, perform the following steps:
SELECT *, CONVERT(VARCHAR(MAX), Identifier) as IdentifierStringIf the contact is not anonymous, you can try to understand who is this contact. You can do this by analyzing the IdentifierString value, or by analyzing the FacetData value returned by the following query:
FROM [xdb_collection].[ContactIdentifiers]
WHERE ContactId = 'E24BAC10-CD1B-0000-0000-05D6D3DE8788'
SELECT *Quite common issues here are contacts that are used for load testing. They must be removed after the test session, or the test session must be performed on a lower environment, and the xDB collection must be redeployed after the operation.
FROM [xdb_collection].[ContactFacets]
WHERE ContactId = 'E24BAC10-CD1B-0000-0000-05D6D3DE8788'
SELECT TOP(100) *You can analyze the IP about whether you know it. If the interactions done by it are suspicious or excessive, you can exclude it as described here: Configure robot detection functionality.
FROM [xdb_collection].[InteractionFacets]
WHERE ContactId = 'E24BAC10-CD1B-0000-0000-05D6D3DE8788' AND FacetKey = 'IpInfo'
We recommend that you remove contacts with an excessive number of interactions. They are often robots, which do not provide value in the reports and cause extra load on the system.
To remove contacts with an excessive number of interactions, consider one of the following options: