Apache is sucking up my memory

allower

Verified User
Joined
Mar 27, 2008
Messages
29
Apache is sucking up my memory. Is there any simple way to lower the memory usage? At the moment i run a Wordpress blogg with some pictures. One simple webpage with just index.html and squirrelmail. That is what apache as to do.

I'm quite now to this but I think the processes should quit after a while?

I'm on a Debian VPS server 256RAM burst 512.
DirectAdmin.

Please help me if u can.

server:/home/user# httpd -v
Server version: Apache/2.2.14 (Unix)
Server built: Jan 29 2010 21:07:54
server:/home/user#

/Christian.


root 28456 0.0 1.9 22916 10224 ? Ss 00:11 0:00 /usr/sbin/httpd -k start -DSSL
apache 28607 0.0 4.0 36032 21132 ? S 00:11 0:01 /usr/sbin/httpd -k start -DSSL
apache 28609 0.0 4.6 39240 24396 ? S 00:11 0:00 /usr/sbin/httpd -k start -DSSL
apache 28610 0.0 2.0 25900 10684 ? S 00:11 0:00 /usr/sbin/httpd -k start -DSSL
apache 28611 0.0 3.6 34320 19392 ? S 00:11 0:00 /usr/sbin/httpd -k start -DSSL
apache 28612 0.0 4.6 38964 24256 ? S 00:11 0:00 /usr/sbin/httpd -k start -DSSL
apache 29977 0.0 4.6 39264 24460 ? S 00:11 0:00 /usr/sbin/httpd -k start -DSSL
apache 32571 0.0 4.0 36036 21112 ? S 00:11 0:00 /usr/sbin/httpd -k start -DSSL
apache 7911 0.0 3.7 34824 19864 ? S 00:42 0:00 /usr/sbin/httpd -k start -DSSL
apache 8019 0.0 4.2 37628 22508 ? S 00:42 0:00 /usr/sbin/httpd -k start -DSSL
apache 8020 0.0 4.4 38564 23476 ? S 00:42 0:00 /usr/sbin/httpd -k start -DSSL
 
Look at apache extended-status and you can see how many requests are currently going on. If it is spawning that many children then there is a reason for it.
 
I'm quite new to this, how do I see apache extended-status?

I tryed to add this code to /etc/httpd/conf/httpd.conf and restart httpd but got an error when i restarted httpd.

Code:
<Location /server-status>
SetHandler server-status

Order Deny,Allow
Deny from all
Allow from .foo.com
</Location>

Why isen't the processes quitting after a while? Or aren't they supposed to do that?

Free Memory 172968 kB
And after restart Apache.
Free Memory 360372 kB

As I wrote, I only got one wordpress blogg, one simple page with just index.html and Squirrelmail.

Something has to be wrong here?
 
Last edited:
Apache's configuration file has a setting for how many processes to start and keep alive.

Jeff
 
There's no way to tell from just a post. Wordpress can definitely use a lot of resources.

Jeff
 
I tryed to add this code to /etc/httpd/conf/httpd.conf and restart httpd but got an error when i restarted httpd...
You need to edit the file below
nano -w /etc/httpd/conf/extra/httpd-info.conf
Then just make something like this

<Location /server-status>
SetHandler server-status
Order deny,allow
Allow from all
</Location>

ExtendedStatus On
Now save the file and restart HTTPd.
Go to http://your-domain/server-status or http://serverIP/server-status
 
Enabled server-status

Okey, I have enabled server-status now. What should I look after? Shall I copy/paste anything for you?
 
When this information was saved I logged in to my wordpress blog. Apache was at this time using 172Mb RAM. Is there anything I can change to lower the memory usage?

Code:
Apache Server Status for www.myhost.com
Server Version: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8g DAV/2 PHP/5.2.12
Server Built: Jan 29 2010 21:07:54

Current Time: Tuesday, 09-Feb-2010 19:31:57 CET
Restart Time: Tuesday, 09-Feb-2010 19:21:55 CET
Parent Server Generation: 0
Server uptime: 10 minutes 2 seconds
Total accesses: 362 - Total Traffic: 422 kB
CPU Usage: u5.79 s.37 cu0 cs0 - 1.02% CPU load
.601 requests/sec - 717 B/second - 1193 B/request
3 requests currently being processed, 8 idle workers

W__W_W__..___...................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
..

Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process

Srv	PID	Acc	M	CPU 	SS	Req	Conn	Child	Slot	Client	VHost	Request
0-0	17646	3/3/34	W 	0.00	51	0	3.9	0.00	0.04 	81.230.117.153	www.myhost.com	GET /wp-admin/index.php?page=stats&noheader&dashboard&width=161
1-0	1373	0/4/26	_ 	0.77	22	0	0.0	0.03	0.03 	81.230.117.153	www.myhost.com	GET /server-status HTTP/1.1
2-0	3089	0/38/38	_ 	0.02	50	9	0.0	0.01	0.01 	81.230.117.153	www.myhost.com	GET /wp-admin/images/button-grad-vs.png HTTP/1.1
3-0	3091	0/33/33	W 	1.28	0	0	0.0	0.04	0.04 	81.230.117.153	www.myhost.com	GET /server-status HTTP/1.1
4-0	3092	0/27/27	_ 	0.47	50	270	0.0	0.06	0.06 	81.230.117.153	www.myhost.com	GET /wp-admin/load-scripts.php?c=1&load=hoverIntent,common,jque
5-0	3595	0/27/28	W 	0.47	49	0	0.0	0.05	0.05 	81.230.117.153	www.myhost.com	GET /wp-admin/index.php?page=stats HTTP/1.1
6-0	25798	0/37/37	_ 	0.13	0	0	0.0	0.02	0.02 	81.230.117.153	www.myhost.com	GET /server-status HTTP/1.1
7-0	7904	0/17/17	_ 	0.46	48	2064	0.0	0.00	0.00 	81.230.117.153	www.myhost.com	GET /wp-admin/index-extra.php?jax=dashboard_plugins HTTP/1.1
9-0	-	0/0/16	. 	0.01	453	0	0.0	0.00	0.00 	81.230.117.153	www.myhost.com	GET /wp-content/themes/itheme-1-1/images/sidep-handle.png HTTP/
10-0	25998	0/38/38	_ 	0.99	50	87	0.0	0.08	0.08 	81.230.117.153	www.myhost.com	GET /wp-admin/images/icons32-vs.png HTTP/1.1
11-0	25999	0/29/29	_ 	0.07	50	98	0.0	0.02	0.02 	81.230.117.153	www.myhost.com	GET /wp-admin/images/menu-vs.png HTTP/1.1
12-0	26000	0/39/39	_ 	1.49	49	1711	0.0	0.06	0.06 	81.230.117.153	www.myhost.com	GET /wp-admin/index-extra.php?jax=dashboard_secondary HTTP/1.1
Srv	Child Server number - generation
PID	OS process ID
Acc	Number of accesses this connection / this child / this slot
M	Mode of operation
CPU	CPU usage, number of seconds
SS	Seconds since beginning of most recent request
Req	Milliseconds required to process most recent request
Conn	Kilobytes transferred this connection
Child	Megabytes transferred this child
Slot	Total megabytes transferred this slot
SSL/TLS Session Cache Status:
cache type: SHMCB, shared memory: 512000 bytes, current sessions: 0
subcaches: 32, indexes per subcache: 133
index usage: 0%, cache usage: 0%
total sessions stored since starting: 0
total sessions expired since starting: 0
total (pre-expiry) sessions scrolled out of the cache: 0
total retrieves since starting: 0 hit, 0 miss
total removes since starting: 0 hit, 0 miss
Apache/2 Server at www.myhost.com Port 80
 
Back
Top