Subject: kernel config/thttpd taking the server down
To: None <netbsd-help@netbsd.org>
From: DataZap <az@datazap.net>
List: netbsd-help
Date: 07/11/2006 22:28:49
Hi,

I hope that someone can help me, I have been running thttpd on NetBSD
for a long time, but recently I have had problems with the servers
crashing. I have 2.3 million files on one server and 1.7 on the other
server and I think that is why thttpd has a problem. The last thing in the
message is always:

Jul  4 20:24:10 agnus thttpd[548]: mmc panic - freeing all unreferenced
maps
Jul  4 20:24:10 agnus thttpd[548]: mmap - Cannot allocate memory

I have been starting thttpd with a shell script. This is what I am
currently using:
#!/bin/sh
#ulimit -S -d 73728
#ulimit -S -s 8192
#ulimit -S -p 100
ulimit -S -n 4000
/usr/pkg/sbin/thttpd -C /etc/thttpd-server.conf
sleep 2
renice -5 `cat /var/run/thttpd.pid`

I am limiting the number of files that it can open (if I don't limit this
then it crashes within a few minutes).

Could someone tell me if this because of not enough file descriptors or
because of some other deficiency in the kernel? I could include a sysctl
-a, if that would help. I have done alot of looking on google, but it has
not given me any useful info. The only thing that I see is where other
people are having the same problem, but if they have been able to solve
it, they didn't post the solution to any of the places that I have
searched. I have a second server that has 1 gig of ram, but it doesn't
even use more than 40 megs and it crashes sometimes too. So, this is not
an issue of not having enough ram, but something that is preventing thttpd
from using more memory. Could someone give some ideas on what I could try?

Thanks,
Al