Discussion:
LFS "smooth" syncer workaround/performance tuning
Blair Sadewitz
2007-04-02 01:15:54 UTC
Permalink
I'd grown annoyed at how LFS would blast data to the disk according to
vfs.sync.*delay settings. A while ago, I thought, "why not just
disable the sync delay altogether?" Try setting:

vfs.sync.delay = 0
vfs.sync.filedelay = 0
vfs.sync.metadelay = 0
vfs.sync dirdelay = 0

Then, find out how much bandwidth you have at the inside and outside
of your disk. That is, run newfs_lfs -ANF on a partition close to
cylinder 0, then do the same on a partition close to the last
cylinder. Average the two, then calculate the LFS "page trip" with
the following formula (thanks tls):

t=(avg_bandwidth_in_bytes / PAGE_SIZE) / 4

I'd imagine that averaging is more or less moot if you don't plan on
using > %50 of your disk's capacity, or if you are using a partition
smaller than a majority of the disk.

Set vfs.lfs.pagetrip=t, and notice how data is now written much more
smoothly to the disk. You can fiddle with vfs.lfs.pagetrip according
to the amount of latency you want. This works especially well with
BUFQ_PRIOCSCAN or BUFQ_READPRIO. For further optimization, I'd
recommend using BUFQ_PRIOCSCAN and tweaking the burst values using
xtraeme's bufq sysctl patch:

http://www.xtrarom.org/patches/bufq_sysctl.diff

I'd be interested to hear if other people find this useful or not. I
find these settings useful enough such that I wish there were a way to
turn off vfs sync only for LFS, as using these settings with FFS isn't
too much fun. ;)


Regards,

--Blair
--
Support WFMU-FM: free-form radio for the masses!
<http://www.wfmu.org/>

"The frivolity and boredom which unsettle the established order, the
vague foreboding of something unknown, these are the heralds of
approaching change. The gradual crumbling that left unaltered the
face of the whole is cut short by a sunburst which, in one flash,
illuminates the features of the new world." --G.W.F. Hegel,
_Phenomenology of Spirit_ 5:11
Juan RP
2007-04-03 08:00:20 UTC
Permalink
This patch for bufq+sysctl is not optimal because it should be using values
per-drive
not globally, perhaps in the future I'll do it correctly...

----- Original Message -----
From: "Blair Sadewitz" <***@gmail.com>
To: <tech-***@netbsd.org>; <current-***@netbsd.org>
Sent: Monday, April 02, 2007 3:15 AM
Subject: LFS "smooth" syncer workaround/performance tuning
Post by Blair Sadewitz
I'd grown annoyed at how LFS would blast data to the disk according to
vfs.sync.*delay settings. A while ago, I thought, "why not just
vfs.sync.delay = 0
vfs.sync.filedelay = 0
vfs.sync.metadelay = 0
vfs.sync dirdelay = 0
Then, find out how much bandwidth you have at the inside and outside
of your disk. That is, run newfs_lfs -ANF on a partition close to
cylinder 0, then do the same on a partition close to the last
cylinder. Average the two, then calculate the LFS "page trip" with
t=(avg_bandwidth_in_bytes / PAGE_SIZE) / 4
I'd imagine that averaging is more or less moot if you don't plan on
using > %50 of your disk's capacity, or if you are using a partition
smaller than a majority of the disk.
Set vfs.lfs.pagetrip=t, and notice how data is now written much more
smoothly to the disk. You can fiddle with vfs.lfs.pagetrip according
to the amount of latency you want. This works especially well with
BUFQ_PRIOCSCAN or BUFQ_READPRIO. For further optimization, I'd
recommend using BUFQ_PRIOCSCAN and tweaking the burst values using
http://www.xtrarom.org/patches/bufq_sysctl.diff
I'd be interested to hear if other people find this useful or not. I
find these settings useful enough such that I wish there were a way to
turn off vfs sync only for LFS, as using these settings with FFS isn't
too much fun. ;)
Blair Sadewitz
2007-04-03 12:26:32 UTC
Permalink
It helps me out sufficiently, as I'm using an LFS ccd on three
identical drives. ;)

--Blair
--
Support WFMU-FM: free-form radio for the masses!
<http://www.wfmu.org/>

"The frivolity and boredom which unsettle the established order, the
vague foreboding of something unknown, these are the heralds of
approaching change. The gradual crumbling that left unaltered the
face of the whole is cut short by a sunburst which, in one flash,
illuminates the features of the new world." --G.W.F. Hegel,
_Phenomenology of Spirit_ 5:11
Loading...