linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ali Gholami Rudi <aligrudi@gmail.com>
To: linux-raid@vger.kernel.org
Cc: song@kernel.org
Subject: Unacceptably Poor RAID1 Performance with Many CPU Cores
Date: Thu, 15 Jun 2023 11:24:11 +0330	[thread overview]
Message-ID: <20231506112411@laper.mirepesht> (raw)

Hi,

This simple experiment reproduces the problem.

Create a RAID1 array using two ramdisks of size 1G:

  mdadm --create /dev/md/test --level=1 --raid-devices=2 /dev/ram0 /dev/ram1

Then use fio to test disk performance (iodepth=64 and numjobs=40;
details at the end of this email).  This is what we get in our machine
(two AMD EPYC 7002 CPUs each with 64 cores and 2TB of RAM; Linux v5.10.0):

Without RAID (writing to /dev/ram0)
READ:  IOPS=14391K BW=56218MiB/s
WRITE: IOPS= 6167K BW=24092MiB/s

RAID1 (writing to /dev/md/test)
READ:  IOPS=  542K BW= 2120MiB/s
WRITE: IOPS=  232K BW=  935MiB/s

The difference, even for reading is huge.

I tried perf to see what is the problem; results are included at the
end of this email.

Any ideas?

We are actually executing hundreds of VMs on our hosts.  The problem
is that when we use RAID1 for our enterprise NVMe disks, the
performance degrades very much compared to using them directly; it
seems we have the same bottleneck as the test described above.

Thanks,
Ali

Perf output:

Samples: 1M of event 'cycles', Event count (approx.): 1158425235997
  Children      Self  Command  Shared Object           Symbol
+   97.98%     0.01%  fio      fio                     [.] fio_libaio_commit
+   97.95%     0.01%  fio      libaio.so.1.0.1         [.] io_submit
+   97.85%     0.01%  fio      [kernel.kallsyms]       [k] __x64_sys_io_submit
-   97.82%     0.01%  fio      [kernel.kallsyms]       [k] io_submit_one
   - 97.81% io_submit_one
      - 54.62% aio_write
         - 54.60% blkdev_write_iter
            - 36.30% blk_finish_plug
               - flush_plug_callbacks
                  - 36.29% raid1_unplug
                     - flush_bio_list
                        - 18.44% submit_bio_noacct
                           - 18.40% brd_submit_bio
                              - 18.13% raid1_end_write_request
                                 - 17.94% raid_end_bio_io
                                    - 17.82% __wake_up_common_lock
                                       + 17.79% _raw_spin_lock_irqsave
                        - 17.79% __wake_up_common_lock
                           + 17.76% _raw_spin_lock_irqsave
            + 18.29% __generic_file_write_iter
      - 43.12% aio_read
         - 43.07% blkdev_read_iter
            - generic_file_read_iter
               - 43.04% blkdev_direct_IO
                  - 42.95% submit_bio_noacct
                     - 42.23% brd_submit_bio
                        - 41.91% raid1_end_read_request
                           - 41.70% raid_end_bio_io
                              - 41.43% __wake_up_common_lock
                                 + 41.36% _raw_spin_lock_irqsave
                     - 0.68% md_submit_bio
                          0.61% md_handle_request
+   94.90%     0.00%  fio      [kernel.kallsyms]       [k] __wake_up_common_lock
+   94.86%     0.22%  fio      [kernel.kallsyms]       [k] _raw_spin_lock_irqsave
+   94.64%    94.64%  fio      [kernel.kallsyms]       [k] native_queued_spin_lock_slowpath
+   79.63%     0.02%  fio      [kernel.kallsyms]       [k] submit_bio_noacct


FIO configuration file:

[global] 
name=random reads and writes
ioengine=libaio 
direct=1
readwrite=randrw 
rwmixread=70 
iodepth=64 
buffered=0 
#filename=/dev/ram0
filename=/dev/dm/test
size=1G
runtime=30 
time_based 
randrepeat=0 
norandommap 
refill_buffers 
ramp_time=10
bs=4k
numjobs=400
group_reporting=1
[job1]


             reply	other threads:[~2023-06-15  8:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15  7:54 Ali Gholami Rudi [this message]
2023-06-15  9:16 ` Unacceptably Poor RAID1 Performance with Many CPU Cores Xiao Ni
2023-06-15 17:08   ` Ali Gholami Rudi
2023-06-15 17:36     ` Ali Gholami Rudi
2023-06-16  1:53       ` Xiao Ni
2023-06-16  5:20         ` Ali Gholami Rudi
2023-06-15 14:02 ` Yu Kuai
2023-06-16  2:14   ` Xiao Ni
2023-06-16  2:34     ` Yu Kuai
2023-06-16  5:52     ` Ali Gholami Rudi
     [not found]     ` <20231606091224@laper.mirepesht>
2023-06-16  7:31       ` Ali Gholami Rudi
2023-06-16  7:42         ` Yu Kuai
2023-06-16  8:21           ` Ali Gholami Rudi
2023-06-16  8:34             ` Yu Kuai
2023-06-16  8:52               ` Ali Gholami Rudi
2023-06-16  9:17                 ` Yu Kuai
2023-06-16 11:51                 ` Ali Gholami Rudi
2023-06-16 12:27                   ` Yu Kuai
2023-06-18 20:30                     ` Ali Gholami Rudi
2023-06-19  1:22                       ` Yu Kuai
2023-06-19  5:19                       ` Ali Gholami Rudi
2023-06-19  6:53                         ` Yu Kuai
2023-06-21  8:05                     ` Xiao Ni
2023-06-21  8:26                       ` Yu Kuai
2023-06-21  8:55                         ` Xiao Ni
2023-07-01 11:17                         ` Ali Gholami Rudi
2023-07-03 12:39                           ` Yu Kuai
2023-07-05  7:59                             ` Ali Gholami Rudi
2023-06-21 19:34                       ` Wols Lists
2023-06-23  0:52                         ` Xiao Ni

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=20231506112411@laper.mirepesht \
    --to=aligrudi@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@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;
as well as URLs for NNTP newsgroup(s).