All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [dm-crypt] md-raid5+lvm+dm-crypt+kvm: one streaming write starves all reads
@ 2009-09-18 21:21 Sven Eschenberg
  2009-09-19  0:45 ` Arno Wagner
  0 siblings, 1 reply; 16+ messages in thread
From: Sven Eschenberg @ 2009-09-18 21:21 UTC (permalink / raw)
  To: dm-crypt

Erh, no, this would come down to 0.1 seconds (since it's 100th - centi).

And now, it does not start a flush, it only wakes the daemon up for
analysis and consideration. If, and how much is flushed depends on other
tuneables.
Unfortunately it's not that straight forward.

Regards

-Sven

P.S.: Sorry for the duplicate post with the wrong e-mail addy.

On Fri, September 18, 2009 23:09, Arno Wagner wrote:
>
> A pity. Have you tried to set dirty_writeback_centisecs to
> something very low, e.g. 10? If I understand this correctly that would
cause regular flushes to start after 1 sec.
>
>
> Arno
>
>

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [dm-crypt] md-raid5+lvm+dm-crypt+kvm: one streaming write starves all reads
@ 2009-09-15 23:54 Christian Pernegger
  2009-09-16  8:11 ` Arno Wagner
  0 siblings, 1 reply; 16+ messages in thread
From: Christian Pernegger @ 2009-09-15 23:54 UTC (permalink / raw)
  To: dm-crypt

Hi again!

The very short version is that writing a larger stream of data to an
encrypted volume starves all reads on *all* encrypted volumes. Doesn't
matter if they reside on different disks or even different
controllers.

Example: Alice is watching a video (on a windows client using VLC to
access the file on a samba share, in case it matters). Then Bob starts
backing up his /home of multiple gigs using tar, at which point the
video turns into a slideshow. And that's putting it mildly ...

Since the unencrypted volumes are fine it seem dm-crypt is the culprit
but it might as well be any other layer in our storage setup or, more
likely, a combination.

Anyway, on the lowest level are a md-raid1 and two -raid5 arrays,
grouped into lvm VGs raid1 and raid5 respectively. Some of the LVs on
that are encrypted, some aren't. These LVs in turn serve as virtual
disks for a handful of kvm boxes (via virtio). OS is Debian 5.02
(lenny) using the 2.6.30 kernel from backports.org, running on an
Intel C2Q with 8GB of RAM.

I thought 2.6.30 would split the crypto work between the four cores,
but it doesn't. Performance maxes out just over 100MiB/s, which is
close to the crypto performance of one core. (openssl speed
aes-256-cbc gives me ~115MiB/s for one core, ~440MiB/s for all four.)
That's probably kvm's fault, since from the pov of the kernel doing
the I/O a whole virtual machine is just one process ... and all
parallelization, I/O scheduling etc. seems to go out of the window.

One of the VMs is our file server and it's doing fine except that
writes nearly drown out reads, see above. I've tried messing with the
I/O schedulers on the host and guest side, no change. One write stream
is enough to bring the whole disk subsystem to its knees. 15 secs to
execute /bin/ls as soon as one dd if=/dev/zero of=test bs=4M is
running ...

All I can think of at this point is that the disks are "too fast" for
the CPU. The VM sends down write requests continously, all of which
take cycles to encrypt before they even hit the I/O scheduling queue.
Now along comes a lonely read that has to wait ages for decryption
since the crypt processes are so busy with writes. Since the arrays
can write 2-3x faster than the CPU can encrypt, the (I/O scheduling)
queue never comes into action ...

Any ideas on how I could diagnose the problem are very much
appreciated, I'll gladly answer any request for further info.

Thanks,

Chris

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

end of thread, other threads:[~2009-10-21 20:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-18 21:21 [dm-crypt] md-raid5+lvm+dm-crypt+kvm: one streaming write starves all reads Sven Eschenberg
2009-09-19  0:45 ` Arno Wagner
2009-09-19 11:45   ` Sven Eschenberg
2009-10-21 10:48     ` Christian Pernegger
2009-10-21 10:59       ` Rick Moritz
2009-10-21 15:05         ` Christian Pernegger
2009-10-21 15:08           ` Rick Moritz
2009-10-21 15:34             ` Michael Gebetsroither
2009-10-21 20:22               ` Christian Pernegger
  -- strict thread matches above, loose matches on Subject: below --
2009-09-15 23:54 Christian Pernegger
2009-09-16  8:11 ` Arno Wagner
2009-09-16 17:40   ` Christian Pernegger
     [not found]     ` <20090916215427.GA20647@tansi.org>
2009-09-17  0:36       ` Christian Pernegger
2009-09-17 11:12         ` Arno Wagner
2009-09-18 12:22           ` Christian Pernegger
2009-09-18 21:09             ` Arno Wagner

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.