Long-running transactions are a common but overlooked cause of rising CDC source latency in AWS DMS migrations. When a transaction stays open, DMS must buffer all subsequent changes until it commits, causing latency to climb from seconds to hours. This post explains how DMS processes transactions, how to diagnose latency spikes, and provides ready-to-use bash monitoring scripts for Oracle, PostgreSQL, MySQL, and SQL Server. The scripts detect transactions exceeding a configurable threshold (default 15 minutes), send alerts via Amazon SNS, enforce TLS/SSL connections, retrieve credentials from AWS Secrets Manager, and filter false positives. A step-by-step Oracle demo shows the full workflow from DMS task setup to alert receipt. Scheduling via crontab enables continuous proactive monitoring.

12m read timeFrom aws.amazon.com
Post cover image
Table of contents
DMS source latencyLong-running transactionsQueries to identify long-running transactionsMonitoring scriptsScript details by engineSample SNS alert outputSample log outputScheduling with crontabDemonstrationSecurity considerationsConclusionAbout the authors
328 Impressions