Subject: Re: FFS slowness
To: Ivan Kanis <cake@tadpole.com>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: netbsd-users
Date: 12/22/2005 11:26:56
On Thu, Dec 22, 2005 at 04:03:14PM +0000, Ivan Kanis wrote:
> Hello,
> 
> I am seeing poor performance with FFS + softdep. 
> 
> My machine is an AMD Opteron and it is connected to a SCSI disk
> with an Adaptec 7902 Ultra320 Wide card.
> 
> The problem in a nutshell is that I am getting 1/4 of the perfomance
> when copying a directory compar to copying a big file.

That's hardly surprising, considering you're copying from one disk to
itself.  The big file will be laid out in large, sequential pieces on
the disk; the kernel will buffer the writes and flush them out in a
fairly efficient way between the reads.

The directory, however, is many small files.  Softdep eliminates most
of the synchronous I/O, but it does nothing to address the fact that
you're copying data from all over the disk, which will cause a high
ration of seeks to actual reads and writes.  If you don't have at
least twice the size of the file data in page cache -- and at least
twice the size of all the metadata in metadata cache -- this will be
quite slow.  When the disk is seeking, it's not reading or writing,
and the filesystem is not, by default, tuned for copying huge numbers
of comparatively small files from one place to another, because that
would *detune* it for other uses.

Thor