LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-11-2011, 07:19 AM   #1
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Rep: Reputation: 30
apache memory usage


Is it normal for apache to use up 14-15% and have so many processes running when it's not a heavily used webserver?
I only have 2 PHP pages running on the webserver and only I access these at the present time as a development access.

Code:
30528 apache    15   0 29648 7648 3904 S  0.0  0.8   0:00.02 httpd
30527 apache    15   0  173m 130m 4864 S  0.0 14.1   0:18.14 httpd
30526 apache    15   0 29656 8016 4136 S  0.0  0.8   0:00.10 httpd
27006 root      15   0     0    0    0 S  0.0  0.0   0:00.08 pdflush
27000 root      15   0     0    0    0 S  0.0  0.0   0:01.40 pdflush
23889 apache    15   0 29644 7752 3892 S  0.0  0.8   0:00.04 httpd
23887 apache    15   0 29620 7736 3904 S  0.0  0.8   0:00.04 httpd
23885 apache    18   0 29644 7936 4088 S  0.0  0.8   0:00.10 httpd
23884 apache    15   0  138m 109m 5008 S  0.0 11.8   0:13.61 httpd
23883 apache    15   0  173m 130m 4932 S  0.0 14.0   0:17.82 httpd
23882 apache    18   0 29652 8028 4140 S  0.0  0.8   0:00.06 httpd
23881 apache    15   0 29800 8008 4116 S  0.0  0.8   0:00.05 httpd
23880 apache    18   0 29776 7896 3996 S  0.0  0.8   0:00.05 httpd
23588 root      19   0  5524  904  712 S  0.0  0.1   0:00.00 ncsa_auth
23587 root      19   0  5524 1100  896 S  0.0  0.1   0:00.00 ncsa_auth
23586 root      20   0  5524  900  712 S  0.0  0.1   0:00.00 ncsa_auth
23585 root      16   0  5524 1100  892 S  0.0  0.1   0:00.01 ncsa_auth
23584 root      15   0  5524 1136  756 S  0.0  0.1   0:00.11 ncsa_auth
23399 root      15   0 88552 9192 2896 S  0.0  1.0   0:19.19 python
23238 apache    15   0  6484  544  416 S  0.0  0.1   0:00.00 httpd-matrixsa
23237 apache    15   0  6484  544  416 S  0.0  0.1   0:00.00 httpd-matrixsa
20838 nobody    16   0 11796 2744 1700 S  0.0  0.3  32:59.82 openvpn
20826 nobody    15   0 12724 5336 1656 S  0.0  0.6 175:03.15 openvpn
19467 apache    15   0 29624 7744 3920 S  0.0  0.8   0:00.00 httpd
18108 named     25   0 50868 3968 1504 S  0.0  0.4   0:06.30 named
18039 mysql     17   0  135m  13m 4528 S  0.0  1.5   0:25.78 mysqld
17989 root      25   0  4876  960  956 S  0.0  0.1   0:00.00 mysqld_safe
17854 root       7  -8 13188  824  572 S  0.0  0.1   0:00.25 audispd
17852 root      15  -4 12648  656  516 S  0.0  0.1   0:00.47 auditd
17811 root      15   0  7224  696  588 S  0.0  0.1   0:00.00 sshd
16121 root      13  -4  2264  436  432 S  0.0  0.0   0:00.01 udevd
15537 squid     18   0  1604  296  244 S  0.0  0.0   0:00.00 unlinkd
15453 squid     15   0  295m 283m 2460 S  0.0 30.6   9:14.93 squid
 9908 root      15   0 29308 8588 6000 S  0.0  0.9   0:00.56 httpd
 7238 root      15   0  2428 1072  824 R  0.3  0.1   0:00.07 top
 7211 root      15   0  5012 1468 1180 S  0.0  0.2   0:00.01 bash
 7210 root      16   0  5220 1292 1040 S  0.0  0.1   0:00.00 su
 7177 j         16   0  4880 1416 1176 S  0.0  0.1   0:00.00 bash
 7176 j         15   0 10236 1704 1128 S  0.0  0.2   0:00.00 sshd
 7174 root      15   0 10080 2860 2304 S  0.0  0.3   0:00.05 sshd
 6380 apache    15   0 29620 7652 3872 S  0.0  0.8   0:00.07 httpd
 6379 apache    17   0 29624 7788 3984 S  0.0  0.8   0:00.08 httpd
 6378 apache    20   0 29772 7952 4044 S  0.0  0.8   0:00.04 httpd
 6235 postfix   18   0  7052 1768 1420 S  0.0  0.2   0:00.00 pickup
 3941 root      15   0  8004  380  356 S  0.0  0.0   0:00.00 squid
 3555 root      15   0  5016  920  916 S  0.0  0.1   0:00.08 bash

Last edited by qwertyjjj; 04-11-2011 at 09:02 AM.
 
Old 04-12-2011, 04:26 PM   #2
jcalzare
Member
 
Registered: Aug 2009
Location: Chicago
Distribution: CentOS
Posts: 114

Rep: Reputation: 34
Apache will spawn as many processes as you have configured it to use, whether or not they are being used doesn't matter. As far as the memory usage: that is more likely due to php than the apache processes themselves.
 
Old 04-13-2011, 01:10 AM   #3
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jcalzare View Post
Apache will spawn as many processes as you have configured it to use, whether or not they are being used doesn't matter. As far as the memory usage: that is more likely due to php than the apache processes themselves.
even when php pages are not being downloaded by anyone on the server?
 
Old 04-16-2011, 03:36 AM   #4
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
any ideas?
 
Old 04-16-2011, 10:54 AM   #5
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by qwertyjjj View Post
any ideas?
Your php pages served by php module or as CGI?
 
Old 04-17-2011, 03:29 AM   #6
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
PHP
 
Old 04-17-2011, 05:48 AM   #7
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by qwertyjjj View Post
PHP
So once page was downloaded one of apache processes take the memory and not gave it back - because malloc take memory from the system but free never return it - at least in the most of implementations
 
Old 04-18-2011, 01:22 AM   #8
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Valery Reznic View Post
So once page was downloaded one of apache processes take the memory and not gave it back - because malloc take memory from the system but free never return it - at least in the most of implementations
So, it's normal?
 
Old 04-18-2011, 01:28 AM   #9
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by qwertyjjj View Post
So, it's normal?
I think so.
You can try to restart apache and watch it's memory.

After you make one download, memory usage of one of the processes should increase and stay on this level,
even after download is finished and there is no other activity
 
  


Reply



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
How to find total apache memory usage? j0hnsmith Linux - Server 7 09-13-2010 02:49 AM
Apache crashing VPS - need to reduce memory usage rhodri Linux - Server 2 02-15-2010 03:00 AM
memory usage (apache related?) stonecrest Linux - General 3 08-10-2005 05:52 AM
Apache, PHP, Mysql memory usage MikeyCarter Linux - Software 0 09-24-2003 12:37 PM
Limiting the total amount of memory usage by apache. SplashHost.com Linux - General 8 08-30-2002 09:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:31 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