On Fri, Feb 20, 2004 at 11:48:03PM -0800, Dan Quinlan wrote:
> spamd forks off one process per incoming message?  (I should disclose
> that I don't run spamd.)

Yeah.  It does the traditional server model.

> It's crazy to fork for every check for servers written in C (since the
> days of NCSA httpd).  In Perl it's serious nutball material.  100%
> agreement that we should change this.

Well, it's not super terrible, you just have the cost of the fork()
(it's not like perl has to re-compile all the modules).  It works ok,
but as usual can be made more efficient. :)

> It might make sense to generalize how it works and share code between
> mass-check and spamd.

That may be possible.  In mass-check we basically spawn X kids and for
each spawn we throw a target mailbox+offset (on the filesystem) at them.
We then wait for a response from any child, and when we get one, throw
the result into the log file, and send that child another mailbox+offset.
That happens until we either run out of messages or we need to restart
the kids (--restart, which causes a "ok, kill yourself now" message to
be sent out, then the spawn thing happens again, etc.)

That's sort of copyable for spamd -- except we'd have to track which
child is dealing with what input connection so we can pass the correct
data back to the correct connection.  Very simply, if all the children
are busy, we just stop accepting new connections.  We'd also want to
track msgs/child so we can restart them periodically, and we'd also want
to deal with timeouts for children -- although I'm more inclined to deal
with that in the child than the parent.

As I said, it'd be nice if we could use some of the httpd code to do
this, since this is exactly what they do... and since we're all in the
ASF and using the same license now ... ;)

Then again, this shouldn't be too difficult to get going, so ...

-- 
Randomly Generated Tagline:
I think $[ is more like a coelacanth than a mastadon.
              -- Larry Wall in <[EMAIL PROTECTED]>

Attachment: pgpkrlrPadllE.pgp
Description: PGP signature

Reply via email to