Too Many instances of Apache?
Hello, I have been looking at our web server lately and it seems that there are a lot of instances of apache running. From what I have learned there should only be 8 instances of Apache running. 1 for daemon to su in as root and bind to 80 and 7 child processes to serve pages etc. Might be wrong but I think that is what I have read. Anyways looking at the process list of our web server I see the following processes. Does this indicate that Apache is defunct?
[root@localhost /]# ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 2006 ? 00:00:06 init [5] root 2 1 0 2006 ? 00:00:40 [migration/0] root 3 1 0 2006 ? 00:00:00 [ksoftirqd/0] root 4 1 0 2006 ? 00:00:02 [migration/1] root 5 1 0 2006 ? 00:00:00 [ksoftirqd/1] root 6 1 0 2006 ? 00:00:06 [migration/2] root 7 1 0 2006 ? 00:00:00 [ksoftirqd/2] root 8 1 0 2006 ? 00:00:01 [migration/3] root 9 1 0 2006 ? 00:00:00 [ksoftirqd/3] root 10 1 0 2006 ? 00:00:00 [events/0] root 11 1 0 2006 ? 00:00:00 [events/1] root 12 1 0 2006 ? 00:00:00 [events/2] root 13 1 0 2006 ? 00:00:00 [events/3] root 14 10 0 2006 ? 00:00:00 [khelper] root 15 10 0 2006 ? 00:00:00 [kacpid] root 45 10 0 2006 ? 00:00:00 [kblockd/0] root 46 10 0 2006 ? 00:00:00 [kblockd/1] root 47 10 0 2006 ? 00:00:00 [kblockd/2] root 48 10 0 2006 ? 00:00:00 [kblockd/3] root 49 1 0 2006 ? 00:00:00 [khubd] root 79 10 0 2006 ? 00:00:00 [aio/0] root 78 1 0 2006 ? 00:04:59 [kswapd0] root 80 10 0 2006 ? 00:00:00 [aio/1] root 81 10 0 2006 ? 00:00:00 [aio/2] root 82 10 0 2006 ? 00:00:00 [aio/3] root 226 1 0 2006 ? 00:00:00 [kseriod] root 368 1 0 2006 ? 00:00:56 [kjournald] root 1364 1 0 2006 ? 00:00:00 udevd root 1806 11 0 2006 ? 00:00:00 [kauditd] root 1923 10 0 2006 ? 00:00:00 [kmirrord] root 1944 1 0 2006 ? 00:00:00 [kjournald] root 1945 1 0 2006 ? 00:07:58 [kjournald] root 1946 1 0 2006 ? 00:00:27 [kjournald] root 1947 1 0 2006 ? 00:06:01 [kjournald] root 2606 1 0 2006 ? 00:00:29 syslogd -m 0 root 2610 1 0 2006 ? 00:00:00 klogd -x root 2620 1 0 2006 ? 00:00:07 irqbalance root 2651 1 0 2006 ? 00:00:00 /usr/sbin/acpid root 2707 1 0 2006 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd.pid root 2728 1 0 2006 ? 00:00:00 /bin/sh /usr/bin/safe_mysqld --defaults-file=/etc/my.cnf mysql 2754 2728 0 2006 ? 00:00:00 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/ root 2795 1 0 2006 ? 00:00:01 crond xfs 2841 1 0 2006 ? 00:00:00 xfs -droppriv -daemon root 2858 1 0 2006 ? 00:00:00 /usr/sbin/atd dbus 2875 1 0 2006 ? 00:00:00 dbus-daemon-1 --system root 2885 1 0 2006 ? 00:00:00 rhnsd --interval 240 root 26248 12 0 2006 ? 00:00:57 [pdflush] root 26469 2795 0 Jan15 ? 00:00:00 crond root 26470 26469 0 Jan15 ? 00:00:00 [sh] <defunct> root 26474 1 0 Jan15 ? 00:00:18 vmstat 3 root 21264 1 0 Feb21 ? 00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf root 21927 12 0 Feb21 ? 00:00:28 [pdflush] root 12443 1 0 Feb27 ? 00:02:06 /usr/sbin/httpd root 19828 1 0 Mar07 ? 00:00:00 /usr/local/ssh/sbin/sshd root 23212 1 0 Mar19 ? 00:00:11 sendmail: accepting connections smmsp 23220 1 0 Mar19 ? 00:00:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue root 19048 12443 0 Apr17 ? 00:00:07 /usr/sbin/rotatelogs /home/sites/home/logs/access_log 86400 -300 root 19124 1 0 Apr17 tty1 00:00:00 /sbin/mingetty tty1 root 19259 1 0 Apr17 tty2 00:00:00 /sbin/mingetty tty2 root 19389 1 0 Apr17 tty4 00:00:00 /sbin/mingetty tty4 root 19398 1 0 Apr17 tty6 00:00:00 /sbin/mingetty tty6 root 19466 1 0 Apr17 tty3 00:00:00 /sbin/mingetty tty3 root 19490 1 0 Apr17 tty5 00:00:00 /sbin/mingetty tty5 apache 31431 12443 0 09:05 ? 00:00:12 /usr/sbin/httpd apache 31460 12443 0 09:06 ? 00:00:06 /usr/sbin/httpd apache 31502 12443 0 09:10 ? 00:00:06 /usr/sbin/httpd apache 31530 12443 0 09:15 ? 00:00:08 /usr/sbin/httpd apache 31567 12443 0 09:24 ? 00:00:03 /usr/sbin/httpd apache 31576 12443 0 09:24 ? 00:00:07 /usr/sbin/httpd apache 31628 12443 0 09:28 ? 00:00:03 /usr/sbin/httpd apache 31639 12443 0 09:28 ? 00:00:07 /usr/sbin/httpd apache 31642 12443 0 09:28 ? 00:00:05 /usr/sbin/httpd apache 31655 12443 0 09:29 ? 00:00:05 /usr/sbin/httpd apache 31669 12443 0 09:30 ? 00:00:05 /usr/sbin/httpd apache 31707 12443 0 09:38 ? 00:00:03 /usr/sbin/httpd apache 31708 12443 0 09:38 ? 00:00:02 /usr/sbin/httpd apache 31719 12443 0 09:39 ? 00:00:01 /usr/sbin/httpd apache 31728 12443 0 09:40 ? 00:00:04 /usr/sbin/httpd apache 31730 12443 0 09:40 ? 00:00:02 /usr/sbin/httpd apache 31740 12443 0 09:40 ? 00:00:02 /usr/sbin/httpd apache 31747 12443 0 09:40 ? 00:00:04 /usr/sbin/httpd apache 31753 12443 0 09:41 ? 00:00:01 /usr/sbin/httpd apache 31757 12443 0 09:41 ? 00:00:03 /usr/sbin/httpd apache 31775 12443 0 09:42 ? 00:00:02 /usr/sbin/httpd apache 31776 12443 0 09:42 ? 00:00:02 /usr/sbin/httpd apache 31779 12443 0 09:42 ? 00:00:02 /usr/sbin/httpd apache 31780 12443 0 09:42 ? 00:00:02 /usr/sbin/httpd apache 31787 12443 0 09:42 ? 00:00:05 /usr/sbin/httpd apache 31791 12443 0 09:42 ? 00:00:03 /usr/sbin/httpd apache 31796 12443 0 09:42 ? 00:00:04 /usr/sbin/httpd apache 31799 12443 0 09:42 ? 00:00:03 /usr/sbin/httpd apache 31800 12443 0 09:42 ? 00:00:01 /usr/sbin/httpd apache 31838 12443 0 09:47 ? 00:00:03 /usr/sbin/httpd apache 31839 12443 0 09:47 ? 00:00:01 /usr/sbin/httpd apache 31853 12443 0 09:48 ? 00:00:01 /usr/sbin/httpd apache 31856 12443 0 09:48 ? 00:00:01 /usr/sbin/httpd apache 31858 12443 0 09:48 ? 00:00:01 /usr/sbin/httpd apache 31861 12443 0 09:48 ? 00:00:00 /usr/sbin/httpd apache 31863 12443 0 09:48 ? 00:00:01 /usr/sbin/httpd apache 31865 12443 0 09:48 ? 00:00:01 /usr/sbin/httpd apache 31866 12443 0 09:48 ? 00:00:00 /usr/sbin/httpd apache 31867 12443 0 09:48 ? 00:00:00 /usr/sbin/httpd apache 31899 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31900 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31901 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31902 12443 0 09:53 ? 00:00:01 /usr/sbin/httpd apache 31903 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31904 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31905 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31906 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31907 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31908 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31910 12443 0 09:53 ? 00:00:01 /usr/sbin/httpd apache 31913 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31916 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31918 12443 1 09:53 ? 00:00:02 /usr/sbin/httpd apache 31919 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31920 12443 0 09:53 ? 00:00:01 /usr/sbin/httpd apache 31921 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31922 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31923 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31924 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31925 12443 1 09:53 ? 00:00:03 /usr/sbin/httpd apache 31928 12443 0 09:53 ? 00:00:00 /usr/sbin/httpd apache 31943 12443 0 09:56 ? 00:00:00 /usr/sbin/httpd root 31945 19828 0 09:56 ? 00:00:00 sshd: root@pts/0 root 31947 31945 0 09:56 pts/0 00:00:00 -bash apache 31979 12443 0 09:56 ? 00:00:00 /usr/sbin/httpd apache 31981 12443 0 09:56 ? 00:00:00 /usr/sbin/httpd apache 31982 12443 0 09:56 ? 00:00:00 /usr/sbin/httpd apache 31983 12443 0 09:56 ? 00:00:00 /usr/sbin/httpd apache 31984 12443 0 09:56 ? 00:00:00 /usr/sbin/httpd apache 31985 12443 0 09:56 ? 00:00:00 /usr/sbin/httpd apache 31986 12443 0 09:56 ? 00:00:00 /usr/sbin/httpd apache 32000 31856 23 09:57 ? 00:00:00 /home/sites/home/web/exe/autocrypt -encrypt 128 -outmaster myfsi -change no -c root 32001 31947 0 09:57 pts/0 00:00:00 ps -ef |
What's your httpd.conf file indicate?
This might be accurate as a new child process will be started if someone is connected to your server thru apache. |
yes, please post your httpd.conf file. it looks like you've got it configured to act this way. You're right that (*by default*) apache should only have 8 processes running, but that's only true when it's idle. Even the default configuration provides for a child process to spawn for each inbound connection, up to 250.
|
ServerTokens Prod
ServerRoot "/etc/httpd" PidFile run/httpd.pid Timeout 300 KeepAlive On MaxKeepAliveRequests 10000 KeepAliveTimeout 60 <IfModule prefork.c> #StartServers 8 #StartServers 8 #MinSpareServers 5 #MaxSpareServers 20 #ServerLimit 256 #MaxClients 256 #MaxRequestsPerChild 4000 StartServers 24 MinSpareServers 15 MaxSpareServers 30 ServerLimit 512 MaxClients 512 MaxRequestsPerChild 4000 </IfModule> <IfModule worker.c> StartServers 2 MaxClients 150 MinSpareThreads 50 MaxSpareThreads 100 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule> Listen 80 LoadModule access_module modules/mod_access.so LoadModule auth_module modules/mod_auth.so LoadModule auth_anon_module modules/mod_auth_anon.so LoadModule auth_dbm_module modules/mod_auth_dbm.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule ldap_module modules/mod_ldap.so LoadModule auth_ldap_module modules/mod_auth_ldap.so LoadModule include_module modules/mod_include.so LoadModule log_config_module modules/mod_log_config.so LoadModule env_module modules/mod_env.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule expires_module modules/mod_expires.so LoadModule deflate_module modules/mod_deflate.so LoadModule headers_module modules/mod_headers.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule asis_module modules/mod_asis.so LoadModule info_module modules/mod_info.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule imap_module modules/mod_imap.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule cache_module modules/mod_cache.so LoadModule suexec_module modules/mod_suexec.so LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule file_cache_module modules/mod_file_cache.so LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule cgi_module modules/mod_cgi.so Include conf.d/*.conf User apache Group apache ServerAdmin me@somedomain.com ServerName www.somedomain.com:80 UseCanonicalName Off DocumentRoot "/home/sites/home/web" <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory "/home/sites/home/*"> Options Indexes FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> <Directory "/home/sites/*"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <IfModule mod_userdir.c> UserDir disable </IfModule> DirectoryIndex index.html index.htm index.php index.html.var AccessFileName .htaccess <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> TypesConfig /etc/mime.types DefaultType text/plain <IfModule mod_mime_magic.c> MIMEMagicFile conf/magic </IfModule> HostnameLookups Off ErrorLog logs/error_log LogLevel warn LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent CustomLog logs/access_log common ServerSignature On <Directory "/var/www/icons"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> <IfModule mod_dav_fs.c> # Location of the WebDAV lock database. DAVLockDB /var/lib/dav/lockdb </IfModule> ScriptAlias /cgi-bin/ "/var/www/html/" <Directory "/home/sites/site2/*"> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> IndexOptions FancyIndexing VersionSort NameWidth=* AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ DefaultIcon /icons/unknown.gif ReadmeName README.html HeaderName HEADER.html IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t # DefaultLanguage nl AddLanguage ca .ca AddLanguage cs .cz .cs AddLanguage da .dk AddLanguage de .de AddLanguage el .el AddLanguage en .en AddLanguage eo .eo AddLanguage es .es AddLanguage et .et AddLanguage fr .fr AddLanguage he .he AddLanguage hr .hr AddLanguage it .it AddLanguage ja .ja AddLanguage ko .ko AddLanguage ltz .ltz AddLanguage nl .nl AddLanguage nn .nn AddLanguage no .no AddLanguage pl .po AddLanguage pt .pt AddLanguage pt-BR .pt-br AddLanguage ru .ru AddLanguage sv .sv AddLanguage zh-CN .zh-cn AddLanguage zh-TW .zh-tw LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW ForceLanguagePriority Prefer Fallback #AddDefaultCharset UTF-8 AddDefaultCharset ISO-8859-1 AddCharset ISO-8859-1 .iso8859-1 .latin1 AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen AddCharset ISO-8859-3 .iso8859-3 .latin3 AddCharset ISO-8859-4 .iso8859-4 .latin4 AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk AddCharset ISO-2022-JP .iso2022-jp .jis AddCharset ISO-2022-KR .iso2022-kr .kis AddCharset ISO-2022-CN .iso2022-cn .cis AddCharset Big5 .Big5 .big5 # For russian, more than one charset is used (depends on client, mostly): AddCharset WINDOWS-1251 .cp-1251 .win-1251 AddCharset CP866 .cp866 AddCharset KOI8-r .koi8-r .koi8-ru AddCharset KOI8-ru .koi8-uk .ua AddCharset ISO-10646-UCS-2 .ucs2 AddCharset ISO-10646-UCS-4 .ucs4 AddCharset UTF-8 .utf8 AddCharset GB2312 .gb2312 .gb AddCharset utf-7 .utf7 AddCharset utf-8 .utf8 AddCharset big5 .big5 .b5 AddCharset EUC-TW .euc-tw AddCharset EUC-JP .euc-jp AddCharset EUC-KR .euc-kr AddCharset shift_jis .sjis AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddHandler cgi-script .cgi # # For files that include their own HTTP headers: # #AddHandler send-as-is asis # # For server-parsed imagemap files: # AddHandler imap-file map # # For type maps (negotiated resources): # (This is enabled by default to allow the Apache "It Worked" page # to be distributed in multiple languages.) # AddHandler type-map var # # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # AddType text/html .shtml AddOutputFilter INCLUDES .shtml # # Action lets you define media types that will execute a script whenever # a matching file is called. This eliminates the need for repeated URL # pathnames for oft-used CGI file processors. # Format: Action media/type /cgi-script/location # Format: Action handler-name /cgi-script/location # # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # # # Putting this all together, we can internationalize error responses. # # We use Alias to redirect any /error/HTTP_<error>.html.var response to # our collection of by-error message multi-language collections. We use # includes to substitute the appropriate text. # # You can modify the messages' appearance without changing any of the # default HTTP_<error>.html.var files by adding the line: # # Alias /error/include/ "/your/include/path/" # # which allows you to create your own set of files by starting with the # /var/www/error/include/ files and # copying them to /your/include/path/, even on a per-VirtualHost basis. |
Quote:
I'm not sure what all you're doing with this server, but it's definitely configured like it's a high-traffic, hard-working server (or possibly just a development server). For your average site, I'd recommend setting StartServers equal to the number of virtual hosts you have configured, and MinSpareServers equal to half that amount. For high-traffic sites, I'd double those numbers. ServerLimit is usually tuned by taking the total amount of memory you want available to apache and dividing that by the average memory utilization of an httpd process. This average utilization should be figured once apache is fully functional and ready for production. bottom line: it looks like apache is running as configured. If it looks wrong to you... you may need to adjust the apache configuration :) |
Thanks for the reply it really clears things up. This is our main webserver, I took over it before as an administrator and am very new to apache still. Thanks for clearing this up, I thought it went defunct.
|
All times are GMT -5. The time now is 01:52 AM. |