mysqd_safe high cpu usage

Bug #105457 reported by Razvan Gavril
144
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Ubuntu Server papercuts
Invalid
Undecided
Unassigned
mysql-dfsg-5.0 (Debian)
Unknown
Unknown
mysql-dfsg-5.0 (Ubuntu)
Triaged
Low
Unassigned

Bug Description

mysqld_safe bash wrapper is very high on cpu usage some times. Trying to debug the problem i saw that there where 2 instances of the script running on the same time, the the one that used the cpu so high had no child mysqld process. I issues a /etc/init.d/mysql stop but the cpu hungry process didn't died, still eating all cpu cycles. At the end of the report i copy & pasted outputs of some command that i found useful to describe the problem.

I couldn't get any step to reproduce the problem but i saw it more that once, on different edgy installed systems. I also saw a topic on forum talking about this problem : http://ubuntuforums.org/showthread.php?p=2368931

dcerouter_11726:~# top
top - 02:57:28 up 3:34, 7 users, load average: 1.93, 1.90, 1.87
Tasks: 218 total, 1 running, 215 sleeping, 0 stopped, 2 zombie
Cpu(s): 15.4%us, 44.8%sy, 0.0%ni, 39.3%id, 0.2%wa, 0.2%hi, 0.2%si, 0.0%st
Mem: 969576k total, 799984k used, 169592k free, 118608k buffers
Swap: 2835432k total, 17624k used, 2817808k free, 336764k cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 4566 root 25 0 1656 528 436 S 97 0.1 206:14.53 mysqld_safe

dcerouter_11726:~# strace -p 4566
------------
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbfdccc50, 0, NULL) = -1 ECHILD (No child processes)
----------

dcerouter_11726:/var/log# ps axf | grep mysqld
 4566 ? R 213:49 /bin/sh /usr/bin/mysqld_safe
 4724 ? S 0:00 /bin/sh /usr/bin/mysqld_safe
13513 ? Sl 1:20 \_ /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
13524 ? S 0:00 \_ logger -p daemon.err -t mysqld_safe -i -t mysqld
29490 pts/34 S+ 0:00 \_ grep mysqld

dcerouter_11726:~# dpkg -l '*mysql*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============================================-==============================================-============================================================================================================
un gda2-mysql <none> (no description available)
un libclass-dbi-mysql-perl <none> (no description available)
ii libdbd-mysql-perl 3.0006-1 A Perl5 database interface to the MySQL database
un libmysql-java <none> (no description available)
un libmysqlclient-dev <none> (no description available)
ii libmysqlclient10 3.23.56-3 LGPL-licensed client library for MySQL databases
ii libmysqlclient12 4.0.24-10ubuntu2 mysql database client library
un libmysqlclient12-dev <none> (no description available)
ii libmysqlclient14 4.1.15-1ubuntu5 mysql database client library
un libmysqlclient15 <none> (no description available)
ii libmysqlclient15off 5.0.24a-9ubuntu2 mysql database client library
un libmysqlclient6-dev <none> (no description available)
un libmysqlclient9 <none> (no description available)
un libmysqlclient9-dev <none> (no description available)
ii libqt3-mt-mysql 3.3.6-3ubuntu3 MySQL database driver for Qt3 (Threaded)
un libqt3-mysql <none> (no description available)
un libqt3c-mt-mysql <none> (no description available)
un libqt3c102-mt-mysql <none> (no description available)
un mysql <none> (no description available)
un mysql-base <none> (no description available)
ii mysql-client 5.0.24a-9ubuntu2 mysql database client (current version)
un mysql-client-4.1 <none> (no description available)
ii mysql-client-5.0 5.0.24a-9ubuntu2 mysql database client binaries
ii mysql-common 5.0.24a-9ubuntu2 mysql database common files (e.g. /etc/mysql/my.cnf)
un mysql-common-4.1 <none> (no description available)
un mysql-dev <none> (no description available)
un mysql-devel <none> (no description available)
un mysql-gpl-client <none> (no description available)
ii mysql-server 5.0.24a-9ubuntu2 mysql database server (current version)
un mysql-server-4.1 <none> (no description available)
ii mysql-server-5.0 5.0.24a-9ubuntu2 mysql database server binaries
ii php4-mysql 4.4.2-1.1 MySQL module for php4
un php5-mysql <none> (no description available)
un virtual-mysql-client <none> (no description available)
un virtual-mysql-server <none> (no description available)
dcerouter_11726:~#

Revision history for this message
Mathias Gug (mathiaz) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Can you have a look at the log messages in /var/log/mysql.err and /var/log/mysql.log ?

Changed in mysql-dfsg-5.0:
status: New → Incomplete
Revision history for this message
Mathias Gug (mathiaz) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in mysql-dfsg-5.0:
status: Incomplete → Invalid
Revision history for this message
Gary (pento) wrote :

I've also encountered this bug, though have been unable to reproduce it.

My mysql.err and mysql.log files are empty.

Changed in mysql-dfsg-5.0:
status: Invalid → New
Revision history for this message
Jeroen Zwarts (jeroenz) wrote :

I have the same problem.
Yesterday I stopped mysqld through the init.d script, which worked, because there was no listener active, no socketfile, and init.d/mysql status said: Stopped.
But I looked on my server today, and there was still a mysqld_safe process taking up 100% cpu.

strace -p [mysqld_safe pid] endlessly says:
wait4(-1, 0xbff21280, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbff21280, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbff21280, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbff21280, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbff21280, 0, NULL) = -1 ECHILD (No child processes)
wait4(-1, 0xbff21280, 0, NULL) = -1 ECHILD (No child processes)

There's no information in mysql.err and mysql.log at all.
I installed the server yesterday, and made no changes in my.cnf. It's completely standard.

Mysql version is: 5.0.45-1ubuntu3.1

Revision history for this message
Gargoyle (g-rgoyle) wrote :

I have also seen this problem today on MySQL. My /var/log/mysql.err and .log files are also empty, I suspect this is another bug where the installation file is not configuring syslogd properly. However, below are some lines from /var/log/syslog. After I noticed that mysqld_safe was at 100% cpu, I issued a mysqladmin shutdown. (Note, up until that point the server and database were still running fine)

I suspect the first "mysqld_safe[15155]: ended" message is from the shutdown command and the second is the one I manually killed of via top.

----
Jan 22 14:27:24 mysql-01 -- MARK --
Jan 22 14:30:45 mysql-01 mysqld[13897]: 080122 14:30:45 [Note] /usr/sbin/mysqld: Normal shutdown
Jan 22 14:30:45 mysql-01 mysqld[13897]:
Jan 22 14:30:47 mysql-01 mysqld[13897]: 080122 14:30:47 InnoDB: Starting shutdown...
Jan 22 14:30:52 mysql-01 mysqld[13897]: 080122 14:30:52 InnoDB: Shutdown completed; log sequence number 0 71517936
Jan 22 14:30:52 mysql-01 mysqld[13897]: 080122 14:30:52 [Note] /usr/sbin/mysqld: Shutdown complete
Jan 22 14:30:52 mysql-01 mysqld[13897]:
Jan 22 14:30:52 mysql-01 mysqld_safe[15155]: ended
Jan 22 14:43:42 mysql-01 mysqld_safe[15180]: ended
Jan 22 14:44:04 mysql-01 mysqld_safe[15279]: started
Jan 22 14:44:08 mysql-01 mysqld[15282]: 080122 14:44:08 InnoDB: Started; log sequence number 0 71517936
Jan 22 14:44:08 mysql-01 mysqld[15282]: 080122 14:44:08 [Note] /usr/sbin/mysqld: ready for connections.
Jan 22 14:44:08 mysql-01 mysqld[15282]: Version: '5.0.45-Debian_1ubuntu3.1-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Debian etch distribution
Jan 22 14:44:08 mysql-01 /etc/mysql/debian-start[15344]: Upgrading MySQL tables if necessary.
Jan 22 14:44:09 mysql-01 /etc/mysql/debian-start[15348]: Looking for 'mysql' in: /usr/bin/mysql
Jan 22 14:44:09 mysql-01 /etc/mysql/debian-start[15348]: Looking for 'mysqlcheck' in: /usr/bin/mysqlcheck
Jan 22 14:44:09 mysql-01 /etc/mysql/debian-start[15348]: This installation of MySQL is already upgraded to 5.0.45, use --force if you still need to run mysql_upgrade
Jan 22 14:44:09 mysql-01 /etc/mysql/debian-start[15357]: Checking for insecure root accounts.
Jan 22 14:44:09 mysql-01 /etc/mysql/debian-start[15361]: Checking for crashed MySQL tables.
----

Revision history for this message
Gargoyle (g-rgoyle) wrote :

Oops, forgot some version info...

MySQL Version = 5.0.45-Debian_1ubuntu3.1-log
uname -a = Linux mysql-01 2.6.22-14-server #1 SMP Sun Oct 14 22:09:15 GMT 2007 x86_64 GNU/Linux

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

the mysql log files are always empty on a debian/ubuntu system. mysql logs to syslog.

Revision history for this message
Mircea Vutcovici (mirceavutcovici) wrote :

I had the same problem: mysqd_safe using 100% CPU running wait4() syscall.
The problem started just after I've restarted MySQL, because I've changed the configuration file (I've changed bind-address from 127.0.0.1 to 0.0.0.0 in /etc/mysql/my.cnf).
I've noticed that more than one mysql_safe was running. After killall mysql_safe and started again the server, everything went back to normal.

Revision history for this message
Mathias Gug (mathiaz) wrote :

Also run into this bug when preforming an upgrade.

An interesting entry in /var/log/daemon.log:
 mysqld_safe[4464]: mysqld process hanging, pid 4356 - killed

Not sure if it's related to this process though.

Changed in mysql-dfsg-5.0:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This will trigger it every time:
$ apt-get remove --purge mysql-server-5.0

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This might be related to checking for crashed tables (ie poor interaction between debian-start and mysqld_safe). I noticed that mysql would not accept connections until the crashed tables operation was completed. mysqld_safe and /etc/init.d/mysql use mysqladmin to connect to the database, so there may be poor interaction here.

Revision history for this message
Michele Costantino Soccio (michelinux) wrote :

I have this problem too, and mysql has just been installed on my system (I installed the LAMP system from Synaptic). I did not touch any config file. It is using factory settings.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I previously said that this will trigger it every time:
$ apt-get remove --purge mysql-server-5.0

This is not the case. However, if you purge, then install, then immediately purge, you will trigger the bug. See my comments on 2008-03-13 for my thoughts on why.

Revision history for this message
estaticdeath (estaticdeath) wrote :

hey guys, the solution was to not install both mysql-server (meta package depending on the latest version) and mysql-server-5.0 (MySQL database server binaries), i just remove both and reinstall mysql-server-5.0 and it done well !

Revision history for this message
MrTuTu (tutu-tutu) wrote :

Thank you estaticdeath. Your solution works well !

Revision history for this message
estaticdeath (estaticdeath) wrote :

nevermind MrTuTu.

Revision history for this message
Paul van Genderen (paulvg) wrote :

estaticdeath: although I did have the mysql-server meta package, your solution didn't work for me. I wouldn't consider this bug triaged yet until there's a real solution. Thanks for your efforts though!

Revision history for this message
dustym (dustym) wrote :

I agree with Paul van Genderen, estaticdeath's solution didn't work for me, either.

Revision history for this message
Eskimo (dgolovin) wrote :

Actually it worked for me, but I have to remove everything related to MySql. So you can go to Synaptic Package Manager and search for mysql-, then sort it out by installed flag to get the found installed packages on top of list, then mark it for Complete Removal and finally apply the changes.

After that install only specific mysql packages as mysql-server-5.0 and mysql-client-5.0 (see attached screen-shot for detail).

Fill the difference:
1. No 100% CPU usage
2. mysqld is running instead of mysqld_safe

Revision history for this message
Torsten Bronger (bronger) wrote :

Can someone confirm Eskimo's report? Actually, mysqld_safe is part of mysql-server-5.0, so I can't really believe that this disables it.

Revision history for this message
William Pitcock (nenolod) wrote :

This is hitting me really hard on a cluster I run with several users having ubuntu instances. Many instances are using 100% CPU due to this bug and causing the overall degradation of service I can provide on my cluster.

It needs to be fixed, the rating "Importance: low" is entirely bogus.

Revision history for this message
Kashinath Rajendra Pande (kash-tripleback) wrote :

I'm in agreement with William. I, too, run VPS's for several users and offer Ubuntu as a choice. When they run MySQL, CPU usage is through the roof, killing any hope in hell for equal CPU rights with other users. The "low" importance is probably due to the fact that Cancomical realises that no one should ever use Ubuntu for any server installation, ever, and thus aren't going to deal with this any further.

Revision history for this message
Torsten Bronger (bronger) wrote :

I experienced this bug three times in two weeks. On my system, it implies that my backups take two hours instead of 10 minutes. On other systems, it may silently render the backup plan (or other maintainance) impossible, and this is no fun anymore. In my personal opinion, this is even critical.

Revision history for this message
Chris Twa (support-saskaweb) wrote :

I had a fresh install of Ubuntu Hardy with MySQL 5.0.51 and found the mysqld_safe using 100% CPU. The fix I did was edit the init.d/mysql script:

ERR_LOGGER=""

I've got a ton of nodes, so I don't often sift through these logs anyway -- YMMV

CaT

Revision history for this message
Torsten Bronger (bronger) wrote :

I suspect some sort of race condition between two mysql_safe processes. At least, every time I experienced this bug, there were at last two mysql_safe processes active, and at least one of them was running amok.

Revision history for this message
syadnom (dandenson) wrote :

the mysqld_safe script is where the bug is. it loops at full throttle. just an a sleep # in and it slows the looping. crazy that it eats up so many cpu cycles so fast! but non-attached shell scripts can spin in loop like this.

Revision history for this message
Magnus Hedemark (viridari) wrote :

Also affects Hardy. What justifies this being a low priority bug? This is pretty serious.

Revision history for this message
Torsten Bronger (bronger) wrote :

FYI, someone has filed a bug report on Debian, too, see <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499192>. (Maybe there're duplicates, I don't know.)

Revision history for this message
john W (marcusjohn) wrote :

I am running Ubuntu 8.04 Hardy 64 bit.
This exact problem started when I added MythTV from the standard repository.
MythTV adds a MySQL server.
I had already had MySQL server from an Apache install.
Now I seem to have two SQL servers.

I have some clues to add, although I am a Linux newbie and a recent Vista convert.
I had the mysqld_safe process running at 100 percent on one processor.
I ran this command: "sudo /etc/init.d/mysql restart"
and now I have two mysqld_safe processes running, 100 percent on both of two processors.

A view of /var/log/syslog shows a gazillion lines like this:

Oct 1 07:37:48 Athlon-Ubuntu kernel: [112619.174876] VFS: busy inodes on changed media.
Oct 1 07:37:48 Athlon-Ubuntu kernel: [112619.189661] VFS: busy inodes on changed media.
Oct 1 07:38:04 Athlon-Ubuntu kernel: [112635.159970] VFS: busy inodes on changed media.
Oct 1 07:38:04 Athlon-Ubuntu kernel: [112635.173478] VFS: busy inodes on changed media.

And then there was this interesting set of lines:

Oct 1 10:15:20 Athlon-Ubuntu mysqld_safe[24687]: Fatal error: Can't remove the pid file: /var/run/mysqld/mysqld.pid
Oct 1 10:15:20 Athlon-Ubuntu mysqld_safe[24689]: Please remove it manually and start /usr/bin/mysqld_safe again
Oct 1 10:15:20 Athlon-Ubuntu mysqld_safe[24691]: mysqld daemon not started

And then more of the gazillion lines

And then this, which happened at the time I issued the restart:

Oct 1 10:15:43 Athlon-Ubuntu mysqld_safe[24932]: started
Oct 1 10:15:43 Athlon-Ubuntu mysqld[24935]: 081001 10:15:43 InnoDB: Started; log sequence number 0 43655
Oct 1 10:15:43 Athlon-Ubuntu mysqld[24935]: 081001 10:15:43 [Note] /usr/sbin/mysqld: ready for connections.
Oct 1 10:15:43 Athlon-Ubuntu mysqld[24935]: Version: '5.0.51a-3ubuntu5.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
Oct 1 10:15:44 Athlon-Ubuntu /etc/mysql/debian-start[24974]: Upgrading MySQL tables if necessary.
Oct 1 10:15:44 Athlon-Ubuntu /etc/mysql/debian-start[24983]: Looking for 'mysql' in: /usr/bin/mysql
Oct 1 10:15:44 Athlon-Ubuntu /etc/mysql/debian-start[24983]: Looking for 'mysqlcheck' in: /usr/bin/mysqlcheck
Oct 1 10:15:44 Athlon-Ubuntu /etc/mysql/debian-start[24983]: This installation of MySQL is already upgraded to 5.0.51a, use --force if you still need to run mysql_upgrade
Oct 1 10:15:44 Athlon-Ubuntu /etc/mysql/debian-start[24989]: Checking for insecure root accounts.
Oct 1 10:15:44 Athlon-Ubuntu /etc/mysql/debian-start[24993]: WARNING: mysql.user contains 3 root accounts without password!
Oct 1 10:15:44 Athlon-Ubuntu /etc/mysql/debian-start[24994]: Checking for crashed MySQL tables.
Oct 1 10:15:45 Athlon-Ubuntu kernel: [122085.868833] VFS: busy inodes on changed media.

And then, more of the gazillion lines.

I am going to try the manual remove of the Pid file and post the results.

John.

Revision history for this message
john W (marcusjohn) wrote :

Deleting the Pid file made no difference.

I used "sudo top" and killed the two Mysql_safe processes and all is ok now.

If and when it returns I will post the conditions of return.

I hope these clues help to squish the bug.

John.

Revision history for this message
john W (marcusjohn) wrote :

I just checked, the gazillion VFS lines noted above are continuing inside of /var/log/syslog. The workaround may not be totally effective yet, unless there is some other problem on my system.
John.

Revision history for this message
foucault (aag) wrote :

Confirm, this is happening to me...

 2.6.22-14-generic #1 SMP Tue Dec 18 08:02:57 UTC 2007 i686 GNU/Linux
I have these mysql packages installed
ii mysql-client-5.0 5.0.45-1ubuntu3.3 MySQL database client binaries
ii mysql-common 5.0.45-1ubuntu3.3 MySQL database common files
rc mysql-common-4.1 4.1.11a-4sarge4 mysql database common files (e.g. /etc/mysql/my.cnf)
ii mysql-server-5.0 5.0.45-1ubuntu3.3 MySQL database server binaries

Revision history for this message
foucault (aag) wrote :

init.d/mysql script: ERR_LOGGER=""

This did not help me.

Revision history for this message
foucault (aag) wrote :

adding SLEEP 3 to mysqld_safe script did not help

also I noticed that init.d/mysql stop did not stop the process, i had to kill XX manually

and then restart. I have both sleep 3 and ER_LOGGER="" in place and its still juping between 80-99%

reverting to old setting and begging my thread stalk :)

Revision history for this message
foucault (aag) wrote :

found what I think the msql bug might be: http://bugs.mysql.com/bug.php?id=35647

I saw two copies of mysql_d running ...

I solved it for now, by both editing the /etc/init.d/mysql and starting and stopping mysql a bunch.

I commented out sanity check, as per the suggestion here http://forum.slicehost.com/comments.php?DiscussionID=1000

case "${1:-''}" in
'start')
# sanity_checks;
# Start daemon

I hope this is helpfull, (I wish I could edit my posts...) well you get the train of thought effect this way :P

Revision history for this message
Frank Groeneveld (frankgroeneveld) wrote :

How come this bugs importance is set to low? My virtual host is unusable when this bug happens and sometimes even apache starts failing because of the high load.

Revision history for this message
JPHein (jp-jphein) wrote :

I can confirm this bug. Ubuntu 8.04.1 - 64-bit.

Changed in mysql-dfsg-5.0:
status: Triaged → Confirmed
Revision history for this message
E-Jey (erik-kaasschaaf) wrote :

I also have this problem, very annoying. I killed the process and changed the /etc/init.d/mysql script. It seems to work but maybe it will come back..

Revision history for this message
foucault (aag) wrote :

Just squashed this bug on yet another server I think this only affects 32bit xen-kernal virtual instances, slicehost amazon ec2 etc. care to confirm, comment?

Revision history for this message
Magnus Hedemark (viridari) wrote :

@foucault - Nope. Mine (reported earlier) was x86-64 on raw iron; not xen.

Revision history for this message
Mrts (mrts) wrote :

Same here -- 100% CPU with 32-bit iron (no virtualization). On Hardy that should be long term supported.

It's quite serious, can anyone from Canonical comment on this?

Revision history for this message
Martin Hansen (martin-h) wrote :

I can confirm the same problem. @foucault: I was running an amazon EC2 instance, AMI-ID: ami-7efd1a17 (http://alestic.com/), 32 bit, 8.04.

And I also had 2 running mysqld_safe processes, one running wild, the other one as expected. (kinda easy to overlook the other process if you are just hunting down the culprit, as one usually sort by cpu usage :P)

And I also think I tried to start the mysql server when it already was running, as described as part of the problem in the mysql bug tracker link you gave. Although I'm not able to reproduce it by trying to start mysql when already started..

Mathias Gug (mathiaz)
Changed in mysql-dfsg-5.0:
status: Confirmed → Triaged
Revision history for this message
Brett Campbell (invsblduck) wrote :
Download full text (5.3 KiB)

Hello all,

I've experienced this problem today.
I'm feeling lazy, so I'll let you observe:

thor:/var/log$ uname -a
Linux thor 2.6.24-23-generic #1 SMP Mon Jan 26 00:13:11 UTC 2009 i686 GNU/Linux

thor:~$ cat /etc/issue
Ubuntu 8.04.2 \n \l

thor:~$ sudo apt-get install mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl
  mysql-client-5.0 mysql-server-5.0
Suggested packages:
  dbishell mysql-doc-5.0 tinyca
Recommended packages:
  libhtml-template-perl mailx
The following NEW packages will be installed:
  libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl mysql-client
  mysql-client-5.0 mysql-server mysql-server-5.0
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 36.3MB of archives.
After this operation, 108MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://us.archive.ubuntu.com hardy/main libnet-daemon-perl 0.38-1.1 [45.9kB]
Get:2 http://us.archive.ubuntu.com hardy/main libplrpc-perl 0.2017-1.1 [35.0kB]
Get:3 http://us.archive.ubuntu.com hardy/main libdbi-perl 1.601-1 [771kB]
Get:4 http://us.archive.ubuntu.com hardy/main libdbd-mysql-perl 4.005-1 [134kB]
Get:5 http://us.archive.ubuntu.com hardy-updates/main mysql-client-5.0 5.0.51a-3ubuntu5.4 [7826kB]
Get:6 http://us.archive.ubuntu.com hardy-updates/main mysql-server-5.0 5.0.51a-3ubuntu5.4 [27.4MB]
Get:7 http://us.archive.ubuntu.com hardy-updates/main mysql-client 5.0.51a-3ubuntu5.4 [52.1kB]
Get:8 http://us.archive.ubuntu.com hardy-updates/main mysql-server 5.0.51a-3ubuntu5.4 [54.2kB]
Fetched 36.3MB in 1min2s (586kB/s)
Preconfiguring packages ...
Selecting previously deselected package libnet-daemon-perl.
(Reading database ... 147205 files and directories currently installed.)
Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.38-1.1_all.deb) ...
Selecting previously deselected package libplrpc-perl.
Unpacking libplrpc-perl (from .../libplrpc-perl_0.2017-1.1_all.deb) ...
Selecting previously deselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.601-1_i386.deb) ...
Selecting previously deselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.005-1_i386.deb) ...
Selecting previously deselected package mysql-client-5.0.
Unpacking mysql-client-5.0 (from .../mysql-client-5.0_5.0.51a-3ubuntu5.4_i386.deb) ...
Selecting previously deselected package mysql-server-5.0.
Unpacking mysql-server-5.0 (from .../mysql-server-5.0_5.0.51a-3ubuntu5.4_i386.deb) ...
Selecting previously deselected package mysql-client.
Unpacking mysql-client (from .../mysql-client_5.0.51a-3ubuntu5.4_all.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.0.51a-3ubuntu5.4_all.deb) ...
Setting up libnet-daemon-perl (0.38-1.1) ...
Setting up libplrpc-perl (0.2017-1.1) ...
Setting up libdbi-perl (1.601-1) ...
Setting up libdbd-mysql-perl (4.005-1) ...
Setting up mysql-client-5.0 (5.0.51a-3ubuntu5.4) ...
Sett...

Read more...

Revision history for this message
Brett Campbell (invsblduck) wrote :

( Sorry for not attaching that, guys. )

Revision history for this message
Dewey_Oxberger (jonb-cirris) wrote :

I've got this problem on Ubuntu 9.04 RC (Mythbuntu). Dang strange database behavior. It seems mysql sometimes boots okay but sometimes it boots and I can't connect to it.

Revision history for this message
MarcRandolph (mrand) wrote :

> I've got this problem on Ubuntu 9.04 RC (Mythbuntu). Dang strange database behavior.
> It seems mysql sometimes boots okay but sometimes it boots and I can't connect to it.

That behavior sounds like Bug 326768 (https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/326768).
It may not be ideal, but have you investigated the work-around presented there?

Revision history for this message
Dima Ryazanov (dima-gmail) wrote :

I got this behavior when mysql got uninstalled when I ran "apt-get autoremove".

Revision history for this message
NickA (sdnick484-gmail) wrote :

I woke up this morning and found I was experiencing this issue on 9.04 (final, standard desktop version). I also saw two instances of mysql_safe with one eating all the CPU. I installed mytop but didn't see anything happening, and /etc/init.d/mysql restart did not help. Both mysql.log and mysql.err were empty files.

The only mysql database on this box is for Amarok 1.4, and amarok was not running at the time. Last night the problem was definitely not occurring, and I hadn't logged into this system for a couple days prior to that (the box was restarted on Sunday). The commands I performed last night were:
an apt-get update
apt-get upgrade
apt-get install prelink
prelink -amR

I just went through y dpkg.log, and mysql was updated last night, so I'm willing to bet the bug was somehow triggered by that process.

Revision history for this message
Frank Groeneveld (frankgroeneveld) wrote : Re: [Bug 105457] Re: mysqd_safe high cpu usage

We already know that the bug is triggered by something that restart
the mysql process (On my server it sometimes even occurs when I run
/etc/init.d/mysql restart)

2009/6/3 NickA <email address hidden>:
> I woke up this morning and found I was experiencing this issue on 9.04
> (final, standard desktop version).  I also saw two instances of
> mysql_safe with one eating all the CPU.  I installed mytop but didn't
> see anything happening, and /etc/init.d/mysql restart did not help.
> Both mysql.log and mysql.err were empty files.
>
> The only mysql database on this box is for Amarok 1.4, and amarok was not running at the time.  Last night the problem was definitely not occurring, and I hadn't logged into this system for a couple days prior to that (the box was restarted on Sunday).  The commands I performed last night were:
> an apt-get update
> apt-get upgrade
> apt-get install prelink
> prelink -amR
>
> I just went through y dpkg.log, and mysql was updated last night, so I'm
> willing to bet the bug was somehow triggered by that process.
>
> --
> mysqd_safe high cpu usage
> https://bugs.launchpad.net/bugs/105457
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
sandos (sandos) wrote :

Happens to me, too. Killing the mysqld_safe works, but I guess that is only temporary?

Revision history for this message
Kieran Hogg (xerosis) wrote :

I'm now getting this for the first time after upgrading to 5.1.37-1ubuntu2.

Revision history for this message
blackest_knight (blackest-knight) wrote :

came across this on ubuntu karmic alpha 5 , It was nice enough to share the cpu and luckily after rebooting the cpu usage was fine.

Having to reboot was disappointing.

Revision history for this message
Dave Walker (davewalker) wrote :

@Kieran Hogg
This should be resolved in 5.1.37-1ubuntu3

Revision history for this message
guivho (guivho) wrote :

I have this problem in 64-bit desktop karmic running mysql 5.1.37-1ubuntu5.

As part of my daily maintenance chores, I
   'sudo /etc/init.d/mysql stop'
the server, copy the database directory to my backup drive and
   'sudo /etc/init.d/mysql start'
the server afterwards.

Frequently, and I do not know when or why, the mysqld_safe process is not stopped by the above command.

The start command launches its own instance of the mysqld_safe process. And bingo, we've got to competing mysqld_safe processes and the load of one of the cpu's goes to 100%.

As a temporary solution, I will issue a
   'sudo killall mysqld_safe'
immediately after the stop command.

However this should not be needed, and I feel that this problem is really a showstopper, far from unimportant!

Revision history for this message
Mathias Gug (mathiaz) wrote :

Not a server papercut. The bug has been opened for a long time as it's not reliably reproducible.

This bug will probably be marked as won't fix as mysqld_safe should be replaced by an upstart job.

Changed in server-papercuts:
status: New → Invalid
Revision history for this message
Corentin Chary (iksaif) wrote :

It seems to be a dash bug, partly fixed by:
http://git.kernel.org/?p=utils/dash/dash.git;a=commit;h=3800d4934391b144fd261a7957aea72ced7d47ea

And this bug should be fixed, it's still present in Hardy, and Hardy support should stop April 21, 2011, not in 2010.

Revision history for this message
Corentin Chary (iksaif) wrote :

Please also note that the mysql bug may not be present in karmic because mysqld_safe was rewriting, but the dash bug is still here.

Revision history for this message
Calabacin (raulgarciag) wrote :

If it's hard to reproduce for you, I'm having it every now and then on my Ubuntu 9.04 server 64-bit, and I am willing to enable logs and do anything necessary to help you.

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.