LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   apache memory usage (https://www.linuxquestions.org/questions/linux-server-73/apache-memory-usage-874303/)

qwertyjjj 04-11-2011 07:19 AM

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


jcalzare 04-12-2011 04:26 PM

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.

qwertyjjj 04-13-2011 01:10 AM

Quote:

Originally Posted by jcalzare (Post 4322594)
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?

qwertyjjj 04-16-2011 03:36 AM

any ideas?

Valery Reznic 04-16-2011 10:54 AM

Quote:

Originally Posted by qwertyjjj (Post 4326142)
any ideas?

Your php pages served by php module or as CGI?

qwertyjjj 04-17-2011 03:29 AM

PHP

Valery Reznic 04-17-2011 05:48 AM

Quote:

Originally Posted by qwertyjjj (Post 4326901)
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

qwertyjjj 04-18-2011 01:22 AM

Quote:

Originally Posted by Valery Reznic (Post 4326971)
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?

Valery Reznic 04-18-2011 01:28 AM

Quote:

Originally Posted by qwertyjjj (Post 4327634)
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


All times are GMT -5. The time now is 04:59 AM.