LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-03-2005, 04:48 AM   #1
guarriman
Member
 
Registered: Nov 2004
Posts: 101

Rep: Reputation: 15
10 mysqld daemons using 8.6% of memory each one


Hi.

Working on Fedora Core 2, I'm suffering memory problems I can't understand
very well.

I only run a webserver (Apache) with several websites and DataBases (MySQL).
My machine has 508072 kbytes of RAM memory, and at this moment it's using 92.8%.

[]# top
Mem: 508072k total, 466684k used, 41388k free, 60936k buffers
Swap: 1084376k total, 4668k used, 1079708k free, 105780k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1980 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:08.71 mysqld
1981 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:10.18 mysqld
1982 mysql 20 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1983 mysql 17 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1984 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1985 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1986 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.71 mysqld
1987 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.50 mysqld
1988 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1989 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.69 mysqld
29647 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
30815 mysql 17 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld

[]# pstree mysql -p
mysqld(1980)───mysqld(1981)─┬─mysqld(1982)
├─mysqld(1983)
├─mysqld(1984)
├─mysqld(1985)
├─mysqld(1986)
├─mysqld(1987)
├─mysqld(1988)
├─mysqld(1989)
├─mysqld(29647)
└─mysqld(30815)

[]# ps -ef
root 1948 1 0 Sep30 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/ru
mysql 1980 1948 0 Sep30 ? 00:00:08 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
mysql 1981 1980 0 Sep30 ? 00:00:10 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
mysql 1982 1981 0 Sep30 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
mysql 1983 1981 0 Sep30 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
mysql 1984 1981 0 Sep30 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
mysql 1985 1981 0 Sep30 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
mysql 1986 1981 0 Sep30 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
mysql 1987 1981 0 Sep30 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
mysql 1988 1981 0 Sep30 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
mysql 1989 1981 0 Sep30 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid

Why are there always 10 sub-daemons using 8.6% of the Memory each one? I run also a
Fedora Core 2 machine at home with Apache and several websites with several DBs and don't
suffer this issue...

Thank you very much
 
Old 10-03-2005, 07:38 PM   #2
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
# top
Mem: 508072k total, 466684k used, 41388k free, 60936k buffers
Swap: 1084376k total, 4668k used, 1079708k free, 105780k cached
The memory usage displayed by top includes the disk cache that the kernel maintains so it will always show memory as almost all used. To see what's actually used by programs compared to whats available (or 'free' for use by programs) run
Code:
free -m
and use the numbers on the '+/- buffers/cache' line.

There's recently been a thread about this: http://www.linuxquestions.org/questi...hreadid=360160

Quote:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1980 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:08.71 mysqld
1981 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:10.18 mysqld
1982 mysql 20 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1983 mysql 17 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1984 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1985 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1986 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.71 mysqld
1987 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.50 mysqld
1988 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1989 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.69 mysqld
29647 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
30815 mysql 17 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
ps doesn't count memory shared between processes in the right way. Its not uncommon to have it add up to 500% or more of memory used which is obviously nonsense.
 
Old 10-04-2005, 10:38 AM   #3
guarriman
Member
 
Registered: Nov 2004
Posts: 101

Original Poster
Rep: Reputation: 15
Hi tkedwards. Thank you very much for your ansewers.

I tried with 'free -m':
----------
total used free shared buffers cached
Mem: 496 492 3 0 40 81
-/+ buffers/cache: 370 125
Swap: 1058 4 1054
------------

I understand that I've got 125 Mbytes freee (25%), right?

The issue is that I noticed past week that MySQL daemon was stopped and I read
at '/var/log/messages':
Sep 30 12:17:13 myserver kernel: Out of Memory: Killed process 547 (mysqld).
Sep 30 12:27:25 myserver kernel: Out of Memory: Killed process 548 (mysqld).
Sep 30 12:31:30 myserver kernel: Out of Memory: Killed process 549 (mysqld).
Sep 30 12:31:42 myserver kernel: Out of Memory: Killed process 550 (mysqld).
Sep 30 12:32:38 myserver kernel: Out of Memory: Killed process 551 (mysqld).
Sep 30 12:33:29 myserver kernel: Out of Memory: Killed process 552 (mysqld).
Sep 30 12:35:14 myserver kernel: Out of Memory: Killed process 553 (mysqld).

Some minutes before:
Sep 30 12:10:49 www kernel: oom-killer: gfp_mask=0x1d2
Sep 30 12:11:06 www kernel: DMA per-cpu:
Sep 30 12:11:17 www kernel: cpu 0 hot: low 2, high 6, batch 1
Sep 30 12:11:22 www kernel: cpu 0 cold: low 0, high 2, batch 1
Sep 30 12:11:32 www kernel: Normal per-cpu:
Sep 30 12:11:44 www kernel: cpu 0 hot: low 32, high 96, batch 16
Sep 30 12:11:47 www kernel: cpu 0 cold: low 0, high 32, batch 16
Sep 30 12:12:22 www kernel: HighMem per-cpu: empty

Last edited by guarriman; 10-04-2005 at 10:43 AM.
 
Old 10-04-2005, 06:32 PM   #4
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
I understand that I've got 125 Mbytes freee (25%), right?
Yeah.



Quote:
The issue is that I noticed past week that MySQL daemon was stopped and I read
at '/var/log/messages':
Sep 30 12:17:13 myserver kernel: Out of Memory: Killed process 547 (mysqld).
This could have been caused by a lot of things, it may not even be MySQL that's causing it but another process on the system. Besides an actual lack of memory it could be a bug, ulimits set too low, lack of swap space or something else even - google around for "Out of Memory: Killed process ". Also see this article, it explains it a bit: http://lwn.net/Articles/104179/ Generally this 'OOM Killer' thing only gets invoked as a last resort to avoid a kernel panic but you could try turning it off (as suggested in the LWN article) and see what happens.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with mysqld karthik85nitt Linux - Newbie 1 06-24-2005 06:21 AM
mysqld on startup... dark poet Linux - Newbie 8 10-05-2003 12:16 AM
mysqld command - help eduac Linux - Software 12 07-01-2003 01:15 PM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 04:48 PM
Mysqld cinnix Linux - General 4 07-08-2001 01:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration