Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Dec 2007 11:20:15 +0900
From:      "Adrian Chadd" <adrian@freebsd.org>
To:        "Brett Glass" <brett@lariat.net>
Cc:        stable@freebsd.org
Subject:   Re: SMP on FreeBSD 6.x and 7.0: Worth doing?
Message-ID:  <d763ac660712241820s38237d99x1243862095780dc6@mail.gmail.com>
In-Reply-To: <200712241756.KAA21950@lariat.net>
References:  <200712220531.WAA09277@lariat.net> <476FBED0.2080400@samsco.org> <200712241549.IAA19650@lariat.net> <476FDA10.4060107@samsco.org> <200712241653.JAA20845@lariat.net> <476FE868.8080704@samsco.org> <200712241756.KAA21950@lariat.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 25/12/2007, Brett Glass <brett@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@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d763ac660712241820s38237d99x1243862095780dc6>