View previous topic :: View next topic |
Author |
Message |
nkolia n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Jul 2004 Posts: 21
|
Posted: Tue Aug 03, 2004 5:38 am Post subject: Multiple mysqld and apache2 processes |
|
|
When my cpu boots, there are 5 mysqld processes running and 7 apache2 processes running, 1 of each running as root.
I don't think its normal to have so many processes for the two servers, does anyone know how I can fix this?
Code: |
root 17955 0.0 0.1 4248 1072 ? Ss 01:36 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 17988 0.0 0.6 56672 7016 ? S 01:36 0: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 17989 0.0 0.6 56672 7016 ? S 01:36 0: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 17990 0.0 0.6 56672 7016 ? S 01:36 0: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 17991 0.0 0.6 56672 7016 ? S 01:36 0: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 18083 8.5 1.3 134780 13384 ? Ss 01:37 0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache 18085 0.0 1.1 133656 11628 ? S 01:37 0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache 18086 0.0 1.3 134780 13428 ? S 01:37 0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache 18087 0.0 1.3 134780 13424 ? S 01:37 0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache 18088 0.0 1.3 134780 13424 ? S 01:37 0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache 18089 0.0 1.3 134780 13424 ? S 01:37 0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache 18090 0.0 1.3 134780 13424 ? S 01:37 0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
|
_________________ Nadeem Kolia
Naruto Chaos
nkolia@gmail.com |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pmjdebruijn Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/98586132942f7499e2acc0.png)
Joined: 24 Jul 2003 Posts: 506 Location: Sittard, The Netherlands
|
Posted: Tue Aug 03, 2004 8:58 am Post subject: |
|
|
Hi,
Please paste this in:
/lib/libc.so.6
So I can see if you're using NPTL or not...
Next, well this is totally normal for apache (using a prefork MPM)... It has multiple processes preforked to be able to handle more connections faster...
About MySQL I'm not totally sure, I thought it was multithreaded... But if you're not using NPTL, the threads might show up as individual processes...
So don't worry too much...
Regards,
Pascal de Bruijn |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kashani Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9629732313ee51df8c5935.jpg)
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Tue Aug 03, 2004 3:57 pm Post subject: |
|
|
It's normal for both and you'll generally see most servers under Linux do this as process forking has always been cheap and well understood and threading is just starting to get itself together.
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nkolia n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Jul 2004 Posts: 21
|
Posted: Wed Aug 04, 2004 7:36 pm Post subject: |
|
|
Um, /lib/libc.so.6 is unreadable, is there another way I can check to see if I'm using NPTL or not? _________________ Nadeem Kolia
Naruto Chaos
nkolia@gmail.com |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pmjdebruijn Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/98586132942f7499e2acc0.png)
Joined: 24 Jul 2003 Posts: 506 Location: Sittard, The Netherlands
|
Posted: Wed Aug 04, 2004 10:05 pm Post subject: |
|
|
Quote: | Um, /lib/libc.so.6 is unreadable, is there another way I can check to see if I'm using NPTL or not? |
Please read that sentance, and read it over and over again...
...
Unreadable? that's your C Library, how the hell does your system work then?
That's a serieus issue? What's your definition of unreadable? Wrong permissions/ownership?
Regards,
Pascal de Bruijn |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
syscrash Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/139080976042e7ea3aaf309.png)
Joined: 14 Apr 2003 Posts: 541
|
Posted: Wed Aug 04, 2004 10:13 pm Post subject: |
|
|
nkolia wrote: | Um, /lib/libc.so.6 is unreadable, is there another way I can check to see if I'm using NPTL or not? |
He meant for you to do this at a terminal:
Without the $, of course, that means a normal user prompt. _________________ Play ET? Come by #gentoo.et on freenode!
http://syscrash.ca |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
r4d1x Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/PowerPuffs/cartoon_powerpuff_blossom.gif)
Joined: 25 Nov 2003 Posts: 157 Location: Japan
|
Posted: Thu Aug 05, 2004 1:23 am Post subject: |
|
|
Isnt apache supposed to thread for each connection? So say if you have the max connections set to 5 in apache2.conf then 5 connections are made it will "spawn" 5 new processes? As for mysql, Ive never seen more than one precess for it before, and with snort, cacti, nagios, and various other programs that use mysql theres only 1 process for it. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kashani Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9629732313ee51df8c5935.jpg)
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Thu Aug 05, 2004 1:38 am Post subject: |
|
|
r4d1x wrote: | Isnt apache supposed to thread for each connection? So say if you have the max connections set to 5 in apache2.conf then 5 connections are made it will "spawn" 5 new processes? As for mysql, Ive never seen more than one precess for it before, and with snort, cacti, nagios, and various other programs that use mysql theres only 1 process for it. |
Only if you recompile Apache for threads otherwise it forks for each connection. As for mysql I'm not entirely sure, but I see a number of them on my db.
[root@laxlxdb01 root]# ps -ef | grep mysql | wc -l
329
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nkolia n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Jul 2004 Posts: 21
|
Posted: Thu Aug 05, 2004 2:42 am Post subject: |
|
|
Sorry my fault, when he said past the file I thought he meant paste the contents of the file, which is why I said it was unreadable, but anyway here it is:
Code: |
nkolia@gentoo ~ $ /lib/libc.so.6
GNU C Library 20040619 release version 2.3.4, by Roland McGrath et al.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.4.1 (Gentoo Linux 3.4.1, ssp-3.4-2, pie-8.7.6.3).
Compiled on a Linux 2.4.26 system on 2004-07-16.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
linuxthreads-0.10 by Xavier Leroy
BIND-8.2.3-T5B
libthread_db work sponsored by Alpha Processor Inc
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
|
_________________ Nadeem Kolia
Naruto Chaos
nkolia@gmail.com |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pmjdebruijn Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/98586132942f7499e2acc0.png)
Joined: 24 Jul 2003 Posts: 506 Location: Sittard, The Netherlands
|
Posted: Thu Aug 05, 2004 10:59 am Post subject: |
|
|
Well I see your still using LinuxThreads... That means that whenever you're using threads you will still see a process for each thread...
With NPTL this finally changed... Threads are no longer visible as seperate processes (as it should be).
Regards,
Pascal de Bruijn |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nkolia n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Jul 2004 Posts: 21
|
Posted: Thu Aug 05, 2004 1:10 pm Post subject: |
|
|
Should I be using NPTL, is there any advantage in terms of performance. If so, how do I start using it? _________________ Nadeem Kolia
Naruto Chaos
nkolia@gmail.com |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pmjdebruijn Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/98586132942f7499e2acc0.png)
Joined: 24 Jul 2003 Posts: 506 Location: Sittard, The Netherlands
|
Posted: Thu Aug 05, 2004 1:31 pm Post subject: |
|
|
NPTL is faster...
but, you should only really notice that when you have applications that use lots and lots of threads...
Anyway, how to do NPTL... search the forums for NPTL... You'll find lots of stuff...
Regards,
Pascal de Bruijn |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|