From: Rob McCool <robm@netscape.com>
Newsgroups: netscape.devs-nsapi
Subject: Re: Dropping Child Processes (still/again)
Date: Fri, 26 Jul 1996 18:35:32 -0700

Steve Buffum wrote: [Server loses processes, below MinProc count under HP 10 but not HP 9]

> Now, I have two basic conjectures for what is causing these problems: > > 1) It's my fault: I am poorly managing memory in my C functions > (MALLOC, FREE, etc.), accidentally overwriting something in > ns-httpd's memory space, and losing the reference to the active child > process with no way to bring it back.

Regardless of how you manage your memory, you should not be able to cause the server to shrink, unless you caused the fork() calls to fail. You should grep for fork in your error log and see if there's any "resource temporarily unavailable" messages, or to see if you've somehow gone over one of the server user's kernel resource limitations that were set higher in 9.x.

> Has anyone noticed strange memory leaks with any combination of NSAPI, > Commerce 1.12, and HP-UX, though? And (asked especially of Netscape > folks) could someone please, please, PLEASE tell me under what > circumstances ns-httpd forks off more children (over and above > MinProcs) AND kills them off (down > *from* MaxProcs to MinProcs when the load lessens)?

The 1.x server will shrink the process pool as more processes extend past their process lifetime, or as processes exit due to I/O timeouts, and the server decides from its idle counts that it's not necessary to respawn them. One of the behaviors of this model is that if a process exits and the fork() to respawn it fails, the server will not attempt to do so again. This approach avoids looping through failed system calls, but really what you'd like the server to do instead is keep trying periodically.

--
Rob McCool, robm@netscape.com http://home.netscape.com/people/robm/
Stunt Programmer, Netscape Communications Corporation
It was working ten minutes ago, I swear...
Reproduced by permission of the author.