- Newest
- Most votes
- Most comments
The issue you're experiencing with out of memory errors after updating to Redshift patch 197 is related to how Redshift manages memory allocation across your cluster nodes and slices.
When you scale a Redshift cluster (like adding a node as you did), the data distribution doesn't automatically rebalance optimally across all slices. This can lead to uneven workload distribution where some nodes are working much harder than others, potentially causing memory issues on the heavily loaded nodes.
Your error message "Out Of Memory: context: alloc(16777216,MtExecPlanPoolCN)" indicates that Redshift was trying to allocate 16MB for the execution plan on a compute node but couldn't find enough memory.
While adding a node did resolve your immediate issue, it's not the most cost-effective solution if the underlying problem is data distribution. Here are some steps you can take to optimize your cluster without necessarily keeping the extra node:
-
Run VACUUM FULL followed by ANALYZE to reclaim space and update statistics
-
Check for data distribution skew across your nodes and slices using system views like stv_slices and stv_blocklist
-
For tables showing significant skew, consider recreating them with DISTSTYLE AUTO to let Redshift choose the optimal distribution style
-
For large tables that are causing problems, try a deep copy operation to redistribute the data:
CREATE TABLE new_table DISTSTYLE AUTO AS SELECT * FROM original_table;
- Check if your Workload Management (WLM) configuration needs adjustment - WLM controls memory allocation to query slots
If these steps don't resolve the issue, the patch may have changed how memory is allocated in your specific configuration, and you might need to contact AWS Support for further assistance.
Sources
Redshift cluster uses only 6 of 8 slices after scaling from 2 to 4 nodes | AWS re:Post
WLM dynamic memory allocation - Amazon Redshift
answered a year ago
Relevant content
asked 3 years ago
asked 7 years ago
asked 6 years ago
- AWS OFFICIALUpdated 7 months ago
