# CloudWatch alarm: Aurora BlockedTransactions

CloudWatch alarms · Updated 16 November 2026

**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.

## 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

| Setting | Recommended value |
|---|---|
| Namespace | `AWS/RDS` |
| Metric | `BlockedTransactions` |
| Dimensions | DBInstanceIdentifier |
| Statistic | Average |
| Threshold | Depends on your situation (about 5% of ActiveTransactions) |
| Period | 60 seconds |
| Datapoints to alarm | 5 |
| Evaluation periods | 5 |
| Comparison operator | `GreaterThanThreshold` |

## 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.

[About the CloudConsole app](https://cloudconsole.dev/aws-console-app) · [Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## Sources

- [Recommended alarms (Amazon CloudWatch User Guide)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Best_Practice_Recommended_Alarms_AWS_Services.html)
- [Aurora MySQL row lock wait events](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/ams-waits.row-lock-wait.html)
- [Amazon Aurora User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/)

## Related

- [CloudWatch alarm: RDS DBLoad](https://cloudconsole.dev/alarms/rds-dbload)
- [CloudWatch alarm: Aurora RollbackSegmentHistoryListLength](https://cloudconsole.dev/alarms/rds-rollbacksegmenthistorylistlength)
- [CloudWatch alarm: RDS CPUUtilization](https://cloudconsole.dev/alarms/rds-cpuutilization)
- [Too many connections on RDS (MySQL / PostgreSQL)](https://cloudconsole.dev/errors/rds-too-many-connections)
- [CloudWatch alarm: RDS DatabaseConnections](https://cloudconsole.dev/alarms/rds-databaseconnections)
- [CloudWatch alarm: Aurora AuroraBinlogReplicaLag (error state)](https://cloudconsole.dev/alarms/rds-aurorabinlogreplicalag)

---

Source: https://cloudconsole.dev/alarms/rds-blockedtransactions

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
