Bug #27560 | Memory usage of mysqld grows while doing nothing | ||
---|---|---|---|
Submitted: | 31 Mar 2007 11:54 | Modified: | 12 Jul 2007 13:33 |
Reporter: | Geert Vanderkelen | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Cluster: Cluster (NDB) storage engine | Severity: | S2 (Serious) |
Version: | 5.0-bk, 5.1-bk | OS: | Linux (Linux) |
Assigned to: | Kristian Nielsen | CPU Architecture: | Any |
Tags: | Memory, mysqld, ndb, sr5_1 |
[31 Mar 2007 11:54]
Geert Vanderkelen
[31 Mar 2007 11:57]
Geert Vanderkelen
Cluster config.ini
Attachment: bug27560_config.ini (text/plain), 1.36 KiB.
[31 Mar 2007 11:59]
Geert Vanderkelen
Verified using 5.0.30. Also with 5.0.36 though it didn't grow that much.
[2 Apr 2007 11:07]
Kristian Nielsen
Managed to reproduce it as described (running on a single machine and with reduced memory parameters in config.ini). The following non-standard options in my.cnf seems to be needed to be able to see the leak: ndb-use-exact-count=0 ndb-force-send=1 ndb-cache-check-time=200
[2 Apr 2007 13:08]
Kristian Nielsen
Here is how to reproduce this from a recent bitkeeper source build tree: Create an empty test case ndb_kn.test: -- source include/have_ndb.inc -- source include/not_embedded.inc And create an options file ndb_kn-master.opt: --ndb-use-exact-count=0 --ndb-force-send=1 --ndb-cache-check-time=200 Then start the server/cluster: perl mysql-test-run.pl --start-and-exit ndb_kn Connect and create some tables: client/mysql --socket=mysql-test/var/tmp/master.sock -uroot test mysql> CREATE TABLE t1(a INT, PRIMARY KEY USING hash(a)) ENGINE=ndb; ... mysql> CREATE TABLE t49(a INT, PRIMARY KEY USING hash(a)) ENGINE=ndb; mysql> quit Connect again, exit immediately: client/mysql --socket=mysql-test/var/tmp/master.sock -uroot test mysql> quit Now the growing process can be observed with this: while(true); do DATA=`ps --no-headers -p <MYSQLD PID> -o euser,pid,vsz,rsz`; DT=`date +%Y%m%dT%H%M%S`; echo "$DT | $DATA"; sleep 5; done
[2 Apr 2007 13:54]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/23551 ChangeSet@1.2428, 2007-04-02 15:50:57+02:00, knielsen@ymer.(none) +1 -0 BUG#27560: Memory usage of mysqld grows while doing nothing The query-cache watch thread was continually allocating new thread entries on the THD MEM_ROOT, not freed until server exit. Fixed by using a simple array, auto-expanded as necessary.
[2 Apr 2007 16:07]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/23561 ChangeSet@1.2401, 2007-04-02 18:21:05+02:00, tomas@whalegate.ndb.mysql.com +1 -0 BUG#27560: Memory usage of mysqld grows while doing nothing The query-cache watch thread was continually allocating new thread entries on the THD MEM_ROOT, not freed until server exit. Fixed by using a simple array, auto-expanded as necessary.
[4 Apr 2007 15:26]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/23814 ChangeSet@1.2496, 2007-04-04 17:26:30+02:00, jbruehe@mysql.com +2 -0 BUG#27560: Memory usage of mysqld grows while doing nothing The query-cache watch thread was continually allocating new thread entries on the THD MEM_ROOT, not freed until server exit. Fixed by using a simple array, auto-expanded as necessary. (Originally done by Tomas on 2007-04-02 18:21:05+02:00; applied to the custom build BR#14007 by Joerg)
[7 Apr 2007 7:00]
Bugs System
Pushed into 5.0.40
[7 Apr 2007 7:00]
Bugs System
Pushed into 5.1.18-beta
[10 Apr 2007 6:37]
Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at http://dev.mysql.com/doc/en/installing-source.html Documented bug fix in 5.0.40, 5.1.18, telco-6.1.7, and telco-6.2.1 changelogs.
[11 Jul 2007 9:20]
Geert Vanderkelen
Re-opening as bug pops up again. Using 5.0.44 data nodes, I'm able to reproduce the problem using versions 5.0.44, 5.0.40, 5.0.42 and 5.0bk on the SQL node. Also, able to reproduce with all nodes being 5.0.44. Memory and CPU usage go high doing absolutely nothing but change to a database with NDB tables.
[12 Jul 2007 13:33]
Geert Vanderkelen
It's expected that memory and CPU is growing having query cache on and --ndb-cache-check-time pretty low. What happens is that each tables needs to be checked if the data in the query cache is still valid or not. These are round trips to the cluster. If the check time is low, this happens quite a lot. When there are lots of NDB tables, this can show. Re-closing.