CloudConsole

CloudWatch alarm: Aurora BlockedTransactions

Updated 16 November 2026 · How we write and check guides

Short answer

Alarm on AWS/RDS BlockedTransactions per DBInstanceIdentifier with the Average over 60 seconds, firing above your threshold for 5 consecutive minutes. A practical threshold is about 5% of the instance's normal ActiveTransactions; above that, lock contention is holding up a meaningful share of work.

Chart of the BlockedTransactions alarm: Average per 1-minute period, ALARM when 5 of 5 datapoints are > 20
How the recommended alarm evaluates, with AWS's settings from this page and the page's example threshold. The metric values are illustrative.

What the metric means

On Aurora MySQL, BlockedTransactions is the rate of transactions that are waiting on a lock held by another transaction. Every blocked transaction eventually either gets its lock and commits, times out, or is rolled back as a deadlock victim. While waiting, it holds its connection and often its own locks, so contention compounds quickly.

What causes it in production: a long-running transaction holding row locks (an admin session left open, a batch job updating many rows in one transaction), hot rows that many transactions update (counters, a single "status" row, sequence tables), sessions idle in a transaction because the application forgot to commit, and large UPDATE or DELETE statements without a selective index, which lock far more rows than intended.

It is worth knowing that a blocked transaction is not necessarily a slow query: a single-row update can wait for minutes behind another session's lock while using no CPU, which is why this metric can catch problems that CPU and latency alarms do not.

Recommended alarm settings

SettingRecommended value
NamespaceAWS/RDS
MetricBlockedTransactions
DimensionsDBInstanceIdentifier
StatisticAverage
ThresholdDepends on your situation (about 5% of ActiveTransactions)
Period60 seconds
Datapoints to alarm5
Evaluation periods5
Comparison operatorGreaterThanThreshold

Setting the threshold

  1. Chart ActiveTransactions for the instance over two weeks and take a typical busy-period value, say 400.
  2. 5% of that is 20; use it as the threshold.
  3. Chart BlockedTransactions for the same period. If it already reaches 20 during normal batch windows, either fix those batches or raise the threshold with a clear note why.

When traffic varies a lot, a metric math alarm on 100 * BlockedTransactions / ActiveTransactions greater than 5 adapts automatically.

Create the alarm

aws cloudwatch put-metric-alarm \
  --alarm-name aurora-orders-writer-blocked-txn \
  --alarm-description "orders writer blocked transactions above 5% of normal active" \
  --namespace AWS/RDS \
  --metric-name BlockedTransactions \
  --dimensions Name=DBInstanceIdentifier,Value=orders-cluster-instance-1 \
  --statistic Average \
  --period 60 \
  --evaluation-periods 5 \
  --datapoints-to-alarm 5 \
  --threshold 20 \
  --comparison-operator GreaterThanThreshold \
  --alarm-actions arn:aws:sns:eu-west-2:123456789012:oncall-alerts

When it fires

  1. Find the blocker (MySQL 8.0-compatible versions):
    SELECT waiting_pid, waiting_query, blocking_pid, blocking_query,
           wait_age
    FROM sys.innodb_lock_waits
    ORDER BY wait_age DESC;
    Then check information_schema.innodb_trx for how long the blocking transaction has been open.
  2. Decide whether to end it. Killing the blocking session rolls back its work, which can itself take time for a large transaction.
  3. Fix the pattern: commit in smaller batches, add indexes so updates lock only the rows they need, keep transactions short and never wait on user input inside one, and set sensible lock wait timeouts.
  4. Use Performance Insights to see lock wait events and the SQL involved.

Questions

Which CloudWatch alarms should I set for RDS?

Start with CPUUtilization, FreeStorageSpace, FreeableMemory, DatabaseConnections and read and write latency per instance, then add engine-specific ones such as ReplicaLag, DBLoad or the Aurora metrics on this site.

Is BlockedTransactions the same as deadlocks?

No. Blocked transactions are waiting for a lock; a deadlock is a cycle of waits that InnoDB resolves by rolling one transaction back. Many blocked transactions can occur without any deadlock.

When this happens away from your desk

Lock contention can turn a healthy database unresponsive in minutes, and the fix is often a single long transaction. CloudConsole, a phone app for AWS, is built to show the alarm and related metrics on your phone so you can spot it fast.

Did it start after a deploy? What changed? on the app’s alarm screen lists the deploys and configuration changes from the hour before the alarm fired.

About the app → · Download on the App Store

Sources