[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Could RAM possibly be just 3-4 times faster than bare hdd writes and reads? or, is the Linux kernel doing its 'magic' in the bg? or, ...



Albretch Mueller writes:

[...]

 does dd actually hit the bare metal drive or is it just reaching the
disks cache

 This is what I am consistently getting from my code doing intesive IO
on the RAM drive:

// __ write speed test
# time dd if=/dev/zero of="${_RAM_MNT}"/zero bs=4k count=100000

[...]

409600000 Bytes (410 MB, 391 MiB) kopiert, 0,756943 s, 541 MB/s

[...]

Just to add a datapoint: I have /tmp on a ramdisk and initially thought you might be using too little data to test properly? However, after testing, one can see that my system outputs higher transfer rates even when using small amounts of data...

### Ramdisk (tmpfs) Write Speed

~$ time dd if=/dev/zero of=/tmp/ramtest.bin bs=4k count=1536000
1536000+0 records in
1536000+0 records out
6291456000 bytes (6.3 GB, 5.9 GiB) copied, 2.64634 s, 2.4 GB/s

real	0m2.648s
user	0m0.816s
sys	0m1.832s

~$ time dd if=/dev/zero of=/tmp/ramtest.bin bs=4k count=100000
100000+0 records in
100000+0 records out
409600000 bytes (410 MB, 391 MiB) copied, 0.179949 s, 2.3 GB/s

real	0m0.182s
user	0m0.033s
sys	0m0.149s

### HDD (MDADM RAID1) Write Speed

$ time dd if=/dev/zero of=/fs/e01/nobak/test.bin bs=4k count=5242880 conv=fdatasync
5242880+0 records in
5242880+0 records out
21474836480 bytes (21 GB, 20 GiB) copied, 168.831 s, 127 MB/s

real	2m48.833s
user	0m3.137s
sys	0m12.492s

### SSD (MDADM RAID1) Write Speed

$ time dd if=/dev/zero of=/home/linux-fan/wd/test.bin bs=4k count=5242880 conv=fdatasync
5242880+0 records in
5242880+0 records out
21474836480 bytes (21 GB, 20 GiB) copied, 47.0841 s, 456 MB/s

real	0m47.086s
user	0m3.049s
sys	0m12.246s

Could it be possible that on your system, writing to the ramdisk is somehow bound by CPU speed? What hardware are you using? My tests were on this system:

$ syssheet -g
┌─────── System Sheet Script 1.2.3, Copyright (c) 2012-2020 Ma_Sys.ma ─────────┐
│ linux-fan (id 1000) on rxvt-unicode-256color    Debian GNU/Linux 10 (buster) │
│ Linux 4.19.0-9-amd64                                                  x86_64 │
│ 17.06.2020 13:15:16                                                     pte5 │
│ up 31 min,  8 users,  load avg: 1.29, 2.83, 1.73              2004/32121 MiB │
│ 8 Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz                                  │
├────────────────────────────────── Network ───────────────────────────────────┤
│ Interface                      Sent/MiB  Received/MiB                Address │
│ eno1                                  0             0                        │
│ eno2                                 47          2641        192.168.1.16/24 │
│ ens2                                  0             0         192.168.2.1/30 │
├─────────────────────────────── File systems ─────────────────────────────────┤
│ Mountpoint                     Used/GiB        Of/GiB             Percentage │
│ /                                   204           251                    84% │
│ /fs/ll                             1324          1563                    86% │
│ /fs/e01                            1413          1615                    93% │
│ /data                               100           216                    50% │
├─────────────────────────────────── Users ────────────────────────────────────┤
│ Username     MEM/MiB            Top/MEM      CPU          Top/CPU   Time/min │
│ colord            13             colord       0%           colord          0 │
│ Debian-exim        3              exim4       0%            exim4          0 │
│ rtkit              2       rtkit-daemon       0%     rtkit-daemon          0 │
└──────────────────────────────────────────────────────────────────────────────┘

$ mount | grep '/tmp'
tmpfs on /tmp type tmpfs (rw,relatime,size=6291456k,nr_inodes=1048576)

HTH
Linux-Fan

Attachment: pgppga3XnWdWM.pgp
Description: PGP signature


Reply to: