> > Do you have any suggestion as to how to get back the free()d memory?
> > Will (borrowing Apache's way) using a prefork-kind of daemon, with 
> > limited lifetime
> > for each child, be better (in sense of memory management) than the current
> > thread implementation? Or perhaps limiting the lifetime of each thread 
> > sufficient?
>
> Apache has been moving away from the "prefork-kind of daemon" towards
> threads for a number of years.
>
> The lifetime of threads in clamd is limited by the workload. If they
> don't have any work to do for a period of time, then they exit.

Just as an FYI, when I wrote my smtp filter daemon, I gave some
thought to preforking, using threads, etc - but for the first implementation
I just let xinetd kick it off as a regular on-demand process.

Much to my surprise it has performed quite acceptably, at a reasonably
large and reasonably busy site (roughly 35,000 mails per day per pserver -
we're using two MX servers for business continuity, but on days when
only one has been running it has handled 70,000 mails per day just as
handily)  Load average during the busy part of the day stays around .5
(This is a 2 processor box so a LA of 2 would be fully loaded, rather
than 1 on a single processor system, i.e. it's about 25% loaded.)

The smtp filter invokes uvscan, clamscan, spamc and spamprobe on
each mail.  Only spamd runs as a daemon, the rest are simple processes
kicked off on demand.

So unless you have a site with more than a couple of thousand users,
I'm not at all sure that tweaks like you're talking about are worth
the programming complexity.  I think the benefits are soon overtaken
by the speed increases of newer hardware.


Graham


-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to