You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Peter N Lewis <pe...@stairways.com.au> on 2009/11/20 06:36:53 UTC

[users@httpd] Memory / Process leak

I am having a serious problem with my site running out of memory.  apache is leaking memory/processes.

I have half a dozen virtual hosts, but relatively light traffic, around 40,000 accesses per day (that includes all files on all hosts), so on the order of 1 access per second average.

Currently my 512MB slicehost slice (1GB swap) starts off at about 100MB used, and then grows over a few days to fill RAM and start using swap, at which point I restart apache and the process repeats.

However I have a release coming up, and that will increase the traffic substantially for a short period of time, and its imperative that the site doesn't go down.

Most of my pages are plain pages, but some of them are mod_perl perl pages.

I disabled most modules, remaining are only:  authz_host   dir   headers   mime   negotiation   rewrite   status   env   perl

More server stats are below if they are useful.

The problem appears to be that the worker processes get caught in a read and never finish and never die.

root     19962  0.0  8.3 193708 43948 ?        Ss   Nov19   0:21 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 21837  0.1 13.6 527656 71404 ?        Sl   03:12   0:08 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 21995  0.0 13.9 904004 73204 ?        Sl   04:49   0:01 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 22023  0.0 14.0 773972 73880 ?        Sl   04:50   0:01 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 22046  0.0 14.1 831076 74160 ?        Sl   04:50   0:01 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 22079  0.0 13.5 837788 71104 ?        Sl   04:50   0:00 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start

If I can't find an answer, I'm going to have to do something desperate, like switch to nginx, which entails rewriting all my mod_perl pages at fastcgi pages, which will take a lot of effort.

What am I missing?

Lots of server stats follow.

Thanks,
   Peter.


Apache Server Status for www.stairways.com

Server Version: Apache/2.2.9 (Debian) mod_perl/2.0.4 Perl/v5.10.0
Server Built: Jul 14 2009 20:40:18
Current Time: Friday, 20-Nov-2009 05:25:34 UTC
Restart Time: Thursday, 19-Nov-2009 02:39:50 UTC
Parent Server Generation: 0
Server uptime: 1 day 2 hours 45 minutes 44 seconds
Total accesses: 39589 - Total Traffic: 1.3 GB
CPU Usage: u11.96 s1.79 cu0 cs0 - .0143% CPU load
.411 requests/sec - 13.7 kB/second - 33.4 kB/request
42 requests currently being processed, 58 idle workers
RR_R_________R___R_RR_R_R.......................................
................................................................
__W_________R_RRRR_RRRRRR.......................................
______RRR___RR_RR_______R.......................................
__RR_R_RRRRR_R__R__RR_R__.......................................
.......R..RRR..RR.RRRRRRR.......................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
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	21837	0/40/684	R	4.39	2120	32	0.0	0.45	16.35	?	?	..reading..
0-0	21837	0/39/812	R	4.38	2120	4	0.0	0.43	18.44	?	?	..reading..
0-0	21837	0/43/864	_	5.08	0	12	0.0	2.35	33.86	x.x.x.x	www.keyboardmaestro.com	GET /action/sivc?A&R&03508000&5A08FFAC&Ye8A4gdY&00000000&000010
0-0	21837	0/37/715	R	4.39	2120	32	0.0	3.97	22.63	?	?	..reading..
0-0	21837	0/36/541	_	5.07	131	0	0.0	0.29	25.28	x.x.x.x	www.keyboardmaestro.com	GET /img/title-bg.jpg HTTP/1.1
0-0	21837	0/47/592	_	5.06	383	12	0.0	0.71	11.08	x.x.x.x	www.peter.com.au	GET /articles/tshirts.html HTTP/1.1
0-0	21837	0/37/598	_	5.06	240	8	0.0	1.18	14.41	x.x.x.x	www.stairways.com	GET /main/index HTTP/1.1
0-0	21837	0/55/517	_	5.06	164	0	0.0	1.38	16.09	x.x.x.x	slice.peter.com.au	GET / HTTP/1.1
0-0	21837	0/47/573	_	5.06	358	12	0.0	1.48	22.09	x.x.x.x	www.peter.com.au	GET /articles/3rd-birthday-party.html HTTP/1.1
0-0	21837	0/47/686	_	5.07	69	0	0.0	0.83	19.77	x.x.x.x	www.peter.com.au	GET /styles/downtown.css HTTP/1.1
0-0	21837	0/51/626	_	5.07	131	0	0.0	3.24	14.27	x.x.x.x	www.keyboardmaestro.com	GET /img/box-bg.png HTTP/1.1
0-0	21837	0/48/492	_	5.06	209	0	0.0	1.53	12.46	x.x.x.x	www.stairways.com	GET /main/index HTTP/1.1
0-0	21837	0/40/545	_	5.07	119	8	0.0	1.03	15.68	x.x.x.x	www.stairways.com	GET /blog/rss.xml HTTP/1.1
0-0	21837	0/38/463	R	4.38	2120	0	0.0	0.58	12.61	?	?	..reading..
0-0	21837	0/59/531	_	5.07	38	0	0.0	2.55	24.37	x.x.x.x	www.stairways.com	GET /favicon.ico HTTP/1.0
0-0	21837	0/41/748	_	5.06	371	0	0.0	1.20	13.39	x.x.x.x	www.peter.com.au	GET /articles/nanny.html HTTP/1.1
0-0	21837	0/39/528	_	5.06	172	0	0.0	0.82	18.76	x.x.x.x	slice.peter.com.au	GET / HTTP/1.1
0-0	21837	0/37/621	R	4.38	2120	4	0.0	0.59	14.62	?	?	..reading..
0-0	21837	0/68/684	_	5.06	141	12	0.0	0.27	14.87	x.x.x.x	www.sungroper.asn.au	GET /gallery/thumbs/2001-05-20-First-Car-Motion_01-Tension-Chan
0-0	21837	0/32/579	R	4.39	2120	32	0.0	0.80	23.05	?	?	..reading..
0-0	21837	0/44/886	R	4.39	2119	0	0.0	0.37	14.49	?	?	..reading..
0-0	21837	0/44/630	_	5.06	219	32	0.0	1.07	39.68	x.x.x.x	www.williamdawes.com	GET /index.html HTTP/1.1
0-0	21837	0/36/654	R	4.39	2120	36	0.0	0.40	14.39	?	?	..reading..
0-0	21837	0/46/638	_	5.06	341	0	0.0	0.65	16.00	x.x.x.x	www.peter.com.au	GET /articles/pantograph.html HTTP/1.1
0-0	21837	0/41/697	R	4.39	2120	36	0.0	1.23	14.10	?	?	..reading..
1-0	-	0/0/490	.	4.38	2110	0	0.0	0.00	13.16	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_35-WSC-Trophy-presenta
1-0	-	0/0/385	.	4.33	2110	0	0.0	0.00	14.40	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-22-Race-Day-5_37-Loading-Trailer.jpg
1-0	-	0/0/444	.	4.59	2110	4	0.0	0.00	28.01	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-23-Race-Day-6_05-Sungroper-passing.j
1-0	-	0/0/439	.	4.59	2110	0	0.0	0.00	9.25	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_33-National-Wine-Centr
1-0	-	0/0/355	.	4.46	2110	16	0.0	0.00	41.68	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-25-Race-Day-8_14-Living-Room.jpg HTT
1-0	-	0/0/352	.	4.26	2110	4	0.0	0.00	9.74	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-22-Race-Day-5_28-South-of-Alice.jpg
1-0	-	0/0/481	.	4.38	2110	4	0.0	0.00	18.87	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_44-Pub-Crowd.jpg HTTP/
1-0	-	0/0/392	.	4.44	2110	0	0.0	0.00	15.70	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-24-Race-Day-7_52-Hotel-and-Renovatio
1-0	-	0/0/450	.	4.54	2110	4	0.0	0.00	10.83	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-26-Race-Day-9_08-Fiona-with-grin.jpg
1-0	-	0/0/474	.	4.44	2110	4	0.0	0.00	18.92	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-24-Race-Day-7_57-Cooberpedy.jpg HTTP
1-0	-	0/0/465	.	4.38	2110	0	0.0	0.00	14.43	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-22-Race-Day-5_26-In-Control-Stop.jpg
1-0	-	0/0/443	.	4.29	2110	28	0.0	0.00	39.75	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-22-Race-Day-5_36-Night-movement-of-S
1-0	-	0/0/367	.	4.39	2110	0	0.0	0.00	8.03	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-23-Race-Day-6_07-Border-Signage.jpg
1-0	-	0/0/333	.	4.38	2110	0	0.0	0.00	22.76	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-23-Race-Day-6_16-New-WSC-sponsor.jpg
1-0	-	0/0/481	.	4.59	2110	4	0.0	0.00	20.59	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-23-Race-Day-6_06-Care-Package-dropof
1-0	-	0/0/484	.	4.59	2110	0	0.0	0.00	12.06	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-24-Race-Day-7_49-smashed-spaceship.j
1-0	-	0/0/517	.	4.29	2110	32	0.0	0.00	11.96	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-22-Race-Day-5_35-Sungroper-and-Road-
1-0	-	0/0/499	.	4.26	2110	0	0.0	0.00	22.14	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-22-Race-Day-5_29-End-of-day-Charge.j
1-0	-	0/0/508	.	4.38	2110	0	0.0	0.00	12.90	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-23-Race-Day-6_15-Skip-under-geocache
1-0	-	0/0/581	.	4.59	2110	0	0.0	0.00	18.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-25-Race-Day-8_07-Afternoon-Charge.jp
1-0	-	0/0/597	.	4.29	2110	24	0.0	0.00	24.12	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-22-Race-Day-5_38-Sungroper-in-Traile
1-0	-	0/0/482	.	4.58	2110	0	0.0	0.00	10.63	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-24-Race-Day-7_50-Space-thingy.jpg HT
1-0	-	0/0/556	.	4.53	2110	0	0.0	0.00	17.22	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-26-Race-Day-9_09-Scrutineering.jpg H
1-0	-	0/0/545	.	4.59	2110	0	0.0	0.00	9.29	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-25-Race-Day-8_12-Bush-Camp-Caravan.j
1-0	-	0/0/379	.	4.59	2110	4	0.0	0.00	12.16	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_28-Bill-and-James-show
2-0	21995	0/12/494	_	0.79	42	0	0.0	0.49	16.39	x.x.x.x	www.keyboardmaestro.com	GET /img/title-bg.jpg HTTP/1.1
2-0	21995	0/8/503	_	0.71	130	0	0.0	0.03	10.83	x.x.x.x	www.stairways.com	GET /main/index HTTP/1.1
2-0	21995	0/8/435	W	0.71	0	0	0.0	0.02	12.95	x.x.x.x	www.stairways.com	GET /server-status HTTP/1.1
2-0	21995	0/17/391	_	0.80	34	0	0.0	0.87	22.02	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/setup-textedit-recording-example.png HTTP/1.1
2-0	21995	0/21/550	_	0.80	34	0	0.0	0.07	8.29	x.x.x.x	www.keyboardmaestro.com	GET /img/box-bg.png HTTP/1.1
2-0	21995	0/12/330	_	0.71	132	0	0.0	0.13	39.21	x.x.x.x	www.peter.com.au	GET /favicon.ico HTTP/1.1
2-0	21995	0/10/472	_	0.71	166	12	0.0	0.06	7.57	x.x.x.x	www.keyboardmaestro.com	GET /action/sivc?A&R&02138000&C46DF21D&PUap3PJv&00000000&000010
2-0	21995	0/10/572	_	0.71	131	604	0.0	0.13	18.40	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/save-to-clippings-tutorial.png HTTP/1.1
2-0	21995	0/10/293	_	0.71	138	0	0.0	0.11	17.67	x.x.x.x	www.stairways.com	GET /programming/ HTTP/1.1
2-0	21995	0/12/694	_	0.84	38	196	0.0	0.09	10.16	x.x.x.x	www.stairways.com	GET /blog/2007-11-03-leopard-dock HTTP/1.0
2-0	21995	0/12/685	_	0.71	219	0	0.0	0.09	16.44	x.x.x.x	www.williamdawes.com	GET / HTTP/1.1
2-0	21995	0/8/449	_	0.71	179	4	0.0	0.12	16.65	x.x.x.x	www.stairways.com	GET /server-status HTTP/1.1
2-0	21995	0/0/802	R	1.92	2134	20	0.0	0.00	15.43	?	?	..reading..
2-0	21995	0/8/500	_	0.79	84	1528	0.0	0.09	15.62	x.x.x.x	www.stairways.com	GET /blog/rss.xml?full HTTP/1.1
2-0	21995	0/0/332	R	1.95	2134	16	0.0	0.00	12.70	?	?	..reading..
2-0	21995	0/0/678	R	1.95	2134	12	0.0	0.00	13.89	?	?	..reading..
2-0	21995	0/0/300	R	1.96	2134	12	0.0	0.00	4.86	?	?	..reading..
2-0	21995	0/0/466	R	1.97	2134	12	0.0	0.00	10.76	?	?	..reading..
2-0	21995	0/13/547	_	0.80	34	0	0.0	0.06	12.04	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/record-quick-macro-example.png HTTP/1.1
2-0	21995	0/0/343	R	2.01	2134	16	0.0	0.00	16.30	?	?	..reading..
2-0	21995	0/0/356	R	2.02	2134	12	0.0	0.00	13.36	?	?	..reading..
2-0	21995	0/0/469	R	2.02	2134	12	0.0	0.00	21.06	?	?	..reading..
2-0	21995	0/0/474	R	2.05	2134	60	0.0	0.00	11.78	?	?	..reading..
2-0	21995	0/0/355	R	2.07	2134	16	0.0	0.00	10.56	?	?	..reading..
2-0	21995	0/0/426	R	2.08	2134	16	0.0	0.00	25.40	?	?	..reading..
3-0	22023	0/13/13	_	0.80	34	0	0.0	0.06	0.06	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/save-to-clippings-tutorial.png HTTP/1.1
3-0	22023	0/12/12	_	0.80	34	0	0.0	0.07	0.07	x.x.x.x	www.keyboardmaestro.com	GET /img/title-bg.jpg HTTP/1.1
3-0	22023	0/10/10	_	0.71	131	556	0.0	0.60	0.60	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/configuration.png HTTP/1.1
3-0	22023	0/5/5	_	0.70	352	24	0.0	0.08	0.08	x.x.x.x	www.peter.com.au	GET /articles/honda-accord.html HTTP/1.1
3-0	22023	0/10/10	_	0.71	130	4	0.0	0.15	0.15	x.x.x.x	www.keyboardmaestro.com	GET /favicon.ico HTTP/1.1
3-0	22023	0/6/6	_	0.79	115	208	0.0	3.79	3.79	x.x.x.x	www.stairways.com	GET /blog/rss.xml?full HTTP/1.1
3-0	22023	0/1/1	R	0.22	2126	0	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/1/1	R	0.22	2126	4	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/1/1	R	0.21	2126	0	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/4/4	_	0.70	389	0	0.0	0.05	0.05	x.x.x.x	www.peter.com.au	GET /articles/tshirts.html HTTP/1.1
3-0	22023	0/9/9	_	0.71	131	588	0.0	0.70	0.70	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/create-a-simple-macro.png HTTP/1.1
3-0	22023	0/4/4	_	0.70	365	4	0.0	0.02	0.02	x.x.x.x	www.peter.com.au	GET /articles/gingerbread-house.html HTTP/1.1
3-0	22023	0/1/1	R	0.22	2126	0	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/1/1	R	0.22	2126	0	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/7/7	_	0.80	0	12	0.0	2.88	2.88	x.x.x.x	www.peter.com.au	GET /photos/photos/2002-12-19-Amy-Monica_01-Amy-Monica.jpg HTTP
3-0	22023	0/1/1	R	0.22	2126	0	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/7/7	_	0.70	334	12	0.0	0.14	0.14	x.x.x.x	www.peter.com.au	GET /articles/housebuying.html HTTP/1.1
3-0	22023	0/5/5	_	0.71	231	0	0.0	0.05	0.05	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/whatsnew HTTP/1.1
3-0	22023	0/5/5	_	0.71	190	92	0.0	0.04	0.04	x.x.x.x	www.peter.com.au	GET /articles/pantograph-images/arms.png HTTP/1.1
3-0	22023	0/5/5	_	0.80	38	0	0.0	0.01	0.01	x.x.x.x	www.stairways.com	GET /robots.txt HTTP/1.0
3-0	22023	0/5/5	_	0.71	219	0	0.0	0.02	0.02	x.x.x.x	williamdawes.com	GET / HTTP/1.1
3-0	22023	0/4/4	_	0.71	156	0	0.0	0.08	0.08	x.x.x.x	www.peter.com.au	GET /styles/downtown.css HTTP/1.1
3-0	22023	0/4/4	_	0.71	171	0	0.0	0.00	0.00	x.x.x.x	www.stairways.com	GET /favicon.ico HTTP/1.1
3-0	22023	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/13/13	_	0.78	131	548	0.0	0.22	0.22	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/overview.png HTTP/1.1
4-0	22046	0/34/34	_	0.78	122	0	0.0	0.50	0.50	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/whatsnew HTTP/1.1
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/8/8	_	0.78	265	4	0.0	0.02	0.02	x.x.x.x	www.stairways.com	GET /action/store HTTP/1.1
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/7/7	_	0.84	35	0	0.0	0.04	0.04	x.x.x.x	www.stairways.com	GET /css/blog.css HTTP/1.0
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/9/9	_	0.78	131	0	0.0	0.63	0.63	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/record-quick-macro-example.png HTTP/1.1
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/7/7	_	0.78	150	3264	0.0	0.15	0.15	x.x.x.x	www.peter.com.au	GET /styles/perth_header.jpg HTTP/1.1
4-0	22046	0/6/6	_	0.78	138	0	0.0	0.10	0.10	x.x.x.x	www.peter.com.au	GET /articles/pantograph-images/pencil.png HTTP/1.1
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/8/8	_	0.78	211	0	0.0	0.06	0.06	x.x.x.x	www.stairways.com	GET /blog/rss-2008-05-13-microsoft-office-vba.xml HTTP/1.1
4-0	22046	0/6/6	_	0.78	219	0	0.0	0.02	0.02	x.x.x.x	www.williamdawes.com	GET /robots.txt HTTP/1.1
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/15/15	_	0.84	80	228	0.0	0.09	0.09	x.x.x.x	www.stairways.com	GET /blog/index HTTP/1.0
4-0	22046	0/0/0	R	0.00	2133	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/8/8	_	0.78	182	0	0.0	0.10	0.10	x.x.x.x	slice.peter.com.au	GET / HTTP/1.1
4-0	22046	0/9/9	_	0.84	34	0	0.0	0.19	0.19	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/configuration.png HTTP/1.1
5-0	-	0/0/2	.	0.24	2112	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_19-Lord-Mayor-and-Nuna
5-0	-	0/0/2	.	0.24	2112	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_10-Team-Flag-and-Car.j
5-0	-	0/0/2	.	0.24	2112	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_12-or-not.jpg HTTP/1.1
5-0	-	0/0/2	.	0.31	2112	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_13-King-William-St.jpg
5-0	-	0/0/2	.	0.36	2112	4	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_11-Off-on-parade.jpg H
5-0	-	0/0/2	.	0.36	2112	0	0.0	0.00	0.01	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_20-Cars-on-Display.jpg
5-0	-	0/0/1	.	0.36	2112	8	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_20-Clever-Rock.jpg HTT
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	-	0/0/2	.	0.36	2112	0	0.0	0.00	0.01	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_09-Southern-Exposure.j
5-0	-	0/0/1	.	0.36	2112	12	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_23-Devils-Marbles.jpg
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	-	0/0/1	.	0.36	2112	8	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_27-Devils-Marbles.jpg
5-0	-	0/0/1	.	0.36	2112	12	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_28-Shay-and-Fe-Rock.jp
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	-	0/0/1	.	0.36	2112	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_35-Devils-Marbles.jpg
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	2132	0	0.0	0.00	0.00	?	?	..reading..
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
Apache/2.2.9 Server at www.stairways.com Port 80
Timeout 45
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5


<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadsPerChild      25
    MaxRequestsPerChild   1000
</IfModule>


slice:/etc/apache2# /usr/sbin/apache2 -f /etc/apache2/apache2.conf -l
Compiled in modules:
  core.c
  mod_log_config.c
  mod_logio.c
  worker.c
  http_core.c
  mod_so.c

 -f /etc/apache2/apache2.conf -M
Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 mpm_worker_module (static)
 http_module (static)
 so_module (static)
 authz_host_module (shared)
 dir_module (shared)
 env_module (shared)
 headers_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 perl_module (shared)
 rewrite_module (shared)
 status_module (shared)

slice:/etc/apache2# /usr/sbin/apache2 -f /etc/apache2/apache2.conf -V
Server version: Apache/2.2.9 (Debian)
Server built:   Jul 14 2009 20:40:18
Server's Module Magic Number: 20051115:15
Server loaded:  APR 1.2.12, APR-Util 1.2.12
Compiled using: APR 1.2.12, APR-Util 1.2.12
Architecture:   64-bit
Server MPM:     Worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/worker"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=""
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"




-- 
     Clipboard Switching and Macros with Keyboard Maestro

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/>           <http://download.stairways.com/>




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Memory / Process leak

Posted by Peter N Lewis <pe...@stairways.com.au>.
On 20/11/2009, at 18:20 , André Warnier wrote:

> Peter N Lewis wrote:
>> I already have:
>>    MaxRequestsPerChild   1000
>> So the worker processes should die and clean that out.
>> I'm suspicious that the worker threads are not dieing because I've seen cases where there are worker threads listed in ps but not listed in server-status (that will probably show up tomorrow or the next day when the server has been running a bit longer, and I'll post details of that if I haven't got a response by then).
> You are talking about threads. What MPM are you using, on which platform ?
> Read http://httpd.apache.org/docs/2.2/mpm.html
> and try ./httpd -l

slice:/etc/apache2# /usr/sbin/apache2 -f /etc/apache2/apache2.conf -l
Compiled in modules:
 core.c
 mod_log_config.c
 mod_logio.c
 worker.c
 http_core.c
 mod_so.c

> All this is still a plaster over a real issue though.  The real issue is that some module is leaking memory, and you should really find out which one and go from there.  There may be an alternate module available or not, depending on the case.

My suspicion is it is more that it is leaking processes or threads that then never get tidied up.  But I certainly could be wrong.

And at this point, I'll be happy to take some plaster - my site is not going to be so heavily used that I need more than plaster.  I would like a better solution that frequent graceful restarts.

> It may also just be an application, not a Perl library module, that leaks memory.  I would consider that in fact much more likely.
> What /are/ your "mod_perl pages" and what do they do ?
> Is there any possibility to narrow down the search to some likely suspects ?
> In the order of probabilities for memory leaks, I would consider, from most to least likely culprits :
> 1) perl application modules/pages
> 2) perl standard library modules handling XML
> 3) other perl standard library modules
> 4) Apache standard modules
> 5) Apache core code

Any suggestions on how to find it?

Here is what I find interesting.  After leaving it for another day, I now have worker processes that are not listed in the server status.

root     19962  0.0  3.3 193708 17776 ?        Ss   Nov19   0:43 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 21837  0.0  3.4 531796 18088 ?        Sl   Nov20   0:07 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 21995  0.0 11.9 813848 62892 ?        Sl   Nov20   0:05 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 22023  0.0  7.5 737104 39496 ?        Sl   Nov20   0:04 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 22046  0.0  6.5 826992 34336 ?        Sl   Nov20   0:05 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 22079  0.0  3.6 837788 19304 ?        Sl   Nov20   0:00 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 22842  0.0 12.8 661912 67228 ?        Sl   Nov20   0:06 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 23370  0.0 10.6 458444 55696 ?        Sl   Nov20   0:09 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start
www-data 23613  0.1 11.2 520912 58932 ?        Sl   02:00   0:00 /usr/sbin/apache2 -f /etc/apache2/apache2.conf -k start

Processes 21837, 21995, 22842 are not listed in the server status.

Surely that is something quite wrong?  If I kill those processes, I get back a significant amount of memory:

slice:/var/log/apache2# free -m
             total       used       free     shared    buffers     cached
Mem:           512        505          6          0          3        147
-/+ buffers/cache:        354        157
Swap:         1023        256        767
slice:/var/log/apache2# kill -9 21837  21995  22842
slice:/var/log/apache2# free -m
             total       used       free     shared    buffers     cached
Mem:           512        399        112          0          3        147
-/+ buffers/cache:        249        263
Swap:         1023        188        835

Still very confused.

Thanks,
   Peter.

Server status is below.


Apache Server Status for www.stairways.com

Server Version: Apache/2.2.9 (Debian) mod_perl/2.0.4 Perl/v5.10.0
Server Built: Jul 14 2009 20:40:18
Current Time: Saturday, 21-Nov-2009 02:07:55 UTC
Restart Time: Thursday, 19-Nov-2009 02:39:50 UTC
Parent Server Generation: 0
Server uptime: 1 day 23 hours 28 minutes 5 seconds
Total accesses: 66968 - Total Traffic: 2.2 GB
CPU Usage: u17.53 s2.92 cu0 cs0 - .012% CPU load
.392 requests/sec - 13.4 kB/second - 34.2 kB/request
2 requests currently being processed, 48 idle workers
_________________________.......................................
................................................................
__WK_____________________.......................................
......RRR...RR.RR.......R.......................................
..RR.R.RRRRR.R..R..RR.R.........................................
.......R..RRR..RR.RRRRRRR.......................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
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	23613	0/6/709	_	0.25	182	1428	0.0	1.18	19.45	x.x.x.x	www.peter.com.au	GET /metalwork/al-60-g0516-sieg-c6-m2/images/circuit-2-mill-dri
0-0	23613	0/3/833	_	0.22	184	3576	0.0	0.53	19.12	x.x.x.x	www.peter.com.au	GET /metalwork/al-60-g0516-sieg-c6-m2/images/drawing-2100-milli
0-0	23613	0/3/1041	_	0.25	182	4188	0.0	0.49	41.90	x.x.x.x	www.peter.com.au	GET /metalwork/al-60-g0516-sieg-c6-m2/images/drawing-10-10-stea
0-0	23613	0/4/1007	_	0.29	176	1128	0.0	0.12	31.10	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/javascript/prototype.js HTTP/1.1
0-0	23613	0/5/980	_	0.29	177	0	0.0	0.03	35.40	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/img/close.png HTTP/1.1
0-0	23613	0/3/729	_	0.29	162	0	0.0	0.01	15.09	x.x.x.x	store.stairways.com	GET / HTTP/1.1
0-0	23613	0/3/741	_	0.29	175	4	0.0	3.50	19.69	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/img/title-bg.jpg HTTP/1.1
0-0	23613	0/2/666	_	0.32	138	32	0.0	0.03	23.50	x.x.x.x	www.keyboardmaestro.com	GET /action/sivc?A&R&02038000&C06EEE10&5Np6QVyI&00000000&000010
0-0	23613	0/2/809	_	0.32	131	0	0.0	0.10	24.75	x.x.x.x	www.peter.com.au	GET /photos/photos/2002-07-17-Nanas-90th-Birthday_03-Liz-Neil-I
0-0	23613	0/2/831	_	0.32	116	180	0.0	0.07	27.35	x.x.x.x	www.peter.com.au	GET /photos/photos/2002-09-02-3Brougham-Castle_0750.jpg HTTP/1.
0-0	23613	0/2/811	_	0.32	114	176	0.0	0.08	16.62	x.x.x.x	www.peter.com.au	GET /photos/photos/2002-09-02-3Brougham-Castle_0743.jpg HTTP/1.
0-0	23613	0/2/621	_	0.44	50	412	0.0	0.04	26.01	x.x.x.x	www.stairways.com	POST /blog/ HTTP/1.0
0-0	23613	0/2/1039	_	0.44	22	16	0.0	0.01	39.40	x.x.x.x	www.keyboardmaestro.com	GET /action/sivc?A&R&03508000&597F9798&IZhMssjI&00000000&000010
0-0	23613	0/5/933	_	0.44	1	0	0.0	0.04	26.53	x.x.x.x	www.peter.com.au	GET /articles/pantograph-images/pencil.png HTTP/1.1
0-0	23613	0/6/1292	_	0.44	1	0	0.0	0.07	48.99	x.x.x.x	www.peter.com.au	GET /articles/pantograph-images/arms.png HTTP/1.1
0-0	23613	0/2/1259	_	0.06	306	0	0.0	0.01	44.51	x.x.x.x	www.peter.com.au	GET /favicon.ico HTTP/1.1
0-0	23613	0/3/952	_	0.06	290	0	0.0	0.03	39.72	x.x.x.x	www.keyboardmaestro.com	GET /favicon.ico HTTP/1.1
0-0	23613	0/2/1015	_	0.06	291	0	0.0	0.14	26.80	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/save-to-clippings-tutorial.png HTTP/1.1
0-0	23613	0/1/1326	_	0.06	291	0	0.0	0.03	34.21	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/setup-textedit-recording-example.png HTTP/1.1
0-0	23613	0/1/791	_	0.06	279	8	0.0	0.02	36.57	x.x.x.x	www.stairways.com	GET /blog/rss.xml HTTP/1.1
0-0	23613	0/2/1248	_	0.06	269	0	0.0	0.00	22.41	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2004-01-17-Chair-Recovering-Episode-1_16-Rem
0-0	23613	0/1/1151	_	0.06	230	0	0.0	0.00	60.70	x.x.x.x	www.keyboardmaestro.com	GET /favicon.ico HTTP/1.0
0-0	23613	0/2/1067	_	0.22	192	4	0.0	0.04	31.67	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/overview.png HTTP/1.1
0-0	23613	0/2/1255	_	0.21	192	0	0.0	0.14	33.69	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/configuration.png HTTP/1.1
0-0	23613	0/3/720	_	0.22	192	0	0.0	0.03	14.41	x.x.x.x	www.keyboardmaestro.com	GET /img/mainbuttons/download-both.jpg HTTP/1.1
1-0	-	0/0/814	.	5.37	2144	4	0.0	0.00	17.80	x.x.x.x	www.stairways.com	GET /main/index HTTP/1.1
1-0	-	0/0/683	.	5.35	2144	20	0.0	0.00	29.60	x.x.x.x	www.keyboardmaestro.com	GET /action/sivc?A&R&02138000&BF75943C&BQHzyVyu&00000000&000010
1-0	-	0/0/771	.	5.34	2144	0	0.0	0.00	49.29	x.x.x.x	www.sungroper.asn.au	GET /gallery/thumbs/2001-05-27-Panel_05-Cells.jpg HTTP/1.1
1-0	-	0/0/796	.	5.34	2144	0	0.0	0.00	23.04	x.x.x.x	www.stairways.com	GET / HTTP/1.1
1-0	-	0/0/536	.	5.37	2144	12	0.0	0.00	53.79	x.x.x.x	www.keyboardmaestro.com	GET /action/sivc?A&R&03508000&578D5847&UZJ29rkg&00000000&000010
1-0	-	0/0/561	.	5.33	2144	0	0.0	0.00	14.31	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2005-02-15-Bali-Resort_03-Robert.jpg HTTP/1.
1-0	-	0/0/693	.	5.28	2144	8	0.0	0.00	26.17	x.x.x.x	www.stairways.com	GET /blog/rss.xml HTTP/1.1
1-0	-	0/0/643	.	5.35	2144	8	0.0	0.00	31.38	x.x.x.x	www.stairways.com	GET /blog/rss.xml HTTP/1.1
1-0	-	0/0/620	.	5.35	2144	0	0.0	0.00	28.16	x.x.x.x	www.sungroper.com	GET /gallery/photos/2001-03-12-Car-Stuff_04-Seat-Mold.jpg HTTP/
1-0	-	0/0/684	.	5.35	2144	1164	0.0	0.00	38.32	x.x.x.x	www.peter.com.au	GET /styles/perth_header.jpg HTTP/1.1
1-0	-	0/0/626	.	5.34	2144	16	0.0	0.00	20.57	x.x.x.x	www.sungroper.asn.au	GET /gallery/photos/2001-07-14-Shell_05-Vacuum-Bag.jpg HTTP/1.1
1-0	-	0/0/755	.	5.35	2144	0	0.0	0.00	46.44	x.x.x.x	www.keyboardmaestro.com	GET /press/2005-04-14 HTTP/1.1
1-0	-	0/0/667	.	5.35	2144	0	0.0	0.00	19.10	x.x.x.x	www.stairways.com	HEAD / HTTP/1.1
1-0	-	0/0/659	.	5.35	2144	0	0.0	0.00	45.19	x.x.x.x	www.keyboardmaestro.com	GET / HTTP/1.0
1-0	-	0/0/669	.	5.34	2144	0	0.0	0.00	30.72	x.x.x.x	slice.peter.com.au	GET /robots.txt HTTP/1.1
1-0	-	0/0/669	.	5.35	2144	0	0.0	0.00	17.84	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/screenshots HTTP/1.1
1-0	-	0/0/924	.	5.35	2144	0	0.0	0.00	20.44	x.x.x.x	www.stairways.com	GET /favicon.ico HTTP/1.1
1-0	-	0/0/794	.	5.35	2144	0	0.0	0.00	30.36	x.x.x.x	www.stairways.com	GET /img/box-bg.png HTTP/1.1
1-0	-	0/0/773	.	5.37	2144	0	0.0	0.00	22.45	x.x.x.x	www.peter.com.au	GET /photos/photos/2005-03-12-Tabithas-Birthday-Party_03-Olivia
1-0	-	0/0/859	.	5.34	2144	16	0.0	0.00	30.89	x.x.x.x	www.peter.com.au	GET /photos/photos/2002-11-29-Amy-Isabel_04-Amy.jpg HTTP/1.1
1-0	-	0/0/859	.	5.35	2144	4	0.0	0.00	30.66	x.x.x.x	www.peter.com.au	GET /williamdawes/index.html HTTP/1.0
1-0	-	0/0/800	.	5.37	2144	0	0.0	0.00	21.98	x.x.x.x	www.stairways.com	GET /action/store HTTP/1.1
1-0	-	0/0/864	.	5.34	2144	0	0.0	0.00	27.29	x.x.x.x	www.sungroper.asn.au	GET /gallery/thumbs/2001-05-06-Tabbing~08-Tab-4.jpg HTTP/1.1
1-0	-	0/0/1099	.	5.33	2144	0	0.0	0.00	16.40	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2005-02-13-Bali-Pouring-with-Rain_01-Sue-Rob
1-0	-	0/0/636	.	5.34	2144	0	0.0	0.00	19.75	x.x.x.x	www.sungroper.asn.au	GET /gallery/thumbs/2001-05-27-Panel_01-Template.jpg HTTP/1.1
2-0	23370	0/49/1031	_	3.89	290	4	0.0	0.93	34.09	x.x.x.x	www.keyboardmaestro.com	GET /img/box-bg.png HTTP/1.1
2-0	23370	0/40/939	_	3.89	290	0	0.0	0.75	21.27	x.x.x.x	www.keyboardmaestro.com	GET /img/title-bg.jpg HTTP/1.1
2-0	23370	0/80/913	W	3.88	0	0	0.0	0.95	31.80	x.x.x.x	www.stairways.com	GET /server-status HTTP/1.1
2-0	23370	1/78/853	K	4.06	1	940	51.2	0.50	37.11	x.x.x.x	www.peter.com.au	GET /articles/pantograph-images/pantograph.png HTTP/1.1
2-0	23370	0/33/826	_	3.90	272	20	0.0	0.68	36.05	x.x.x.x	www.stairways.com	GET /blog/rss.xml HTTP/1.1
2-0	23370	0/41/780	_	3.91	200	4	0.0	2.93	63.29	x.x.x.x	www.stairways.com	GET /server-status HTTP/1.1
2-0	23370	0/35/796	_	3.89	290	0	0.0	0.65	11.60	x.x.x.x	www.keyboardmaestro.com	GET /img/mainbuttons/download-both.jpg HTTP/1.1
2-0	23370	0/57/1073	_	4.00	192	0	0.0	0.85	34.47	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/record-quick-macro-example.png HTTP/1.1
2-0	23370	0/63/727	_	4.00	192	0	0.0	0.50	30.15	x.x.x.x	www.keyboardmaestro.com	GET /img/frames/setup-textedit-recording-example.png HTTP/1.1
2-0	23370	0/46/998	_	3.89	289	0	0.0	0.59	55.68	x.x.x.x	www.peter.com.au	GET /articles/favicon.ico HTTP/1.1
2-0	23370	0/114/1168	_	4.00	181	3864	0.0	2.91	31.16	x.x.x.x	www.peter.com.au	GET /metalwork/al-60-g0516-sieg-c6-m2/images/figure-2-lubricati
2-0	23370	0/136/1048	_	3.91	267	20	0.0	1.11	32.85	x.x.x.x	www.keyboardmaestro.com	GET /action/sivc?A&R&02118000&BF4348C4&FQXhHvrN&00000000&000010
2-0	23370	0/117/919	_	4.05	175	0	0.0	0.93	16.36	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/img/keyboardmaestro-title-icon.png HTTP/1.
2-0	23370	0/41/866	_	4.00	185	0	0.0	0.69	26.39	x.x.x.x	www.keyboardmaestro.com	GET /main/dummy.mov HTTP/1.1
2-0	23370	0/51/383	_	4.06	51	12	0.0	0.56	13.25	x.x.x.x	www.stairways.com	GET /blog/2006-12-07-applescript-edit-with HTTP/1.0
2-0	23370	0/40/718	_	4.05	130	0	0.0	0.74	14.62	x.x.x.x	www.sungroper.asn.au	GET /howto/index.html HTTP/1.1
2-0	23370	0/35/335	_	4.05	149	0	0.0	4.48	9.34	x.x.x.x	www.sungroper.asn.au	GET /project/solar-panel.html HTTP/1.0
2-0	23370	0/134/600	_	4.00	184	0	0.0	2.18	12.93	x.x.x.x	www.peter.com.au	GET /metalwork/al-60-g0516-sieg-c6-m2/images/circuit-1-lathe.gi
2-0	23370	0/115/1112	_	4.00	182	2092	0.0	1.64	28.84	x.x.x.x	www.peter.com.au	GET /metalwork/al-60-g0516-sieg-c6-m2/images/milling-drilling-f
2-0	23370	0/34/377	_	4.05	137	0	0.0	0.42	16.73	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/preferences.html HTTP/1.1
2-0	23370	0/38/394	_	4.05	174	0	0.0	0.55	13.91	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/programswitcher.html HTTP/1.1
2-0	23370	0/37/506	_	4.05	109	0	0.0	1.51	22.57	x.x.x.x	www.peter.com.au	GET /photos/photos/2002-09-02-3Brougham-Castle_0744.jpg HTTP/1.
2-0	23370	0/114/588	_	4.05	175	0	0.0	1.11	12.89	x.x.x.x	www.keyboardmaestro.com	GET /documentation/3/img/box-bg.png HTTP/1.1
2-0	23370	0/75/430	_	4.06	2	0	0.0	2.33	12.88	x.x.x.x	www.peter.com.au	GET /styles/downtown.css HTTP/1.1
2-0	23370	0/87/513	_	4.06	38	0	0.0	1.07	26.47	x.x.x.x	slice.peter.com.au	GET / HTTP/1.0
3-0	-	0/0/116	.	4.86	54611	4	0.0	0.00	4.70	x.x.x.x	www.peter.com.au	GET /favicon.ico HTTP/1.1
3-0	-	0/0/242	.	4.91	54610	0	0.0	0.00	7.52	x.x.x.x	www.peter.com.au	GET /favicon.ico HTTP/1.1
3-0	-	0/0/185	.	4.87	54611	1084	0.0	0.00	1.85	x.x.x.x	www.peter.com.au	GET /styles/perth_header.jpg HTTP/1.1
3-0	-	0/0/273	.	4.87	54611	4	0.0	0.00	2.74	x.x.x.x	www.keyboardmaestro.com	HEAD /main/features HTTP/1.1
3-0	-	0/0/225	.	4.87	54611	0	0.0	0.00	3.60	x.x.x.x	www.stairways.com	GET /blog/rss-2009-05-03-km4-teaser-clipboards.xml HTTP/1.0
3-0	-	0/0/145	.	4.90	54611	604	0.0	0.00	5.63	x.x.x.x	www.peter.com.au	GET /photos/photos/2005-05-30-Nikolas-Birthday_08-Penguin-Walk.
3-0	22023	0/1/1	R	0.22	76667	0	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/1/1	R	0.22	76667	4	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/1/1	R	0.21	76667	0	0.0	0.00	0.00	?	?	..reading..
3-0	-	0/0/137	.	4.90	54611	8	0.0	0.00	3.01	x.x.x.x	www.stairways.com	GET /blog/rss.xml HTTP/1.1
3-0	-	0/0/363	.	4.88	54611	0	0.0	0.00	7.13	x.x.x.x	www.peter.com.au	GET /favicon.ico HTTP/1.1
3-0	-	0/0/102	.	4.87	54611	508	0.0	0.00	1.78	x.x.x.x	www.peter.com.au	GET /photos/photos/2005-05-30-Nikolas-Birthday_08-Penguin-Walk.
3-0	22023	0/1/1	R	0.22	76667	0	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/1/1	R	0.22	76667	0	0.0	0.00	0.00	?	?	..reading..
3-0	-	0/0/127	.	4.86	54611	460	0.0	0.00	6.91	x.x.x.x	www.peter.com.au	GET /photos/photos/2005-05-30-Nikolas-Birthday_08-Penguin-Walk.
3-0	22023	0/1/1	R	0.22	76667	0	0.0	0.00	0.00	?	?	..reading..
3-0	22023	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
3-0	-	0/0/241	.	4.88	54611	8	0.0	0.00	4.74	x.x.x.x	www.stairways.com	GET /blog/rss.xml HTTP/1.1
3-0	-	0/0/118	.	4.87	54611	0	0.0	0.00	1.00	x.x.x.x	www.stairways.com	GET /sivc/anarchie?A&R&03628000&BCC13800&C0A80C75 HTTP/1.0
3-0	-	0/0/147	.	4.90	54611	12	0.0	0.00	3.36	x.x.x.x	www.peter.com.au	GET /photos/day/2002-08-20-Parnu.html HTTP/1.1
3-0	-	0/0/169	.	4.87	54611	16	0.0	0.00	1.81	x.x.x.x	www.peter.com.au	GET /photos/photos/2005-05-26-Jurong-Birdpark_14-Baby-Bird.jpg
3-0	-	0/0/255	.	4.90	54611	64	0.0	0.00	3.51	x.x.x.x	www.stairways.com	GET /blog/2007-11-03-leopard-dock HTTP/1.1
3-0	-	0/0/123	.	4.90	54611	0	0.0	0.00	1.48	x.x.x.x	www.peter.com.au	GET /favicon.ico HTTP/1.1
3-0	-	0/0/196	.	4.86	54611	0	0.0	0.00	3.62	x.x.x.x	www.peter.com.au	GET /favicon.ico HTTP/1.1
3-0	22023	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	-	0/0/191	.	5.31	54723	0	0.0	0.00	4.08	x.x.x.x	www.peter.com.au	GET /favicon.ico HTTP/1.1
4-0	-	0/0/204	.	5.30	54723	8	0.0	0.00	2.79	x.x.x.x	www.keyboardmaestro.com	GET /form/feedback?id=tips_rememberinghotkeys HTTP/1.1
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	-	0/0/201	.	5.29	54723	0	0.0	0.00	5.65	x.x.x.x	www.keyboardmaestro.com	GET /robots.txt HTTP/1.1
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	-	0/0/197	.	5.31	54722	704	0.0	0.00	7.20	x.x.x.x	www.peter.com.au	GET /photos/photos/2005-05-30-Nikolas-Birthday_08-Penguin-Walk.
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	-	0/0/120	.	5.30	54723	0	0.0	0.00	3.51	x.x.x.x	www.peter.com.au	GET /favicon.ico HTTP/1.1
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	-	0/0/302	.	5.31	54723	4	0.0	0.00	2.67	x.x.x.x	www.peter.com.au	GET /styles/downtown.css HTTP/1.1
4-0	-	0/0/269	.	5.31	54723	548	0.0	0.00	5.64	x.x.x.x	www.peter.com.au	GET /photos/photos/2005-05-30-Nikolas-Birthday_08-Penguin-Walk.
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	-	0/0/152	.	5.30	54723	472	0.0	0.00	2.14	x.x.x.x	www.peter.com.au	GET /styles/perth_header.jpg HTTP/1.1
4-0	-	0/0/273	.	5.29	54723	12	0.0	0.00	3.73	x.x.x.x	www.stairways.com	GET /blog/rss.xml HTTP/1.1
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	-	0/0/332	.	5.31	54723	440	0.0	0.00	2.96	x.x.x.x	www.peter.com.au	GET /photos/photos/2005-05-30-Nikolas-Birthday_08-Penguin-Walk.
4-0	22046	0/0/0	R	0.00	76674	0	0.0	0.00	0.00	?	?	..reading..
4-0	-	0/0/117	.	5.31	54723	1020	0.0	0.00	12.88	x.x.x.x	www.peter.com.au	GET /photos/photos/2005-05-30-Nikolas-Birthday_08-Penguin-Walk.
4-0	-	0/0/248	.	5.31	54723	4	0.0	0.00	2.14	x.x.x.x	www.stairways.com	GET /main/about HTTP/1.0
5-0	-	0/0/2	.	0.24	76653	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_19-Lord-Mayor-and-Nuna
5-0	-	0/0/2	.	0.24	76653	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_10-Team-Flag-and-Car.j
5-0	-	0/0/2	.	0.24	76653	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_12-or-not.jpg HTTP/1.1
5-0	-	0/0/2	.	0.31	76653	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_13-King-William-St.jpg
5-0	-	0/0/2	.	0.36	76653	4	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_11-Off-on-parade.jpg H
5-0	-	0/0/2	.	0.36	76653	0	0.0	0.00	0.01	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_20-Cars-on-Display.jpg
5-0	-	0/0/1	.	0.36	76653	8	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_20-Clever-Rock.jpg HTT
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	-	0/0/2	.	0.36	76653	0	0.0	0.00	0.01	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-27-Parade-Day_09-Southern-Exposure.j
5-0	-	0/0/1	.	0.36	76653	12	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_23-Devils-Marbles.jpg
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	-	0/0/1	.	0.36	76653	8	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_27-Devils-Marbles.jpg
5-0	-	0/0/1	.	0.36	76653	12	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_28-Shay-and-Fe-Rock.jp
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	-	0/0/1	.	0.36	76653	0	0.0	0.00	0.00	x.x.x.x	www.peter.com.au	GET /photos/thumbs/2001-11-21-Race-Day-4_35-Devils-Marbles.jpg
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
5-0	22079	0/0/0	R	0.00	76673	0	0.0	0.00	0.00	?	?	..reading..
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
Apache/2.2.9 Server at www.stairways.com Port 80



-- 
     Clipboard Switching and Macros with Keyboard Maestro

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/>           <http://download.stairways.com/>




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Memory / Process leak

Posted by André Warnier <aw...@ice-sa.com>.
Peter N Lewis wrote:
> 
> I already have:
> 
>     MaxRequestsPerChild   1000
> 
> So the worker processes should die and clean that out.
> 
> I'm suspicious that the worker threads are not dieing because I've seen cases where there are worker threads listed in ps but not listed in server-status (that will probably show up tomorrow or the next day when the server has been running a bit longer, and I'll post details of that if I haven't got a response by then).
> 
You are talking about threads. What MPM are you using, on which platform ?
Read http://httpd.apache.org/docs/2.2/mpm.html
and try ./httpd -l

You may need MaxRequestsPerThread instead.
Also, there are subtleties as to when Perl interpreter threads/instances 
are created/re-used/killed, depending on the mod_perl configuration.
You may want to investigate that a bit more in-depth.

All this is still a plaster over a real issue though.  The real issue is 
that some module is leaking memory, and you should really find out which 
one and go from there.  There may be an alternate module available or 
not, depending on the case.
It may also just be an application, not a Perl library module, that 
leaks memory.  I would consider that in fact much more likely.
What /are/ your "mod_perl pages" and what do they do ?
Is there any possibility to narrow down the search to some likely suspects ?
In the order of probabilities for memory leaks, I would consider, from 
most to least likely culprits :
1) perl application modules/pages
2) perl standard library modules handling XML
3) other perl standard library modules
4) Apache standard modules
5) Apache core code


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Memory / Process leak

Posted by Dan Poirier <po...@pobox.com>.
Nick Kew <ni...@webthing.com> writes:

> On 20 Nov 2009, at 09:59, Peter N Lewis wrote:
>> I already have:
>> 
>>    MaxRequestsPerChild   1000
>
> That's ridiculously low!

Which might be part of the problem.  After only handling 1000 requests,
a child process will /start/ to exit - but it can't really go away until
all its current requests have completed.  So if this is happening too
often, you can end up with a lot of "extra" child processes waiting for
requests to complete, and tying up memory.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Memory / Process leak

Posted by Peter N Lewis <pe...@stairways.com.au>.
Clearly, no one has any particularly helpful suggestions on what to do differently.

Apache, even under relatively light load, swallowed up 700+MB over two days.

So the only path forward I can see is to restart apache fairly regularly and delve in to switching to nginx.

Thanks to those of you who tried to help.  Maybe it is specific to slicehost.  Maybe its something in how I use MySQL or mod_perl.  Clearly this is beyond my ability to resolve, and is not some sort of well known problem.  

Thanks anyway,
   Peter.

-- 
     Clipboard Switching and Macros with Keyboard Maestro

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/>           <http://download.stairways.com/>




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Memory / Process leak

Posted by Peter N Lewis <pe...@stairways.com.au>.
On 20/11/2009, at 18:21 , Nick Kew wrote:

> On 20 Nov 2009, at 09:59, Peter N Lewis wrote:
> 
>> On 20/11/2009, at 17:29 , André Warnier wrote:
>> 
>>> Peter N Lewis wrote:
>>>> I am having a serious problem with my site running out of memory.  apache is leaking memory/processes.
> 
> You mentioned slicehost.  I have a slice, and I see a problem there which
> I see nowhere else of apache eating obscene amounts of memory.
> I don't know why, but my suspicion is that it doesn't play well with
> their virtualised environment.
> 
> My current dirty-hack workaround is to run apachectl graceful in a cron job.

Maybe I'll end up having to do that too.  I was certainly hoping for a better solution.

>> I already have:
>> 
>>   MaxRequestsPerChild   1000
> 
> That's ridiculously low!

I added that in an effort to get the processes to quit and release the memory.  If anything, it appears to have improved the situation, but the problem was around before that.
Besides, my site only gets a request per second on average, so it should only be restarting them every fifteen minutes or so, which should hardly put undo strain on the system!

On 20/11/2009, at 21:08 , Dan Poirier wrote:
>>>   MaxRequestsPerChild   1000
>> 
>> That's ridiculously low!
> 
> Which might be part of the problem.  After only handling 1000 requests,
> a child process will /start/ to exit - but it can't really go away until
> all its current requests have completed.  So if this is happening too
> often, you can end up with a lot of "extra" child processes waiting for
> requests to complete, and tying up memory.

Sure, but unless I was having 1000 requests per second what would it matter?  Even if it took a minute to die, it should still have long since died before its replacement was ready to die, right?

If things were working properly that is.  Maybe they aren't dieing properly.

Thanks,
   Peter.


-- 
     Clipboard Switching and Macros with Keyboard Maestro

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/>           <http://download.stairways.com/>




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Memory / Process leak

Posted by Nick Kew <ni...@webthing.com>.
On 20 Nov 2009, at 09:59, Peter N Lewis wrote:

> On 20/11/2009, at 17:29 , André Warnier wrote:
> 
>> Peter N Lewis wrote:
>>> I am having a serious problem with my site running out of memory.  apache is leaking memory/processes.

You mentioned slicehost.  I have a slice, and I see a problem there which
I see nowhere else of apache eating obscene amounts of memory.
I don't know why, but my suspicion is that it doesn't play well with
their virtualised environment.

My current dirty-hack workaround is to run apachectl graceful in a cron job.

> I already have:
> 
>    MaxRequestsPerChild   1000

That's ridiculously low!

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Memory / Process leak

Posted by Peter N Lewis <pe...@stairways.com.au>.
On 20/11/2009, at 17:29 , André Warnier wrote:

> Peter N Lewis wrote:
>> I am having a serious problem with my site running out of memory.  apache is leaking memory/processes.
> 
> Probably a lot more likely : your "mod_perl pages" are leaking memory.
> Perl will grab memory as needed, and once grabbed, will never release it to the OS until perl itself terminates, which rarely happens under Apache/mod_perl.
> Some perl modules do leak memory.  In my experience, for example various XML-parsing modules do.  It can be tricky to track down, because one "innocent" module may "use" another "not innocent" module etc..
> If/when you track it down, it may be possible (although inefficient) to isolate the bit which leaks memory, by converting it to a call to an external process.
> Another possible solution is to work with a prefork version of Apache, and make it so that each child handles only a number of requests, and then is killed and restarted.  I don't remember the details, but in most configurations this will also restart that child's perl interpreter, ergo free its memory back to the OS.
> Look up this :


I already have:

    MaxRequestsPerChild   1000

So the worker processes should die and clean that out.

I'm suspicious that the worker threads are not dieing because I've seen cases where there are worker threads listed in ps but not listed in server-status (that will probably show up tomorrow or the next day when the server has been running a bit longer, and I'll post details of that if I haven't got a response by then).

Thanks,
   Peter.

-- 
     Clipboard Switching and Macros with Keyboard Maestro

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/>           <http://download.stairways.com/>




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Memory / Process leak

Posted by André Warnier <aw...@ice-sa.com>.
Peter N Lewis wrote:
> I am having a serious problem with my site running out of memory.  apache is leaking memory/processes.

Probably a lot more likely : your "mod_perl pages" are leaking memory.
Perl will grab memory as needed, and once grabbed, will never release it 
to the OS until perl itself terminates, which rarely happens under 
Apache/mod_perl.
Some perl modules do leak memory.  In my experience, for example various 
XML-parsing modules do.  It can be tricky to track down, because one 
"innocent" module may "use" another "not innocent" module etc..
If/when you track it down, it may be possible (although inefficient) to 
isolate the bit which leaks memory, by converting it to a call to an 
external process.
Another possible solution is to work with a prefork version of Apache, 
and make it so that each child handles only a number of requests, and 
then is killed and restarted.  I don't remember the details, but in most 
configurations this will also restart that child's perl interpreter, 
ergo free its memory back to the OS.
Look up this :
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxrequestsperchild


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org