Addressing the Maximum Table Memory Error
On this page
Note
SingleStore does not support setting the engine variables that are discussed in this topic.
If you see the error message below, the leaf at 'leafhost':leafport
has reached maximum_
, which is the maximum cumulative memory in use by all tables on a node.maximum_
is reached (SingleStore will become read-only).
Leaf Error (leafhost:leafport): Memory usage by SingleStore for tables (##### MB) has reached the value of 'maximum_table_memory' global variable (##### MB). This query cannot be executed.
You can resolve this issue with the steps below.
Check for Data Skew
First, determine which nodes are reaching their memory capacity.
If Data Skew Is not Present
If nodes are reaching maximum_
without skew, the cluster itself is nearing maximum memory capacity.DELETE
queries use 50 bytes of memory per record deleted until the DELETE
commits, so the maximum_
needs to be temporarily increased on all nodes during the DELETE
.
On each leaf node in your cluster, do the following:
-
Pause write workloads from an aggregator or your application.
-
Check current
maximum_
andmemory maximum_
.table_ memory select @@global.maximum_memory+-------------------------+ | @@global.maximum_memory | +-------------------------+ | 65536 | +-------------------------+ 1 row in set (0.00 sec)
select @@global.maximum_table_memory+-------------------------------+| @@global.maximum_table_memory |+-------------------------------+| 57927 |+-------------------------------+1 row in set (0.00 sec) -
Increase
maximum_
to 95% oftable_ memory maximum_
.memory The default value is 90% of maximum_
.memory set @@global.maximum_table_memory=62259;Query OK, 0 rows affected (0.00 sec)
-
Execute small batches of DELETE queries.
Limit to 100,000 records or less to reduce memory used until commit. DELETE FROM mytable limit 100000;Query OK, 0 rows affected (1.64 sec)
-
Restore
maximum_
to original value.table_ memory set @@global.maximum_table_memory=57927;Query OK, 0 rows affected (0.00 sec)
Last modified: April 26, 2023