pt-kill leaks memory

Bug #1592166 reported by Sveta Smirnova
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Undecided
Carlos Salguero

Bug Description

pt-kill leaks memory each time it kills a query

How to repeat:

1. Start MySQL Server, create table for log-dsn option

2. Run pt-kill as a daemon:

/pt-kill --busy-time 1 --match-command Query --match-db sbtest --match-user sbtest.* --kill-query --print --daemonize --log-dsn D=backup,t=kill_log,h=127.0.0.1,P=13000,u=root h=127.0.0.1,P=13000,u=root

3. Record current memory usage:

sveta@Thinkie:~/src/percona-server$ pidstat -r -p 32202
Linux 4.2.0-36-generic (Thinkie) 13-06-2016 _x86_64_ (8 CPU)

23:18:27 UID PID minflt/s majflt/s VSZ RSS %MEM Command
23:18:27 1000 32202 0,00 0,00 176440 20756 0,13 perl

4. Run multiple-threaded workload. I run mysqlslap couple of dozens times:

/mysqlslap --host=127.0.0.1 --port=13000 -u sbtest --create-schema=sbtest --concurrency=20 -a --auto-generate-sql-unique-query-number=1000 -i 100

5. Watch what memory usage increased:

sveta@Thinkie:~/src/percona-server$ pidstat -r -p 32202
Linux 4.2.0-36-generic (Thinkie) 14-06-2016 _x86_64_ (8 CPU)

00:21:51 UID PID minflt/s majflt/s VSZ RSS %MEM Command
00:21:51 1000 32202 0,01 0,00 180340 25056 0,16 perl

Memory is never freed.

Bug is repeatable only if pt-kill kills queries, on idle server it does not consume memory.

Workaround: restart pt-kill every few days.

Tags: i69851
Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

sveta@Thinkie:~/src/percona-server$ ~/src/percona-toolkit/bin/pt-kill --version
pt-kill 2.2.17

tags: added: i69851
Changed in percona-toolkit:
status: New → Confirmed
Revision history for this message
Carlos Salguero (carlos-salguero) wrote :

Hi,

I've tried to reproduce it with no success.
In my tests, running as a daemon I have 0.14% memory usage from the very beginning and it does not change.

Could you provide some extra information like Perl, MySQL and OS version?

Thanks.

Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

sveta@Thinkie:~/src/percona-toolkit$ perl --version

This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux-gnu-thread-multi
(with 44 registered patches, see perl -V for more detail)

Copyright 1987-2013, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

sveta@Thinkie:~/src/percona-toolkit$ uname -a
Linux Thinkie 4.2.0-36-generic #42~14.04.1-Ubuntu SMP Fri May 13 17:27:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

MySQL -Percona Server 5.6, pulled from GitHub

To repeat you need queries to be recorded in the table, specified by --log-dsn. Also is better if queries of different type are recorded. If pt-kill does not kill it does not leak.

Changed in percona-toolkit:
status: Confirmed → In Progress
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
milestone: none → 2.2.19
Changed in percona-toolkit:
assignee: nobody → Carlos Salguero (carlos-salguero)
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1355

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.