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

Re: System on a chip - performance relative size and setup (how can the (Debian) setup make a difference?)



Hi Andy, thanks for taking time and for your advise!

On 6/22/19 10:22 PM, Andy Smith wrote:
Hi Erik,

On Fri, Jun 21, 2019 at 03:02:46PM +0200, Erik Josefsson wrote:
Maybe flashbench cannot tell me anything about that anyway?

Are there other tools?
I'm not familiar with flashbench. I like fio. It's available in
Debian.

I like to do the following tests. Example fio command line follows
for each.

- sequential read speed (MB/sec)

     $ fio --name="seqread" \
           --filename="/mnt/fioscratch" \
           --ioengine=libaio \
           --readwrite=read \
           --direct=1 \
           --numjobs=2 \
           --bs=4k \
           --iodepth=4 \
           --size=1g \
           --runtime=300s \
           --gtod_reduce=1 \
           --group_reporting | tee -a /home/$USER/fio.txt

- sequential write speed (MB/sec)

     $ fio --name="seqwrite" \
           --filename="/mnt/fioscratch" \
           --ioengine=libaio \
           --readwrite=write \
           --direct=1 \
           --numjobs=2 \
           --bs=4k \
           --iodepth=4 \
           --size=1g \
           --runtime=300s \
           --gtod_reduce=1 \
           --group_reporting | tee -a /home/$USER/fio.txt

- random 4KiB reads (IOPS)

     $ fio --name="randread" \
           --filename="/mnt/fioscratch" \
           --ioengine=libaio \
           --readwrite=randread \
           --direct=1 \
           --numjobs=2 \
           --bs=4k \
           --iodepth=4 \
           --size=1g \
           --runtime=300s \
           --gtod_reduce=1 \
           --group_reporting | tee -a /home/$USER/fio.txt

- random 4KiB writes (IOPS)

     $ fio --name="randread" \
           --filename="/mnt/fioscratch" \
           --ioengine=libaio \
           --readwrite=randwrite \
           --direct=1 \
           --numjobs=2 \
           --bs=4k \
           --iodepth=4 \
           --size=1g \
           --runtime=300s \
           --gtod_reduce=1 \
           --group_reporting | tee -a /home/$USER/fio.txt

Explanation:

name: Identifies the block of test output in the results output
       file.

filename: This file will be written out and then read from or
           written to. So your test device needs to be mounted on
           /mnt first.


Teres-I has one MicroSD slot, one HDMI and two USB ports.

Is it meaningful to test the SD cards with an USB-adapter? (the MicroSD slot would be occupied by the SD card the machine is running from/on)


  As long as your user has write access there,
           fio does not need to be run as root.

readwrite: Sets the mis of reads and writes and whether they are
            sequential or random.

direct: Use direct IO, bypassing Linux's page cache. If you don't
         use this, you'll only be testing Linux's cache which would
         distort results since you're only testing 1GiB of data which
         could well fit entirely within your RAM. Note that many
         storage devices have their own cache, but this probably
         isn't relevant for your case.

numjobs: Spawn two processes each of which will be doing the same
          thing at once.

bs: Use 4KiB sized IOs. If you can benchark your real application
     you may find it uses different-sized IOs, but if you don't know
     then 4KiB is a reasonable start.

iodepth: Each process will issue 4 IOs at once, rather than issuing
          one and then waiting for it to complete.

size/runtime: The tests will read or write 1GiB of data but there is
               also a time limit of 5 minutes and if that runs out
               first then the test will stop. I don't think you need
               to do many hours of testing here. After 5 minutes I
               should think the card will be showing its reasonable
               performance.

gtod_reduce: Don't do some tests that require the gettimeofday
              system call. Without this, fio can spend a lot of its
              CPU time calling that system call instead of
              benchmarking, and you rarely require the info it gives
              back anyway. Run without this option once to see if you
              really require it.

group_reporting: Aggregate results from all jobs (processes) within
                  the test.

| tee -a …: Output the results both to the screen and append to a
             file in your home directory.

Of those figures, I consider the random ones more important in most
configurations. i.e. if I had to choose between a device that
supported a bit higher sequential read/write but much lower random
read/write, I'd rather have the random read/write, because that
tends to have more impact on interactive usage than sequential.

Yes, going back and forth between Thunderbird and Firefox while copying text snippets from one app to the other sometimes ends in a mouse pointer freeze.

That's basically what I do most of the time...



SD cards tend to have poor random IO speed so I would never use one
for general purpose computing if I could use an HDD or SSD instead.


If random IO speed most likely is the real bottle neck, do you know of any particular brand/label/kind/category of MicroSD card that is significantly better than others in that regard?

Not sure if chasing some microseconds of better performance will make a difference, but if it is anything like parking with a heavy truck with heavy trailer in a small parking lot with other cars, then I guess a microsecond extra is just as important as an extra centimeter :-)



To give you some idea of what decent SSDs manage:

     http://strugglers.net/~andy/blog/2019/05/29/linux-raid-10-may-not-always-be-the-best-performer-but-i-dont-know-why/


I don't think I can make Teres-I boot from an external SSD.


Cheers,
Andy

Thanks Andy!

//Erik


Reply to: