Diagnosing Heroku Connect Performance Issues
Last updated December 08, 2022
Table of Contents
A number of factors can affect sync performance with Heroku Connect. Follow the steps in this article to diagnose perceived read or write performance issues.
For more info on what affects sync speed and best practices, see Optimizing Heroku Connect performance.
Read Issues
Step 1: Review Mapping State
There are a number of read issues that require user intervention. Check the state of your mapping in the Heroku Connect dashboard, CLI, or API. See Mapping States Reference for how to resolve.
Step 2: Review Application Logs
Using your application’s log drain, find logs that look like app[herokuconnect]
and have a ↓
character in them. This log entry has an event string that resembles:
Lead UPDATE ↓DATABASE 1 rows (0.01 secs)
This example string can be read as: Your database took 0.01 seconds to process the update to 1 row from the Salesforce Lead object.
If you enabled Accelerated Polling, you can also see log messages like:
Custom_Account__c, Streaming poll found 2 changes
This example indicates that a sooner-than-scheduled poll occurred and found 2 changes for Custom_Account_c
to synchronize.
See Common Log Messages for more examples and explanations.
Step 3: Investigate Database Performance Issues
It’s possible that your database is slow at processing changes from Salesforce. Investigate your database for issues. Common causes include having too many indexed columns on a PostgreSQL table. See Watch For Postgres Performance Issues for more info.
Your database can also be slow if it’s undersized. Use at least a standard-4
, premium-4
, private-4
or shield-4
plan for production Connect use cases. See Choose a Sufficient Heroku Postgres Plan for more info.
Step 4: Run Heroku Connect Diagnostics
Heroku provides a CLI plugin to inspect the current state of your connection and perform basic operations. The connect:diagnose
command runs some diagnostics to identify common problems. See Heroku Connect Diagnostics for more info.
It’s best practice to keep the size of your mapped objects small for faster performance. The diagnose
command helps identify the number of mappings and number of fields per object that’s optimal for your connection. See Minimize the Size of the Mapped Object for more info.
Step 5: Check For Issues with Your Salesforce Org
Check the Salesforce Status site to see if there are current issues with your org.
The physical distance between your Heroku Connect cell and your Salesforce instance also impacts latency. You can find your cell in Heroku Connect’s dashboard settings. Check the list of regions available for Connect cells here and determine if there’s a region closer to your Salesforce org available.
Step 6: File a Support Ticket for More Assistance
If the previous steps don’t reveal performance issues, then there could be an issue with Heroku Connect itself. File a ticket so that Heroku Support can investigate.
Write Issues
Here are some ways to find errors and any potential bottlenecks caused by your Salesforce org or your Heroku Postgres database.
Step 1: Review the Trigger Log For Write Errors
Writes to Salesforce can fail for a number of reasons, including planned maintenance windows. In cases where Salesforce is unavailable, Connect queues writes until Salesforce is available again. In all other cases, resolving errors requires user intervention. See Heroku Connect Write Errors for more info.
Step 2: Review Application Logs
Using your application’s log drain, find logs that look like app[herokuconnect]
and have a ↑
character in them. This log entry has an event string that looks like:
1 Custom_Account__c INSERT ↑SALESFORCE 1 rows total (0.28 secs) [SOAP]
This example string can be read as: Heroku Connect inserted 1 row from the custom_account__c
table in your database into Salesforce via the SOAP API. It took Salesforce 0.28 seconds to process the insertion.
See Common Log Messages for more examples and explanations.
Step 3: Run Heroku Connect Diagnostics
Heroku provides a CLI plugin to inspect the current state of your connection and perform basic operations. The connect:diagnose
command runs some diagnostics to identify common problems. See Heroku Connect Diagnostics for more info.
Step 4: Investigate Potential Performance Issues with Your Salesforce Org
If you have high response times to API requests, look for potential issues in your Salesforce org. For example, misbehaving Apex triggers or workflows can slow down Connect’s ability to write.
The physical distance between your Heroku Connect cell and your Salesforce instance also impacts latency. You can find your cell in Heroku Connect’s dashboard settings. Check the list of regions available for Connect cells here and determine if there’s a region closer to your Salesforce org available.
Step 5: Investigate Potential Performance Issues with Your Database
If the Salesforce API response times are reasonable, then Heroku Connect could be slow at retrieving records from your Trigger Log in your database. Inspect your database with a tool like pg:diagnose. See Watch For Postgres Performance Issues for more info.
Your database can also be slow if it’s undersized. Use at least a standard-4
, premium-4
, private-4
or shield-4
plan for production Connect use cases. See Choose a Sufficient Heroku Postgres Plan for more info.
Step 6: File a Support Ticket for More Assistance
If the previous steps don’t reveal performance issues, then there could be an issue with Heroku Connect itself. File a ticket so that Heroku Support can investigate.