[MXS-672] maxscale possible memory leak Created: 2016-04-15  Updated: 2016-04-20  Resolved: 2016-04-20

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: 1.4.1
Fix Version/s: 1.4.1

Type: Bug Priority: Critical
Reporter: Michael Froehlich Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Centos 6.7



 Description   

Hi,

we are running MaxScale version 1.4.1 with an application using hibernate and MaxScale is being killed roughly every 30 Min by OS because it is consuming to much memory.

I think it is related to the MySQL session/global variables.

Hibernate does the following things, when running selects:

set autocommit=0;
select * from table;
set autocommit=1;

i tried to reproduce it with a simple bash-loop, and the ram usage is rapidly increasing:

while true; do mysql -B -N -h 127.0.0.1 -u maxscale --port 4008 -e "set autocommit=0; select 1;" && mysql -B -N -h 127.0.0.1 -u maxscale --port 4008 -e "set autocommit=1; select 2;"; done

setting maxsec-cmd-history is not a solution for me, becaus the first values will soon be overwritten

i did not check the same thing during one session, maybe this has to be done.

Regards, Michael



 Comments   
Comment by markus makela [ 2016-04-15 ]

This is most likely caused by the storage of the session commands. I would recommend disabling the session command history with router_options=disable_sescmd_history=true. This will prevent the storing of the command history and will prevent slave recovery within the same session. If a slave disconnects when a client connection is open, no replacement is taken into use. To replace lost slave connections, it is recommended to disconnect from MaxScale so that the session state is again consistent across all servers.

For more information about session commands and how readwritesplit handles them, please read the Limitations document and the ReadWriteSplit documentation.

Comment by Timofey Turenko [ 2016-04-20 ]

I can confirm:
disable_sescmd_history=true prevents Maxscale from eating all the memory and being killed by OOM killer.

Generated at Thu Feb 08 04:01:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.