Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Sep 2010 10:26:22 +0300
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Wiktor Niesiobedzki <bsd@vink.pl>, Pawel Jakub Dawidek <pjd@freebsd.org>,  Konstantin Belousov <kib@freebsd.org>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: zfs very poor performance compared to ufs due to lack of cache?
Message-ID:  <4C85E91E.1010602@icyb.net.ua>
In-Reply-To: <AANLkTikNhsj5myhQCoPaNytUbpHtox1vg9AZm1N-OcMO@mail.gmail.com>
References:  <5DB6E7C798E44D33A05673F4B773405E@multiplay.co.uk> <AANLkTikNhsj5myhQCoPaNytUbpHtox1vg9AZm1N-OcMO@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
on 06/09/2010 21:34 Wiktor Niesiobedzki said the following:
> As far as I have check recently, nginx is using sendfile by default.
> There is already a reported bug against ZFS+sendfile
> (http://www.freebsd.org/cgi/query-pr.cgi?pr=141305&cat=) which results
> in bad performance.
> 
> The quickest workaround is to set:
> sendfile        off;
> 
> In http {} sectio of nginx.conf.
> 
> What I personally have observed, is that memory, that is used by
> sendfile, once freed lands in Inact group. And ARC is not able to
> force free of this memory.

Well, there is a patch for this, but that's besides the point of the sendfile issue.

> In my case, where I have 1G of ARC, then after sending 2G of file, my
> ARC is barerly on minimum level, and my ARC hit ratio drops to ~50%.
> 
> If I remove the file that was sent through sendfile, memory is moved
> from Inact to free, from where ARC happly grabs what it wants, and ARC
> hit ratio comes back to normal (~99%).

Interesting.  I briefly looked at the code in mappedread(), zfs_vnops.c, and I
have a VM question.
Shouldn't we mark the corresponding page bits as valid after reading data into
the page?
I specifically speak of the block that starts with the following line:
} else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) {
I am taking mdstart_swap as an example and it does m->valid = VM_PAGE_BITS_ALL.

-- 
Andriy Gapon



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