LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Multiple httpd.conf entries in ps ax after restarting apache - is this normal? (https://www.linuxquestions.org/questions/linux-newbie-8/multiple-httpd-conf-entries-in-ps-ax-after-restarting-apache-is-this-normal-757554/)

EnderX 09-24-2009 01:30 PM

Multiple httpd.conf entries in ps ax after restarting apache - is this normal?
 
As the title says. System is running SuSE 9.3, apache2, and, since this is where the problem was first seen, php 5.2.0.

I was receiving an out of memory error on a php script, and from some of what I saw on the net, I thought I might be able to partially free memory by restarting apache2. After I did so, I refreshed my page's window, then went to take a look at the ps ax output. I found seven copies of the following line:
Code:

/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
Is this normal, or do I have some kind of problem on this system I need to take care of?

lhorace 09-24-2009 01:35 PM

can you include the output of ps ax. Second is this php code yours, try PHP Xdebug extension which can give you info, especially how much memory your script is using. Third, is this a PHP error or Apache error, when it says it's out of memory. You can increase the memory limit in php.ini file.

EnderX 09-24-2009 03:17 PM

Didn't save the previous run, but recreated the scenario. Contents of ps ax run:
Code:

  PID TTY      STAT  TIME COMMAND
    1 ?        S      0:00 init [5]
    2 ?        S      0:00 [migration/0]
    3 ?        SN    0:00 [ksoftirqd/0]
    4 ?        S<    0:00 [events/0]
    5 ?        S<    0:00 [khelper]
  10 ?        S<    0:00 [kthread]
  20 ?        S<    0:00 [kacpid]
  105 ?        S<    0:04 [kblockd/0]
  151 ?        S<    0:00 [aio/0]
  150 ?        S      0:31 [kswapd0]
  744 ?        S      0:00 [kseriod]
  980 ?        S<    0:00 [ata/0]
 1093 ?        S<    0:00 [reiserfs/0]
 2183 ?        S<s    0:00 /sbin/udevd -d
 2769 ?        S      0:00 [khubd]
 3906 ?        S<    0:00 [hwscand]
 4659 ?        Ss    0:00 /usr/bin/dbus-daemon-1 --system
 4738 ?        Ss    0:04 /sbin/syslogd -a /var/lib/dhcp/dev/log -a /var/lib/named/dev/log -a /var/lib/ntp/dev/log
 4741 ?        Ss    0:00 /sbin/klogd -c 1 -2 -x
 5304 ?        S      0:00 /bin/sh /usr/bin/mysqld_safe --user=mysql --pid-file=/var/lib/mysql/mysqld.pid --socket=/var/lib/mysql/mysql.sock --datadir=/var/lib/mysql
 5419 ?        Sl    8:33 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/mysqld.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
 5445 ?        Ss    0:00 /usr/lib/openldap/slapd -h ldap:/// -u ldap -g ldap -o slp=on
 5488 ?        S      0:00 /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
 5550 ?        Ss    0:00 /sbin/resmgrd
 5638 ?        Ss    0:00 /sbin/portmap
 5715 ?        Ss    0:00 /usr/sbin/sshd -o PidFile=/var/run/sshd.init.pid
 5726 ?        Ss    0:36 /usr/sbin/nmbd -D -s /etc/samba/smb.conf
 5727 ?        Ss    0:00 /usr/sbin/acpid -c /etc/acpi/events.ignore
 5730 ?        Ssl    0:00 /usr/sbin/named -t /var/lib/named -u named
 5761 ?        Ss    0:00 /usr/sbin/mdnsd -f /etc/rendezvous.conf -b
 5773 ?        Ss    0:00 /usr/sbin/cupsd
 5784 ?        S      0:00 postgres: writer process                               
 5785 ?        S      0:00 postgres: stats buffer process                         
 5786 ?        S      0:00 postgres: stats collector process                     
 5861 ?        Ss    0:00 /opt/kde3/bin/kdm
 5871 ?        S      0:00 /usr/X11R6/bin/X -br -nolisten tcp :0 vt7 -auth /var/lib/xdm/authdir/authfiles/A:0-K3iSMA
 5878 ?        S      0:00 -:0             
 5883 ?        S      0:00 /usr/sbin/powersaved -d -x /usr/lib/powersave/scripts -a resmgr -v 3
 5884 ?        Ss    0:00 /usr/sbin/xinetd
 5892 ?        Ss    0:00 /usr/sbin/smbd -D -s /etc/samba/smb.conf
 5904 ?        S      0:00 /usr/sbin/smbd -D -s /etc/samba/smb.conf
 5912 ?        Ss    0:00 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
 5929 ?        SLs    0:00 /usr/sbin/ntpd -p /var/lib/ntp/var/run/ntp/ntpd.pid -u ntp -i /var/lib/ntp
 5969 ?        S      0:02 /opt/kde3/bin/kdm_greet
 6039 ?        Ssl    0:00 /usr/sbin/nscd
 6093 ?        Ss    0:00 /usr/lib/postfix/master
 6115 ?        S      0:00 qmgr -l -t fifo -u
 6116 ?        Ss    0:00 /usr/sbin/cron
 6126 ?        Ss    0:01 /usr/sbin/hald --daemon=yes
 6158 tty1    Ss+    0:00 /sbin/mingetty --noclear tty1
 6159 tty2    Ss+    0:00 /sbin/mingetty tty2
 6160 tty3    Ss+    0:00 /sbin/mingetty tty3
 6161 tty4    Ss+    0:00 /sbin/mingetty tty4
 6162 tty5    Ss+    0:00 /sbin/mingetty tty5
 6163 tty6    Ss+    0:00 /sbin/mingetty tty6
 6328 ?        S      0:00 /usr/sbin/smbd -D -s /etc/samba/smb.conf
 6488 ?        S      0:00 /usr/sbin/smbd -D -s /etc/samba/smb.conf
10722 ?        S      0:00 /usr/sbin/smbd -D -s /etc/samba/smb.conf
12176 ?        Ss    0:00 sshd: root@pts/0                                 
12179 pts/0    Ss+    0:00 -bash
12213 ?        Ss    0:00 sshd: root@pts/1                                 
12216 pts/1    Rs    0:00 -bash
12446 ?        S      0:00 [pdflush]
12498 ?        S      0:00 [pdflush]
13018 ?        S      0:00 pickup -l -t fifo -u
13051 ?        S      0:00 trivial-rewrite -n rewrite -t unix -u
13124 ?        Ss    0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
13125 ?        R      0:07 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
13126 ?        S      0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
13127 ?        S      0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
13128 ?        S      0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
13129 ?        S      0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
13133 ?        S      0:07 postgres: atuser attest 127.0.0.1(56450) idle         
13134 ?        S      0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
13136 pts/1    R+    0:00 ps ax

I will look into Xdebug, thank you for the suggestion. And finally, the error was a PHP memory issue; I have seen the php.ini fix for it mentioned online and will be making it. I simply was concerned when my first action seemed to spark a great number of httpd.conf entries when I only knew of one thing (my page) that should have been hitting this box.

chrism01 09-24-2009 06:08 PM

That would be normal; Apache starts as root in order to bind to restricted port 80 (& 443 if reqd), then drops privs and pre-spawns a num of child procs that actually respond to incoming queries.
The conf settings are at http://httpd.apache.org/docs/2.2/mod...reference.html, search for the word 'child'. There are a few relevant ones. You'll see them in your httpd.conf.


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