Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Speed test of SD card

  1. #1
    Join Date
    Aug 2006
    Beans
    417
    Distro
    Ubuntu 13.04 Raring Ringtail

    Talking Speed test of SD card

    Yeah, I know, this isn't possible, but it's like I'm reading from a cache or something?

    Doing speed testing on an SD card using Ubuntu 12.10 64-bit and the following commands:

    Code:
    dd if=/dev/zero of=~/test.tmp bs=500K count=1024
    
    dd if=~/test.tmp of=/dev/null bs=500K count=1024
    I'm interpreting that as writing zeroes to test.tmp, then reading back test.tmp to /dev/null. Right?

    It worked a couple of times, now I'm getting:

    Code:
    mark@Sauron:/media/mark$ dd if=/dev/zero of=/media/mark/test.tmp bs=500K count=1024
    1024+0 records in
    1024+0 records out
    524288000 bytes (524 MB) copied, 466.175 s, 1.1 MB/s
    mark@Sauron:/media/mark$ dd if=/media/mark/test.tmp of=/dev/null bs=500K count=1024
    1024+0 records in
    1024+0 records out
    524288000 bytes (524 MB) copied, 0.166738 s, 3.1 GB/s
    What? 3.1 GB/s shouldn't be possible over USB 2.0. It shouldn't even be possible over SATA3 for that matter...

    What's going on here?

  2. #2
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,699

    Re: Did I fill up /dev/null?

    The second dd is probably reading from cache memory rather than from the hardware.

  3. #3
    Join Date
    Aug 2006
    Beans
    417
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Did I fill up /dev/null?

    Quote Originally Posted by The Cog View Post
    The second dd is probably reading from cache memory rather than from the hardware.
    That's what it looks like, but I can't figure out what cache. The SD card itself has no cache of course, nor does the card reader. With a speed of 3.1 GB/s, looks like it's reading from main memory somehow? Odd also that it performed this test properly a few times, then this, consistently and repeatedly.

  4. #4
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Did I fill up /dev/null?

    Quote Originally Posted by Fraoch View Post
    That's what it looks like, but I can't figure out what cache. The SD card itself has no cache of course, nor does the card reader. With a speed of 3.1 GB/s, looks like it's reading from main memory somehow? Odd also that it performed this test properly a few times, then this, consistently and repeatedly.
    hi
    if you want to know what's going up - following these steps.
    1. after you reboot - open a terminal and run: top (have a look at mem used and cached used)
    2. run your tests using another filename ---> look again at the values
    3. run it again ---> look at your values
    4. delete those files
    5. look again at the top values (mem used and cache) - surprised ?-)
    what i'll tell U is - it is not always what you see is what you get.
    by the way that's a part of the reason (I/O speed - not CPU ticks - that's mostely blended ) of the price of hig-end servers.
    ciao
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  5. #5
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Did I fill up /dev/null?

    Quote Originally Posted by Fraoch View Post
    That's what it looks like, but I can't figure out what cache. The SD card itself has no cache of course, nor does the card reader. With a speed of 3.1 GB/s, looks like it's reading from main memory somehow? Odd also that it performed this test properly a few times, then this, consistently and repeatedly.
    It's being cached in RAM.

    Any file that you access on a Linux machine is held in RAM as a cached file, the file is only dropped by the cache if your RAM is needed for a running process.
    For more information this page may be of some help...

    http://www.linuxatemyram.com/
    Cheesemill

  6. #6
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Did I fill up /dev/null?

    Quote Originally Posted by Cheesemill View Post
    It's being cached in RAM.

    Any file that you access on a Linux machine is held in RAM as a cached file, the file is only dropped by the cache if your RAM is needed for a running process.
    For more information this page may be of some help...

    http://www.linuxatemyram.com/
    +1 Cheesemill - short and clear (just a little question: what is RAM ? - you now what i mean - have my funny day today )
    ups - don't understand me false ( i think you now what i mean)
    ciao
    richi
    Last edited by rnerwein; March 18th, 2013 at 04:58 PM.
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  7. #7
    Join Date
    Aug 2006
    Beans
    417
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Did I fill up /dev/null?

    Quote Originally Posted by Cheesemill View Post
    It's being cached in RAM.

    Any file that you access on a Linux machine is held in RAM as a cached file, the file is only dropped by the cache if your RAM is needed for a running process.
    For more information this page may be of some help...

    http://www.linuxatemyram.com/
    That makes sense, thank you.

    I'm googling around, and it seems that there are workarounds to disable caching for this process:

    http://romanrm.ru/en/dd-benchmark

    I might try the conv=fdatasync option specified on that page.

    Incidentally I probably wasn't using this the proper way in the first place. I'm speed testing two new SD cards for use in a Raspberry Pi (not delivered yet!) which only has 512 MB of RAM and could never cache 524 MB of data:

    http://elinux.org/RPi_SD_cards#Performance

  8. #8
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Speed test of SD card

    Just a little snippet to add. If you want to force all cached files to be dropped to ensure you are testing the speed of the SD card you can use the following command between runs...
    Code:
    echo 3 | sudo tee /proc/sys/vm/drop_caches
    Cheesemill

  9. #9
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Speed test of SD card

    Because of the hardware differences between a Rapberry Pi and a true Linux desktop or laptop, the real speed test will need to be done using actual hardware, running actual programs on the Pi. Anything else is just a suggestion of performance. If you want robust testing, then install phoronix-test-suite and run some I/O and file-handling benchmarks. I don't know if the phoronix test suite has been ported to the Pi, but that would give you some serious benchmarks to compare.

    Because of the wear-leveling used on SD cards, they tend to slow down over time. So new card versus 6-month-old card testing would be useful.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  10. #10
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Speed test of SD card

    Quote Originally Posted by Cheesemill View Post
    Just a little snippet to add. If you want to force all cached files to be dropped to ensure you are testing the speed of the SD card you can use the following command between runs...
    Code:
    echo 3 | sudo tee /proc/sys/vm/drop_caches
    hi cheesemill
    that's ok - but i think you missed the "sync" before. must be your keyboard
    no swet - have fun (you understand me or ?)
    ciao
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •