All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] IO scheduler, queue depth, nr_requests
@ 2004-02-16  9:11 Miquel van Smoorenburg
  2004-02-16  8:30 ` [linux-lvm] " Jens Axboe
  0 siblings, 1 reply; 59+ messages in thread
From: Miquel van Smoorenburg @ 2004-02-16  9:11 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-lvm

Hello,

	as you might have seen from the linux-kernel mailinglist
I have been testing for months now with a fileserver set up to
use XFS over LVM2 on a 3ware RAID5 controller.

I asked for help several times on the list, but nobody really
replied, so now I'm taking a shot at mailing you directly, since
you appear to be the I/O request queueing guru of the kernel ;)
Cc: sent to linux-lvm@sistina.com. Any hint appreciated.

For some reason, when using LVM, write requests get queued out
of order to the 3ware controller, which results in quite a bit
of seeking and thus performance loss.

The default queue depth of the 3ware controller is 254. I found
out that lowering it to 64 in the driver fixed my problems, and
I advised 3ware support about this. They weren't really convinced..

By fiddling about today I just found that changing
/sys/block/sda/queue/nr_requests from 128 to something above
the queue depth of the 3ware controller (256 doesn't work,
384 and up do) also fixes the problem.

Does that actually make sense ?

Ah yes, I'm currently using 2.6.2 with a 3ware 8506-8 in
hardware raid5 mode, deadline scheduler, PIV 3.0 Ghz, 2 GB RAM.

Debug output ("mydd" works just like "dd", but has an fsync option):

- /mnt is an XFS filesystem on a LVM2 volume on the 3ware
- /mnt2 is an XFS filesystem directly on /dev/sda1 of the 3ware

- First on /mnt, the LVM partition. Note that a small "dd" runs
  fast, a larger one runs slower:

# cd /mnt
# cat /sys/block/sda/device/queue_depth
254
# cat /sys/block/sda/queue/nr_requests
128
# ~/mydd --if /dev/zero --of file --bs 4096 --count 50000 --fsync
204800000 bytes transferred in 2.679812 seconds (76423271 bytes/sec)
# ~/mydd --if /dev/zero --of file --bs 4096 --count 100000 --fsync
409600000 bytes transferred in 9.501549 seconds (43108760 bytes/sec)

- Now I set the nr_requests to 512:
# echo 512 > /sys/block/sda/queue/nr_requests
# ~/mydd --if /dev/zero --of file --bs 4096 --count 100000 --fsync
409600000 bytes transferred in 5.374437 seconds (76212634 bytes/sec)

See that ? Weird thing is, it's only on LVM, directly on /dev/sda1
no problem at all:

# cat /sys/block/sda/device/queue_depth
254
# cat /sys/block/sda/queue/nr_requests
128
# ~/mydd --if /dev/zero --of file --bs 4096 --count 100000 --fsync
409600000 bytes transferred in 5.135642 seconds (79756338 bytes/sec)

Somehow, LVM is causing the requests to the underlying 3ware
device to get out of order, and increasing nr_requests to be
larger than the queue_depth of the device fixes this.

I tried the latest dm-patches in -mm (applied those to vanilla
2.6.2), which include a patch called dm-04-maintain-bio-ordering.patch
but that doesn't really help (at first I though otherwise, but the
tests scripts I used lowered the queue_depth of the 3ware to 64
by accident) - if anything, it makes things worse.

# ~/mydd --if /dev/zero --of file --bs 4096 --count 100000 --fsync
409600000 bytes transferred in 13.138224 seconds (31176208 bytes/sec)

Setting nr_requests to 512 fixes things up again.

Mike.

^ permalink raw reply	[flat|nested] 59+ messages in thread

end of thread, other threads:[~2004-02-24 15:58 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-16  9:11 [linux-lvm] IO scheduler, queue depth, nr_requests Miquel van Smoorenburg
2004-02-16  8:30 ` [linux-lvm] " Jens Axboe
2004-02-16  9:01   ` Joe Thornber
2004-02-16 19:32   ` Kevin P. Fleming
2004-02-17  1:46   ` Kevin P. Fleming
2004-02-18 10:29   ` Miquel van Smoorenburg
2004-02-18 23:52     ` Miquel van Smoorenburg
2004-02-19  8:51       ` [linux-lvm] " Miquel van Smoorenburg
2004-02-19  1:24       ` Nick Piggin
2004-02-19  8:51         ` [linux-lvm] " Nick Piggin
2004-02-19  1:52         ` Miquel van Smoorenburg
2004-02-19  9:00           ` [linux-lvm] " Miquel van Smoorenburg
2004-02-19  2:01           ` Nick Piggin
2004-02-19  9:00             ` [linux-lvm] " Nick Piggin
2004-02-19  1:26       ` Andrew Morton
2004-02-19  8:50         ` [linux-lvm] " Andrew Morton
2004-02-19  2:11         ` Miquel van Smoorenburg
2004-02-19  9:08           ` [linux-lvm] " Miquel van Smoorenburg
2004-02-19  2:26           ` Andrew Morton
2004-02-19  9:08             ` [linux-lvm] " Andrew Morton
2004-02-19 10:15             ` Miquel van Smoorenburg
2004-02-19 10:23               ` [linux-lvm] " Miquel van Smoorenburg
2004-02-19 10:19               ` Jens Axboe
2004-02-19 10:26                 ` [linux-lvm] " Jens Axboe
2004-02-19 15:58                 ` Miquel van Smoorenburg
2004-02-19 20:59                   ` Miquel van Smoorenburg
2004-02-19 17:52                   ` [linux-lvm] " Nick Piggin
2004-02-19 22:52                     ` Nick Piggin
2004-02-19 18:52                     ` [linux-lvm] " Miquel van Smoorenburg
2004-02-19 23:53                       ` Miquel van Smoorenburg
2004-02-19 19:15                       ` [linux-lvm] " Nick Piggin
2004-02-20  0:15                         ` Nick Piggin
2004-02-19 20:16                       ` [linux-lvm] [PATCH] per process request limits (was Re: IO scheduler, queue depth, nr_requests) Nick Piggin
2004-02-20  1:12                         ` Nick Piggin
2004-02-19 20:25                         ` [linux-lvm] " Andrew Morton
2004-02-20  1:26                           ` Andrew Morton
2004-02-19 20:40                           ` [linux-lvm] " Nick Piggin
2004-02-20  1:40                             ` Nick Piggin
2004-02-19 21:32                             ` [linux-lvm] " Andrew Morton
2004-02-20  2:32                               ` Andrew Morton
2004-02-20 14:40                               ` [PATCH] bdi_congestion_funp (was: Re: [PATCH] per process request limits (was Re: IO scheduler, queue depth, nr_requests)) Miquel van Smoorenburg
2004-02-23  8:41                                 ` [linux-lvm] " Miquel van Smoorenburg
2004-02-20  9:56                                 ` [linux-lvm] " Joe Thornber
2004-02-20 14:59                                   ` Joe Thornber
2004-02-20  9:59                                   ` [linux-lvm] " Jens Axboe
2004-02-20 15:00                                     ` Jens Axboe
2004-02-22 14:02                                     ` Miquel van Smoorenburg
2004-02-23  8:45                                       ` [linux-lvm] " Miquel van Smoorenburg
2004-02-22 14:55                                       ` Andrew Morton
2004-02-22 19:55                                         ` Andrew Morton
2004-02-20  9:57                                 ` [linux-lvm] " Jens Axboe
2004-02-20 14:57                                   ` Jens Axboe
2004-02-24 12:54                                   ` [linux-lvm] Queue congestion: passing down vs passing up [PATCH] Miquel van Smoorenburg
2004-02-19 20:52                         ` [linux-lvm] Re: [PATCH] per process request limits (was Re: IO scheduler, queue depth, nr_requests) Nick Piggin
2004-02-20  1:45                           ` Nick Piggin
2004-02-19  2:51           ` IO scheduler, queue depth, nr_requests Nick Piggin
2004-02-19  9:11             ` [linux-lvm] " Nick Piggin
2004-02-19 10:21             ` Jens Axboe
2004-02-19 10:26               ` [linux-lvm] " Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.