Details
-
New Feature
-
Status: Open (View Workflow)
-
Trivial
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The method of limiting memory usage of the session command history with max_sescmd_history is not good as it allows for very large ranges of memory usages and very bad worse-case memory usage.
The theoretical maximum amount of memory used by a single session can be calculated by multiplying the value of max_allowed_packet on the database with the value of max_sescmd_history. With the default values for both MariaDB and MaxScale, this ends up being 800MiB per client.
Given the fact that most session commands consist of SET statements that prepare the session's state, this is not as big of a problem as it seems to be. In practice the amount of memory used should be around a few dozen kilobytes at most for your average client application.