Posted On: Mar 10, 2022

Amazon Lambda now supports Max Batching Window, a new feature that allows developers to fine tune Lambda invocation for cost optimization. This feature gives you additional control on batching behavior when processing data from Amazon MSK, Apache Kafka, and Amazon MQ for Apache Active MQ as event sources.

Lambda reads records from an event source stream at a fixed cadence and invokes a function with a batch of records. Max Batching Window allows you to wait as long as 300s to build a batch before invoking a function. Now, a function is invoked when one of the following conditions is met: the payload size reaches 6MB, the Max Batching Window reaches its maximum value, or the Batch Size reaches its maximum value. With Max Batching Window, you can increase the average number of records passed to the function with each invocation. This is helpful when you want to reduce the number of invocations and optimize cost.

You can get started with Max Batching Window via Amazon Web Services Management Console, Amazon CLI, or Amazon SDK for Lambda. It can be used at no additional cost in Amazon Web Services China (Beijing) Region, operated by Sinnet, and Amazon Web Services China (Ningxia) Region, operated by NWCD. To learn more, see