All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Ryo Tsuruta <ryov@valinux.co.jp>
Cc: Rik Van Riel <riel@redhat.com>,
	guijianfeng@cn.fujitsu.com, linux-kernel@vger.kernel.org,
	jmoyer@redhat.com, dm-devel@redhat.com, jens.axboe@oracle.com,
	Nauman Rafique <nauman@google.com>,
	akpm@linux-foundation.org, agk@redhat.com,
	balbir@linux.vnet.ibm.com
Subject: ioband: Writer starves reader even without competitors (Re: Regarding dm-ioband tests)
Date: Tue, 15 Sep 2009 19:37:07 -0400	[thread overview]
Message-ID: <20090915233706.GA3770@redhat.com> (raw)
In-Reply-To: <20090908175400.GE15974@redhat.com>

On Tue, Sep 08, 2009 at 01:54:00PM -0400, Vivek Goyal wrote:

[..]
> I ran a test to show how readers can be starved in certain cases. I launched
> one reader and three writers. I ran this test twice. First without dm-ioband
> and then with dm-ioband.
> 
> Following are few lines from the script to launch readers and writers.
> 
> **************************************************************
> sync
> echo 3 > /proc/sys/vm/drop_caches
> 
> # Launch writers on sdd2
> dd if=/dev/zero of=/mnt/sdd2/writezerofile1 bs=4K count=262144 &
> 
> # Launch  writers on sdd1
> dd if=/dev/zero of=/mnt/sdd1/writezerofile1 bs=4K count=262144 &
> dd if=/dev/zero of=/mnt/sdd1/writezerofile2 bs=4K count=262144 &
> 
> echo "sleeping for 5 seconds"
> sleep 5
> 
> # launch reader on sdd1
> time dd if=/mnt/sdd1/testzerofile1 of=/dev/zero &
> echo "launched reader $!"
> *********************************************************************
> 
> Without dm-ioband, reader finished in roughly 5 seconds.
> 
> 289533952 bytes (290 MB) copied, 5.16765 s, 56.0 MB/s
> real	0m5.300s
> user	0m0.098s
> sys	0m0.492s
> 
> With dm-ioband, reader took, more than 2 minutes to finish.
> 
> 289533952 bytes (290 MB) copied, 122.386 s, 2.4 MB/s
> 
> real	2m2.569s
> user	0m0.107s
> sys	0m0.548s
> 
> I had created ioband1 on /dev/sdd1 and ioband2 on /dev/sdd2 with weights
> 200 and 100 respectively.

Hi Ryo,

I notice that with-in a single ioband device, a single writer starves the
reader even without any competitor groups being present.

I ran following two tests with and without dm-ioband devices

Test1
====
Try to use fio for a sequential reader job. First fio will lay out the
file and do write operation. While those writes are going on, try to do
ls on that partition and observe latency of ls operation.

with dm-ioband (ls test)
------------------------
# cd /mnt/sdd2
# time ls

real    0m9.483s
user    0m0.000s
sys     0m0.002s

without dm-ioband (ls test)
---------------------------
# cd /mnt/sdd2
# time ls

256M-file1  256M-file5  2G-file1  2G-file5    writefile1  writezerofile
256M-file2  256M-file6  2G-file2  files       writefile2
256M-file3  256M-file7  2G-file3  fio         writefile3
256M-file4  256M-file8  2G-file4  lost+found  writefile4

real    0m0.067s
user    0m0.000s
sys     0m0.002s

Notice the time simle "ls" operation took in two cases.


Test2
=====
Same case where fio is laying out a file and then try to read some small
files on that partition at the interval of 1 second.

small file read with dm-ioband
------------------------------
[root@chilli fairness-tests]# ./small-file-read.sh
file #   0, plain reading it took: 0.24 seconds
file #   1, plain reading it took: 13.40 seconds
file #   2, plain reading it took: 6.27 seconds
file #   3, plain reading it took: 13.84 seconds
file #   4, plain reading it took: 5.63 seconds


small file read with-out dm-ioband
==================================
[root@chilli fairness-tests]# ./small-file-read.sh
file #   0, plain reading it took: 0.04 seconds
file #   1, plain reading it took: 0.03 seconds
file #   2, plain reading it took: 0.04 seconds
file #   3, plain reading it took: 0.03 seconds
file #   4, plain reading it took: 0.03 seconds

Notice how small file read latencies have shot up.

Looks like a single writer is completely starving a reader even without
any IO going in any of the other groups.

setup
=====
I created an two ioband device of weight 100 each on partition /dev/sdd1
and /dev/sdd2 respectively. I am doing IO only on partition /dev/sdd2
(ioband2).

Following is fio job script.

[seqread]
runtime=60
rw=read
size=2G
directory=/mnt/sdd2/fio/
numjobs=1
group_reporting


Following is small file read script.

echo 3 > /proc/sys/vm/drop_caches

for ((i=0;i<5;i++)); do
        printf "file #%4d, plain reading it took: " $i
        /usr/bin/time -f "%e seconds"  cat /mnt/sdd2/files/$i >/dev/null
        sleep 1
done


Thanks
Vivek

WARNING: multiple messages have this Message-ID (diff)
From: Vivek Goyal <vgoyal@redhat.com>
To: Ryo Tsuruta <ryov@valinux.co.jp>
Cc: Nauman Rafique <nauman@google.com>,
	linux-kernel@vger.kernel.org, dm-devel@redhat.com,
	jens.axboe@oracle.com, agk@redhat.com, akpm@linux-foundation.org,
	guijianfeng@cn.fujitsu.com, jmoyer@redhat.com,
	balbir@linux.vnet.ibm.com, Rik Van Riel <riel@redhat.com>
Subject: ioband: Writer starves reader even without competitors (Re: Regarding dm-ioband tests)
Date: Tue, 15 Sep 2009 19:37:07 -0400	[thread overview]
Message-ID: <20090915233706.GA3770@redhat.com> (raw)
In-Reply-To: <20090908175400.GE15974@redhat.com>

On Tue, Sep 08, 2009 at 01:54:00PM -0400, Vivek Goyal wrote:

[..]
> I ran a test to show how readers can be starved in certain cases. I launched
> one reader and three writers. I ran this test twice. First without dm-ioband
> and then with dm-ioband.
> 
> Following are few lines from the script to launch readers and writers.
> 
> **************************************************************
> sync
> echo 3 > /proc/sys/vm/drop_caches
> 
> # Launch writers on sdd2
> dd if=/dev/zero of=/mnt/sdd2/writezerofile1 bs=4K count=262144 &
> 
> # Launch  writers on sdd1
> dd if=/dev/zero of=/mnt/sdd1/writezerofile1 bs=4K count=262144 &
> dd if=/dev/zero of=/mnt/sdd1/writezerofile2 bs=4K count=262144 &
> 
> echo "sleeping for 5 seconds"
> sleep 5
> 
> # launch reader on sdd1
> time dd if=/mnt/sdd1/testzerofile1 of=/dev/zero &
> echo "launched reader $!"
> *********************************************************************
> 
> Without dm-ioband, reader finished in roughly 5 seconds.
> 
> 289533952 bytes (290 MB) copied, 5.16765 s, 56.0 MB/s
> real	0m5.300s
> user	0m0.098s
> sys	0m0.492s
> 
> With dm-ioband, reader took, more than 2 minutes to finish.
> 
> 289533952 bytes (290 MB) copied, 122.386 s, 2.4 MB/s
> 
> real	2m2.569s
> user	0m0.107s
> sys	0m0.548s
> 
> I had created ioband1 on /dev/sdd1 and ioband2 on /dev/sdd2 with weights
> 200 and 100 respectively.

Hi Ryo,

I notice that with-in a single ioband device, a single writer starves the
reader even without any competitor groups being present.

I ran following two tests with and without dm-ioband devices

Test1
====
Try to use fio for a sequential reader job. First fio will lay out the
file and do write operation. While those writes are going on, try to do
ls on that partition and observe latency of ls operation.

with dm-ioband (ls test)
------------------------
# cd /mnt/sdd2
# time ls

real    0m9.483s
user    0m0.000s
sys     0m0.002s

without dm-ioband (ls test)
---------------------------
# cd /mnt/sdd2
# time ls

256M-file1  256M-file5  2G-file1  2G-file5    writefile1  writezerofile
256M-file2  256M-file6  2G-file2  files       writefile2
256M-file3  256M-file7  2G-file3  fio         writefile3
256M-file4  256M-file8  2G-file4  lost+found  writefile4

real    0m0.067s
user    0m0.000s
sys     0m0.002s

Notice the time simle "ls" operation took in two cases.


Test2
=====
Same case where fio is laying out a file and then try to read some small
files on that partition at the interval of 1 second.

small file read with dm-ioband
------------------------------
[root@chilli fairness-tests]# ./small-file-read.sh
file #   0, plain reading it took: 0.24 seconds
file #   1, plain reading it took: 13.40 seconds
file #   2, plain reading it took: 6.27 seconds
file #   3, plain reading it took: 13.84 seconds
file #   4, plain reading it took: 5.63 seconds


small file read with-out dm-ioband
==================================
[root@chilli fairness-tests]# ./small-file-read.sh
file #   0, plain reading it took: 0.04 seconds
file #   1, plain reading it took: 0.03 seconds
file #   2, plain reading it took: 0.04 seconds
file #   3, plain reading it took: 0.03 seconds
file #   4, plain reading it took: 0.03 seconds

Notice how small file read latencies have shot up.

Looks like a single writer is completely starving a reader even without
any IO going in any of the other groups.

setup
=====
I created an two ioband device of weight 100 each on partition /dev/sdd1
and /dev/sdd2 respectively. I am doing IO only on partition /dev/sdd2
(ioband2).

Following is fio job script.

[seqread]
runtime=60
rw=read
size=2G
directory=/mnt/sdd2/fio/
numjobs=1
group_reporting


Following is small file read script.

echo 3 > /proc/sys/vm/drop_caches

for ((i=0;i<5;i++)); do
        printf "file #%4d, plain reading it took: " $i
        /usr/bin/time -f "%e seconds"  cat /mnt/sdd2/files/$i >/dev/null
        sleep 1
done


Thanks
Vivek


  reply	other threads:[~2009-09-15 23:37 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 16:50 Regarding dm-ioband tests Vivek Goyal
2009-09-01 16:50 ` Vivek Goyal
2009-09-01 17:47 ` Vivek Goyal
2009-09-01 17:47   ` Vivek Goyal
2009-09-03 13:11   ` Vivek Goyal
2009-09-03 13:11     ` Vivek Goyal
2009-09-04  1:12     ` Ryo Tsuruta
2009-09-15 21:40       ` dm-ioband fairness in terms of sectors seems to be killing disk (Was: Re: Regarding dm-ioband tests) Vivek Goyal
2009-09-15 21:40         ` Vivek Goyal
2009-09-16 11:10         ` dm-ioband fairness in terms of sectors seems to be killing disk Ryo Tsuruta
2009-09-16 11:10           ` Ryo Tsuruta
2009-09-04  4:02 ` Regarding dm-ioband tests Ryo Tsuruta
2009-09-04  4:02   ` Ryo Tsuruta
2009-09-04 23:11   ` Vivek Goyal
2009-09-04 23:11     ` Vivek Goyal
2009-09-07 11:02     ` Ryo Tsuruta
2009-09-07 11:02       ` Ryo Tsuruta
2009-09-07 13:53       ` Rik van Riel
2009-09-07 13:53         ` Rik van Riel
2009-09-08  3:01         ` Ryo Tsuruta
2009-09-08  3:01           ` Ryo Tsuruta
2009-09-08  3:22           ` Balbir Singh
2009-09-08  3:22             ` Balbir Singh
2009-09-08  5:05             ` Ryo Tsuruta
2009-09-08  5:05               ` Ryo Tsuruta
2009-09-08 13:49               ` Vivek Goyal
2009-09-08 13:49                 ` Vivek Goyal
2009-09-09  5:17                 ` Ryo Tsuruta
2009-09-09  5:17                   ` Ryo Tsuruta
2009-09-09 13:34                   ` Vivek Goyal
2009-09-09 13:34                     ` Vivek Goyal
2009-09-08 13:42           ` Vivek Goyal
2009-09-08 13:42             ` Vivek Goyal
2009-09-08 16:30             ` Nauman Rafique
2009-09-08 16:30               ` Nauman Rafique
2009-09-08 16:47               ` Rik van Riel
2009-09-08 16:47                 ` Rik van Riel
2009-09-08 17:54                 ` Vivek Goyal
2009-09-08 17:54                   ` Vivek Goyal
2009-09-15 23:37                   ` Vivek Goyal [this message]
2009-09-15 23:37                     ` ioband: Writer starves reader even without competitors (Re: Regarding dm-ioband tests) Vivek Goyal
2009-09-16 12:08                     ` ioband: Writer starves reader even without competitors Ryo Tsuruta
2009-09-08 17:06             ` Regarding dm-ioband tests Dhaval Giani
2009-09-09  6:05               ` Ryo Tsuruta
2009-09-09  6:05                 ` Ryo Tsuruta
2009-09-09 10:51                 ` Dhaval Giani
2009-09-10  7:58                   ` Ryo Tsuruta
2009-09-10  7:58                     ` Ryo Tsuruta
2009-09-11  9:53                     ` Dhaval Giani
2009-09-15 15:12                       ` Ryo Tsuruta
2009-09-15 15:12                         ` Ryo Tsuruta
2009-09-15 15:19                         ` Balbir Singh
2009-09-15 15:19                           ` Balbir Singh
2009-09-15 15:58                           ` Rik van Riel
2009-09-15 15:58                             ` Rik van Riel
2009-09-15 16:21                           ` Ryo Tsuruta
2009-09-15 16:21                             ` Ryo Tsuruta
2009-09-09 13:57                 ` Vivek Goyal
2009-09-09 13:57                   ` Vivek Goyal
2009-09-10  3:06                   ` Ryo Tsuruta
2009-09-09 10:01             ` Ryo Tsuruta
2009-09-09 14:31               ` Vivek Goyal
2009-09-09 14:31                 ` Vivek Goyal
2009-09-10  3:45                 ` Ryo Tsuruta
2009-09-10 13:25                   ` Vivek Goyal
2009-09-10 13:25                     ` Vivek Goyal
2009-09-08 19:24           ` Rik van Riel
2009-09-08 19:24             ` Rik van Riel
2009-09-09  0:09             ` Fabio Checconi
2009-09-09  2:06               ` Vivek Goyal
2009-09-09  2:06                 ` Vivek Goyal
2009-09-09 15:41                 ` Fabio Checconi
2009-09-09 17:30                   ` Vivek Goyal
2009-09-09 17:30                     ` Vivek Goyal
2009-09-09 19:01                     ` Fabio Checconi
2009-09-09  9:24               ` Ryo Tsuruta
2009-09-09  9:24                 ` Ryo Tsuruta
2009-09-16  4:45       ` ioband: Limited fairness and weak isolation between groups (Was: Re: Regarding dm-ioband tests) Vivek Goyal
2009-09-16  4:45         ` Vivek Goyal
2009-09-18  7:33         ` ioband: Limited fairness and weak isolation between groups Ryo Tsuruta

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=20090915233706.GA3770@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=dm-devel@redhat.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=jens.axboe@oracle.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nauman@google.com \
    --cc=riel@redhat.com \
    --cc=ryov@valinux.co.jp \
    /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 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.