On Thu, 21 May 1998, Simon Rainey wrote:
> This is probably a dumb question but I'll ask it all the same. I've written
> a Squid redirector in C to block porn. The ever-increasing list of banned
> sites currently runs to 160kB (8700 lines) and the redirector loads this
> into memory at start-up.
This is probably a good start, but you should consider using Dan
Bernstein's cdb package.
Look at http://pobox.com/~djb/cdb.html (I think that's the URL...)
It is very fast, and does atomic updating, so you won't confuse your
redirector if you update it while somebody accesses it (via a redirector).
Dan actually did a sendmail /etc/aliases clone that uses it (fastforward),
and when running newaliases, he did 50000 new aliases in 6 seconds cpu
time, while sendmail's newaliases did it in 300 seconds cpu time...
Something worth considering, anyway.
> What are the benefits of spawning more than one redirector process given
> that the host has a single CPU? If I spawn more than one then Squid does
> use them all, but the second is hit about 10% of the time while the fifth
> is down below 1%.
You should set it up, so there is always _at least_ one that never gets
used, as a general rule.
AFAIK, spawning more will only cost you filedescriptors (but I could be
wrong), and possibly get you in trouble if you're running short on PIDs
:-)
Hope this helps.
Michael Samuel,
Surf-Net City - Internet Cafe and Internet Service Providers
Phone: +61 3 9593-9977
E-Mail: <michael@surfdirect.com.au>
WWW: http://www.surfnetcity.com.au/~michael/
Received on Thu May 21 1998 - 05:32:10 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:40:16 MST