CEPH filesystem development
 help / color / mirror / Atom feed
From: Christian Brunner <chb@muc.de>
To: ceph-devel@vger.kernel.org
Subject: [PATCH] rbd: add queuing delay
Date: Sun, 20 Jun 2010 22:44:26 +0200	[thread overview]
Message-ID: <20100620204426.GA7139@chb-desktop> (raw)

Hi Yehuda,

while running tests with qemu-io I've been experiencing a lot of
messages when running a large writev request (several hundred MB in
a single call):

10.06.20 22:10:07.337108 b67dcb70 client4136.objecter  pg 3.437e on [0] is laggy: 33
10.06.20 22:10:07.337708 b67dcb70 client4136.objecter  pg 3.2553 on [0] is laggy: 19
[...]

Everything is working fine, though. I think that the large number of
queued requests is the cause for this behaviour and I would propose to
delay futher requests (see attached patch).

What do you think about it?

Another question: I there a way to figure out max_osd through librados?

Christian

---
 block/rbd.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/block/rbd.c b/block/rbd.c
index 74589cb..241b0c6 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -47,6 +47,14 @@
 
 #define OBJ_MAX_SIZE (1UL << OBJ_DEFAULT_OBJ_ORDER)
 
+/*
+ * For best performance MAX_RADOS_REQS should be at least as large as the 
+ * number of osds. It may be larger, but if to high you may experience lagging
+ *
+ * XXX: automatically set to 2*max_osd ???
+ */
+#define MAX_RADOS_REQS 16
+
 typedef struct RBDAIOCB {
     BlockDriverAIOCB common;
     QEMUBH *bh;
@@ -507,6 +515,11 @@ static BlockDriverAIOCB *rbd_aio_rw_vector(BlockDriverState *bs,
         rcb->segsize = segsize;
         rcb->buf = buf;
 
+        /* delay rados aio requests when the queue is getting to large */
+        while ((segnr - last_segnr + acb->aiocnt) > MAX_RADOS_REQS) {
+		usleep(100);
+	}
+
         if (write) {
             rados_aio_create_completion(rcb, NULL,
                                         (rados_callback_t) rbd_finish_aiocb,
-- 
1.7.0.4


             reply	other threads:[~2010-06-20 20:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-20 20:44 Christian Brunner [this message]
2010-06-21 23:52 ` [PATCH] rbd: add queuing delay Yehuda Sadeh Weinraub
2010-06-22 20:27   ` Christian Brunner
2010-06-22 21:03     ` Yehuda Sadeh Weinraub
2010-06-27 21:05       ` Christian Brunner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100620204426.GA7139@chb-desktop \
    --to=chb@muc.de \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox