SMP on FreeBSD 6.x and 7.0: Worth doing?

Adrian Chadd adrian at freebsd.org
Mon Dec 24 18:20:16 PST 2007


On 25/12/2007, Brett Glass <brett at lariat.net> wrote:
> >It sounds like you're pretty convinced you know what the problem is.
>
> Again, I'd have to instrument either the FreeBSD kernel or Squid to
> be 100% sure. But it APPEARS that it's a problem with large
> numbers of threads trying to do file I/O simultaneously and blocking.

I'd still check the namei cache; Squid can and does chew through
stupid amounts of pathnames. Its why I hacked up that "ifs" thing a
few years ago but was suddenly (contractually) required to not hack on
caching for a while..

> (Aside: I wish that Squid used FreeBSD's sendfile(2) API once it got past
> the headers and was just streaming out a cached page. I suspect that
> this would make delivery of cache hits a lot more efficient, because
> sendfile(2) does "zero copy" transfers and works entirely within
> the kernel.)

There's plenty more work to do in Squid before sendfile() would actually matter.
I'm slowly working it all out in my spare time and as support contract
funding permits.

In fact, I think the Linux evolution of sendfile lets you write out a
userspace buffer before you glue it to something else like a socket or
file fd. That'd be more helpful here.

(No idea on the directory sizes these days - perhaps larger files with
dir hashing would help; but I certainly haven't benchmarked it. I just
use COSS for small objects. :)


Adrian

-- 
Adrian Chadd - adrian at freebsd.org


More information about the freebsd-stable mailing list