Raspberry Pi 3 very slow at scanning the libraries

As a followup to my posts in this thread:

And the replies to it, I am opening this thread to try to find what is wrong with my setup.

As mentioned library scans take a very long time (a full update of my movies runs for over a day), and any kind of upgrades are also slow.

Links to my logs:

https://paste.osmc.tv/afuhehojet

As far as I remember I’m not running anything very exotic on the Pi, its basically a standard installation with a few tweaks.

The hardware is a Pi3, with OSMC SD-card, OSMC PSU, and OSMC case.

The Pi is otherwise stable enough and videos play without problems.

Nothing in the logs directly stands out. I suggest to do soem test to figure out what might be the problem.
Let’s start with the SD Card
First install iozone3 (and let’s measure that time already)
time sudo apt-get install iozone3
(that should not take longer than 10 seconds)

After it is installed run
iozone -e -I -a -s 50M -r 4k -r 512k -i 0 -i 1 -i 2 | tail -4 | head -2 | awk '{print "Block Size " $2"k", "Write " $3/1024, "Rewrite " $4/1024, "Read " $5/1024, "Reread " $6/1024, "Random Read " $7/1024, "Random Write "$8/1024}'

That will take a while and then printout two lines (one for 4k and one for 512k) share those.

OK Install of iozone3 (I copied the whole procedure, so you can see download times and so on):

osmc@osmc2:~$ time sudo apt-get install iozone3
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
armv7-libcrossguid-osmc libapt-inst1.5 libavcodec56 libavresample2
libavutil54 libbind9-90 libdbus-1-dev libdns100 libdpkg-perl
libfftw3-single3 libgif4 libgnutls-deb0-28 libhogweed2 libicu52 libisc95
libisccc90 libisccfg90 libjson-c2 liblwres90 libmicrohttpd10
libmysqlclient18 libnettle4 libntdb1 libopenjpeg5 libplist2 libpng12-0
libpsl0 libschroedinger-1.0-0 libssl1.0.0 libvpx1 libwebp5 libwebpdemux1
libwebpmux1 libwebrtc-audio-processing-0 libx264-142 libxtables10 pkg-config
python-dbus-dev
Use ‘sudo apt autoremove’ to remove them.
The following NEW packages will be installed:
iozone3
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 428 kB of archives.
After this operation, 656 kB of additional disk space will be used.
Get:1 http://ftp.debian.org/debian stretch/non-free armhf iozone3 armhf 429-3+b1 [428 kB]
Fetched 428 kB in 0s (1125 kB/s)
Selecting previously unselected package iozone3.
(Reading database … 28851 files and directories currently installed.)
Preparing to unpack …/iozone3_429-3+b1_armhf.deb …
Unpacking iozone3 (429-3+b1) …
Setting up iozone3 (429-3+b1) …

real 0m28.346s
user 0m4.010s
sys 0m0.640s

Measurement of SD-card speed (took a really long while…) :

Block Size 4k
Write 0.0175781 Rewrite 0.0175781
Read 6.86523 Reread 7.33105
Random Read 6.33984 Random Write 0.0175781
Block Size 512k
Write 1.74121 Rewrite 1.7627
Read 18.498 Reread 21.7236
Random Read 21.6299 Random Write 1.75684

Write speeds are seemingly extremely slow, read speeds are not that stellar either. I don’t know what these numbers should be, but they seem very low.

Setting up iozone3 (429-3) ...

real    0m12.571s
user    0m3.380s
sys     0m1.160s
 Block Size 4k 
 Write 0.106445 Rewrite 3.05859 
 Read 8.2373 Reread 8.27637 
 Random Read 6.86816 Random Write 2.4248
 
 Block Size 512k 
 Write 6.14453 Rewrite 6.63477 
 Read 22.1045 Reread 22.25 
 Random Read 22.1729 Random Write 4.24219

Another Pi3 with OSMC-card

Pi3 with SanDisk Ultra 16GB:

osmc@osmc::~$ time iozone -e -I -a -s 50M -r 4k -r 512k -i 0 -i 1 -i 2 | tail -4 | head -2 | awk '{print "Block Size " $2"k", "Write " $3/1024, "Rewrite " $4/1024, "Read " $5/1024, "Reread " $6/1024, "Random Read " $7/1024, "Random Write "$8/1024}'
Block Size 4k Write 6.02734 Rewrite 8.14453 Read 14.9473 Reread 15.0234 Random Read 7.41504 Random Write 0.649414
Block Size 512k Write 14.8711 Rewrite 17.9922 Read 28.415 Reread 28.3945 Random Read 27.708 Random Write 0.44043

real	3m50.266s
user	0m0.500s
sys	0m3.990s

You SD card looks to be very slow.

SanDisk figures are OK except for dismal random writes.

It does seem there must be something wrong with my card.

I will try to contact @sam_nazarko to see what can be done.

Perhaps some settings can be changed.

I was trying to make certain I got a good card by bying one in the OSMC shop, but it seems I got a defective one.
I was wondering why all people kept saying that the pi runs better on SD-cards, my experience has been much better with USB installs… :slight_smile:

You can return it to us and we will replace it with a new card.
How long have you had the card? It’s possible it was always defective to begin with and you never noticed this until recently.

Sam

I ordered it on september the first this year, order no. 8737.

If I have to return it, I would have to be without my media center for several days. My family would kill me :slight_smile:

Is there a way to clone the install to another card, to keep the pi running while waiting for the replacement?

A windows program or something of that sort?

Yes – this can be done using something like Win32DiskImager. Best to use the same sized card.

I’ll try that, when I find a 16Gb replacement.

You’ll hear from me when I’m ready to send the card back.

Something definitely is wrong, but maybe not to blame the card directly. So let’s try the backup to the other card first as your values are so much of the chart and then decide

Fantastic…

Found a 16Gb microsd card, made an image from the OSMC card and tried to write it. But the replacement card is smaller by a few sectors, and then it wont work…

Why do these things have to be so annoying :slight_smile:

Well having the SD card out of the Pi and installed again seems to have helped.

I ran a quick (5Mb) test:

Block Size 4k
Write 1.78613 Rewrite 3.23926
Read 7.76074 Reread 7.70215
Random Read 7.89844 Random Write 1.73633
Block Size 512k
Write 17.3662 Rewrite 16.373
Read 21.333 Reread 21.9473
Random Read 21.9482 Random Write 17.0342

Much better numbers.

Will run the full 50Mb test now.

The results from the 50Mb test is in (that was fast).

Block Size 4k
Write 2.63574 Rewrite 2.75879
Read 6.95117 Reread 7.08789
Random Read 5.7627 Random Write 2.74121
Block Size 512k
Write 9.79004 Rewrite 3.9209
Read 21.8379 Reread 21.9082
Random Read 22.0381 Random Write 2.43457

Many many times faster than my first measurements.

Nothing has changed, but there must have been a bad connection or something. Amazing that it even worked before…

I’m surprised also. I’d think it either would work, or not work. I’d not expect it to sorta work.

I have been experimenting some more.

After doing a reboot of the Pi from the menu (without removing power), speeds were slow again.

A shutdown, disconnect / reconnect power, and the speed is back to normal.

Have I found a bug, or is my Pi defective?

This is certainly a bit odd.

If you run shutdown -h now via SSH and boot it up, are things OK?

Sam

How would that differ from shutting down from the menu?

As far as I know the only way to boot up the Pi (after a shutdown) is by power cycling it?

Hi KarVi,

my personal suggestion is to first figure out whether the entire SD-card is error free and works as expected:

  1. Make an image backup of the sd-card with a Windows PC and Win32DiskImager
  2. Follow the two steps in PI 3 b osmc boot error - #9 by JimKnopf post 9; report here the average write and read speed after the test. I know it sounds very time-consuming but while the h2testw writes to the card watch for the write speed whether there are hard speed drops
  3. if the card is entirely error-free and shows normal average speed behavior, restore the image backup

With that we should have understood for sure whether the card is (part of) the problem or not.
Keep my fingers crossed for you that it is only a malfunctioning card.