Frame Size Configuration and RowTooLarge Error Resolution in Druid
Frame Size Configuration and RowTooLarge Error Resolution in Druid
Background
In Apache Druid, data processing usually involves dividing large-scale data into multiple “frames” for processing. In this process, the frame size is a key parameter that determines how much data can be processed in each frame. A frame size that is too large or too small can affect performance or cause processing to fail. This error log indicates that while processing a particular piece of data, a row of data was encountered whose size exceeded the specified frame size, causing the task to fail.
Error Message:
1 | |
Indicates that while processing data, Druid encountered a row of data whose size exceeded 1,000,000 bytes (i.e., STANDARD_FRAME_SIZE ) and was unable to fit the current frame size limit.
Debug
Frame Size Configuration: As you can see from the code snippet, Druid’s default frame size is
1,000,000bytes. The value ofSTANDARD_FRAME_SIZEis statically defined:1
private static final int STANDARD_FRAME_SIZE = 1_000_000;This value is used as the standard frame size for memory allocation during Druid task execution:
1
2
3
4
5
6
7
8
9
10
11
12
13
14final InputChannels inputChannels =
new InputChannelsImpl(
workOrder.getQueryDefinition(),
InputSlices.allReadablePartitions(workOrder.getInputs()),
inputChannelFactory,
() -> ArenaMemoryAllocator.createOnHeap(frameContext.memoryParameters().getStandardFrameSize()),
exec,
cancellationId
);
public int getStandardFrameSize()
{
return STANDARD_FRAME_SIZE;
}Task Failure Reason: The task failed because a row of data exceeded the
1,000,000byte size limit and could not fit into a single frame. This error message indicates that during execution, a row of data was too large for the set maximum frame size, causing the task to fail.Modifying the frame size: If larger rows of data need to be processed, consider increasing the size of
STANDARD_FRAME_SIZEto allow larger rows of data to be processed per frame. For example, this could be modified to2,000,000or higher:1
private static final int STANDARD_FRAME_SIZE = 2_000_000;Memory Optimization: Increasing the frame size may increase memory consumption, so there is a trade-off between memory usage and data processing performance. If there is not enough memory, increasing the frame size may cause problems such as memory overflow. When adjusting this value, you need to consider the overall system memory and load.
Conclusion
The task failed because a row of data exceeded the maximum frame size ( 1,000,000 bytes) configured by Druid. To resolve this issue, you can consider the following options:
- Increase the frame size: Increase
STANDARD_FRAME_SIZEto a larger value, such as2,000,000or higher, to be able to handle larger rows of data. - Optimize data row size: If possible, adjust how data is generated to reduce the size of a single row of data.
- Memory management: Increasing the frame size may increase memory consumption and you need to make sure that the system has enough memory available.
When adjusting the frame size, it is recommended to test it in conjunction with actual memory usage to avoid other problems caused by insufficient memory.