Gearman User Defined Functions for MySQL

memory leak with gearman_servers_set

Reported by Bicou on 2009-08-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman MySQL UDF
High
Eric Day

Bug Description

i'm having huge memory leak when i query :

SELECT gearman_servers_set("127.0.0.1:4730");

multiple times

here is my testcase :

memory for mysqld:
  PID PPID RSS VSZ %CPU %MEM CMD
 2825 2786 25464 172812 0.0 0.6 /usr/sbin/mysqld --basedir=...

i simulate 1000 clients doing a server set :
for i in `seq 1 1000`; do mysql -e 'SELECT gman_servers_set("127.0.0.1:4730");'; done

and then :
  PID PPID RSS VSZ %CPU %MEM CMD
 2825 2786 30840 189816 0.0 0.7 /usr/sbin/mysqld --basedir=

that's + 5MB

and after 10'000 iterations :
 2825 2786 86464 365440 0.1 2.1 /usr/sbin/mysqld --basedir=

that's + 56MB

i need to restart mysqld 2 times a day because of oom...

when i query a simple select from a database, nothing changes.

i think this is because servers_set is actually a server "add", but how can i set globally the gearman server without always querying gearman_servers_set, a query just after mysqld startup ?

can you please confirm this memory problem ?

Eric Day (eday) wrote :

You only need to run gman_servers_set() once at startup, doing so multiple times keeps adding entries to the list of possible servers. I agree though that this is poorly named and set() should replace, and add() should have this behavior. I'll fix this in the next release.

Changed in gearman-mysql-udf:
assignee: nobody → Eric Day (eday)
importance: Undecided → High
status: New → Confirmed
milestone: none → 0.4
Eric Day (eday) on 2009-09-29
Changed in gearman-mysql-udf:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers