bbristow Posted January 31, 2007 Share Posted January 31, 2007 Well, I hope someone can point me in the right direction on this one. I have been running my web server a few years and have started to pay better attention to the log files and what the server is trying to tell me. However, I am a bit stumped on this one. My server is a P4 3.2 Hyper threaded machine running FreeBSD. The machine has anywhere from 10-100 active web clients at a time and normally serves up about 1-2 gigs of web traffic a day. The machine had 1 gig of ram in it and I noticed that the usage of ram was at 100% so I increased it to 2 gigs and within 20 minutes, the usage was back at 100%. Does apache have a memory leak? I am running apache version 1.3.33. Below are some of my server info and log files.Here is the results of TOP:last pid: 94636; load averages: 0.07, 0.12, 0.14 up 0+21:45:24 17:58:38148 processes: 1 running, 146 sleeping, 1 zombieCPU states: 10.9% user, 0.0% nice, 3.9% system, 0.4% interrupt, 84.8% idleMem: 1483M Active, 166M Inact, 257M Wired, 96M Cache, 199M Buf, 8376K FreeSwap: 1992M Total, 54M Used, 1938M Free, 2% Inuse PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU CPU COMMAND88963 www 2 0 23572K 17132K sbwait 0 0:01 1.86% 1.86% httpd44913 www 2 0 41560K 35100K accept 0 0:15 1.46% 1.46% httpd 2454 www 2 0 23364K 16712K accept 0 1:22 1.17% 1.17% httpd46977 www 2 0 25728K 19248K sbwait 0 0:04 0.83% 0.83% httpd46985 www 2 0 25216K 18744K sbwait 0 0:11 0.78% 0.78% httpd60011 www 2 0 23408K 16920K sbwait 0 0:02 0.63% 0.63% httpd48715 root 2 0 36492K 30712K select 0 0:10 0.10% 0.10% suidperl94568 qscand -6 0 5480K 4956K piperd 0 0:00 0.27% 0.10% perl5.8.694534 root 28 0 2096K 1204K CPU0 0 0:00 0.10% 0.05% top 175 mysql 2 0 51988K 17764K poll 0 356:09 0.00% 0.00% mysqld 856 root 2 0 2104K 860K select 0 3:09 0.00% 0.00% top 212 qscand 2 0 28164K 25196K poll 0 1:26 0.00% 0.00% clamd 3191 root 2 0 39280K 31604K select 0 1:14 0.00% 0.00% suidperl42968 www 2 0 40716K 34236K accept 0 0:30 0.00% 0.00% httpd40549 www 2 0 40100K 33628K accept 0 0:26 0.00% 0.00% httpd46982 www 2 0 33764K 27288K accept 0 0:23 0.00% 0.00% httpd 132 root 2 0 884K 312K poll 0 0:22 0.00% 0.00% supervise64141 www 2 0 46296K 39844K accept 0 0:21 0.00% 0.00% httpd40546 www 2 0 34828K 28348K accept 0 0:21 0.00% 0.00% httpd40550 www 2 0 35148K 28668K accept 0 0:21 0.00% 0.00% httpd46716 www 2 0 38320K 31848K accept 0 0:19 0.00% 0.00% httpd30078 www 2 0 24668K 18048K sbwait 0 0:16 0.00% 0.00% httpd46730 www 2 0 42388K 35924K accept 0 0:14 0.00% 0.00% httpd46736 www 2 0 35452K 29000K accept 0 0:14 0.00% 0.00% httpd46733 www 2 0 43116K 36664K accept 0 0:13 0.00% 0.00% httpd46975 www 2 0 38644K 32168K accept 0 0:13 0.00% 0.00% httpd46978 www 2 0 32972K 26496K accept 0 0:13 0.00% 0.00% httpd64135 www 2 0 31728K 25228K accept 0 0:11 0.00% 0.00% httpd44883 www 2 0 31068K 24592K accept 0 0:10 0.00% 0.00% httpd 354 root 2 0 26668K 15456K select 0 0:10 0.00% 0.00% suidperl46329 www 2 0 33580K 26916K sbwait 0 0:10 0.00% 0.00% httpd46033 www 2 0 33452K 26976K accept 0 0:10 0.00% 0.00% httpd46951 www 2 0 32092K 25592K accept 0 0:10 0.00% 0.00% httpd44897 www 2 0 35428K 28932K accept 0 0:08 0.00% 0.00% httpd46984 www 2 0 29768K 23276K accept 0 0:07 0.00% 0.00% httpd46715 www 2 0 31116K 24652K accept 0 0:07 0.00% 0.00% httpd59996 www 2 0 33420K 26964K accept 0 0:07 0.00% 0.00% httpd58779 www 2 0 29832K 23352K accept 0 0:07 0.00% 0.00% httpd46726 www 2 0 23404K 16920K accept 0 0:07 0.00% 0.00% httpd58773 www 2 0 32476K 26004K accept 0 0:07 0.00% 0.00% httpd58751 www 2 0 23476K 16964K accept 0 0:07 0.00% 0.00% httpd46725 www 2 0 23288K 16796K sbwait 0 0:06 0.00% 0.00% httpd46731 www 2 0 31624K 25144K sbwait 0 0:06 0.00% 0.00% httpd 124 root -6 0 872K 200K piperd 0 0:06 0.00% 0.00% readproctit 139 qmails 2 0 984K 468K select 0 0:06 0.00% 0.00% qmail-send 138 vpopmail 2 0 928K 436K accept 0 0:06 0.00% 0.00% tcpserver46737 www 2 0 27760K 21296K accept 0 0:06 0.00% 0.00% httpd64137 www 2 0 33812K 27344K accept 0 0:06 0.00% 0.00% httpd46958 www 2 0 23332K 16880K accept 0 0:05 0.00% 0.00% httpd 135 qmaill -6 0 904K 352K piperd 0 0:04 0.00% 0.00% multilog46321 www 2 0 24244K 17708K accept 0 0:04 0.00% 0.00% httpd46976 www 2 0 27224K 20740K accept 0 0:04 0.00% 0.00% httpd40531 www 2 0 30000K 23548K accept 0 0:04 0.00% 0.00% httpd46734 www 2 0 23616K 17084K accept 0 0:04 0.00% 0.00% httpd 143 vpopmail 2 0 38508K 18172K poll 0 0:03 0.00% 0.00% python46959 www 2 0 23328K 16840K accept 0 0:03 0.00% 0.00% httpd 266 root 2 0 10032K 3336K select 0 0:03 0.00% 0.00% httpd46328 www 2 0 23452K 16952K accept 0 0:03 0.00% 0.00% httpd40547 www 2 0 24276K 17776K accept 0 0:03 0.00% 0.00% httpd46708 www 2 0 23324K 16832K accept 0 0:02 0.00% 0.00% httpd64126 www 2 0 25848K 19348K accept 0 0:02 0.00% 0.00% httpd46732 www 2 0 23248K 16748K accept 0 0:02 0.00% 0.00% httpd 133 qmaill -6 0 904K 352K piperd 0 0:02 0.00% 0.00% multilog46983 www 2 0 23156K 16668K accept 0 0:02 0.00% 0.00% httpd64136 www 2 0 23296K 16804K accept 0 0:02 0.00% 0.00% httpdand here is the apache log:[Tue Jan 30 06:32:06 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 14 idle, and 71 total children[Tue Jan 30 06:32:07 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 22 idle, and 79 total children[Tue Jan 30 07:57:09 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 30 idle, and 74 total childrenhttpd in malloc(): warning: recursive callFATAL: emalloc(): Unable to allocate 0 bytes[Tue Jan 30 08:53:23 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 26 idle, and 79 total children[Tue Jan 30 09:28:28 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 16 idle, and 75 total children[Tue Jan 30 09:28:29 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 24 idle, and 83 total children[Tue Jan 30 12:10:51 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 14 idle, and 74 total children[Tue Jan 30 12:10:52 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 21 idle, and 82 total children[Tue Jan 30 14:54:37 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 26 idle, and 67 total children[Tue Jan 30 15:14:59 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 30 idle, and 50 total children[Tue Jan 30 15:15:40 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 17 idle, and 63 total children[Tue Jan 30 15:15:41 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 24 idle, and 71 total children[Tue Jan 30 16:14:19 2007] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 29 idle, and 63 total childrenIn my Apache config:MinSpareServers 32MaxSpareServers 64StartServers 32Any ideas or recommendations?Thanks for your help!-Bobby Quote Link to comment Share on other sites More sharing options...
effigy Posted January 31, 2007 Share Posted January 31, 2007 I've only used Apache 2+ and I haven't experienced this, but here are some ideas:- Google.- Read through [url=http://httpd.apache.org/docs/1.3/misc/perf-tuning.html]Apache Performance Tuning[/url].- What is your KeepAliveTimeout?- What is your MaxRequestsPerChild?- What programming languages/applications are you using with Apache? ...What are they doing? Basic stuff? Quote Link to comment Share on other sites More sharing options...
trq Posted January 31, 2007 Share Posted January 31, 2007 Assuming the BSD kernel works in a simular manor to Linux this is normal.[url=http://forums.gentoo.org/viewtopic-t-175419.html]This[/url] will explain it better then I ever could. Quote Link to comment Share on other sites More sharing options...
steviewdr Posted January 31, 2007 Share Posted January 31, 2007 Its normal for apache to cache as much ram as it can.I suggest you setup and use munin for monitoring your server and/or apache.http://wiki.kartbuilding.net/index.php/Munin_Statistics-steve Quote Link to comment Share on other sites More sharing options...
bbristow Posted January 31, 2007 Author Share Posted January 31, 2007 I just changed my Max Clients down to 36 from 512? Is this a good or bad idea?Here are some of my other settings:MaxRequestsPerChild 500KeepAliveTimeout 10I am using php and cgi. The most advanced php think that I run is Gallery. I have about 6 different galleries on my server Quote Link to comment Share on other sites More sharing options...
steviewdr Posted January 31, 2007 Share Posted January 31, 2007 Re. Max clients - Im not really sure. 36 should be sufficient.If you running gallery - its not the number of clients that would slow it down - its the database connections.Just yesterday - I realised/found the "Performance" tab in gallery - caches the photos and pages which saves a LOAD of load on the server. I highly recommend it.-steve Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.