LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-17-2005, 01:03 PM   #1
philpq
LQ Newbie
 
Registered: Jan 2005
Location: Scotland
Distribution: Suse 9.1
Posts: 2

Rep: Reputation: 0
Unhappy Why are multiple instances of mysqld running?


When I look at the Process Table in KDE System Guard it shows 10 instances of mysqld running - each with a different PID.
How do I go about finding what and how these are being started?

Regards
 
Old 02-17-2005, 01:51 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
You a ps -aeLf | grep mysqld

You should get something like this:

Code:
UID        PID  PPID   LWP  C NLWP STIME TTY          TIME CMD
root       958     1   958  0    1 14:38 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql     5196   958  5196  0    1 14:38 ?        00:00:00 /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
mysql    30966  5196 30966  0    1 14:38 ?        00:00:00 /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
mysql    10776 30966 10776  0    1 14:38 ?        00:00:00 /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
mysql     1036 30966  1036  0    1 14:38 ?        00:00:00 /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
root      4024  8245  4024  0    1 14:46 pts/2    00:00:00 grep mysqld
Now, following this you can see /usr/bin/mysqld_safe was executed (PID 958). This in turn called mysqld (PID 5196). That mysqld called another mysqld (PID 30966) which in turn called two more mysqld's (PID 10776 and 1036). You can tell this because PPID shows you the parent process.

Now the mysqld_safe in my case was has a parent of PID 1, which is init, which usually means it was executed by the init scripts.

The reason mysql works starts multiple processes/threads is because it can run more efficiently that way.

Last edited by jtshaw; 02-17-2005 at 01:52 PM.
 
Old 02-17-2005, 03:01 PM   #3
philpq
LQ Newbie
 
Registered: Jan 2005
Location: Scotland
Distribution: Suse 9.1
Posts: 2

Original Poster
Rep: Reputation: 0
Smile

What an excellent, clear and well illustrated answer. I now understand what is going on.
Many thanks.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple instances of artsd Mojojo Linux - Software 0 10-13-2005 11:41 AM
SAMBA: Multiple Instances? Matir Linux - Software 0 02-18-2005 10:43 AM
Multiple Instances of MPlayer? Levitate Linux - Software 2 01-13-2005 12:04 PM
Multiple instances of PHP cubax Linux - Newbie 6 12-30-2004 08:04 PM
Mplayer and Multiple instances Spaz007 Linux - Software 0 09-16-2004 10:59 PM


All times are GMT -5. The time now is 10:15 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration