Home icon
Preventing log loss with non-blocking mode in the AWSLogs container log driver

Blog



This article explains how to prevent log loss in Amazon ECS using the AWSLogs container log driver's non-blocking mode, which prioritizes application availability over guaranteed log delivery.

  • Blocking mode (default) halts application execution when logs cannot be sent; non-blocking mode buffers logs in memory
  • Recommended setting: max-buffer-size of 25MB for up to 5MB/s log output rate
  • Testing showed no log loss for ≤2MB/s with 4MB buffer; ≤5MB/s with 25MB buffer
  • Above 6MB/s sustained logging, log loss becomes difficult to prevent
  • Cross-region log uploads are unreliable; same-region uploads strongly recommended
  • No built-in metrics or alerts for detecting log loss with AWSLogs driver
  • Calculate per-container log throughput using CloudWatch IncomingBytes metric

The article recommends 25MB max-buffer-size for most use cases and emphasizes same-region log uploads to minimize log loss risk while maintaining application availability.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.