JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Expecting Too Much

Wed Mar 30, 2016 3:03 pm

You can also set the up_threshold for the "ondemand" governor, to change the point at which it switches to turbo mode, rather than using "performance" mode or forcing turbo so it runs at full speed all the time.

You can set it to switch to turbo mode at 20% CPU utilization, 50%, 80%, whatever value you like.
To set it so it switches to turbo with only 10% load use this. It will still idle at low speed/lower power, but as soon as you put any significant load on it turbo mode will kick in.

Code: Select all

sudo echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Changing the "sampling_down_factor" will delay the switch back to standard speed from turbo mode. The default value is "1" which amounts to no "down_factor", so it drops back to the slower speed as soon as the load decreases. Increasing the sampling down factor will cause it to stay at turbo a little longer, so it doesn't keep dropping the speed down and then right back up if a process has to wait a few milliseconds for an input, file write, or something.

I usually use a value of "20" for the "sampling_down_factor" which works pretty well. Go up to "40" if you see a need for a little more delay.

Code: Select all

sudo echo 20 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

Those will work as soon as they are applied, but they won't survive a reboot. If you want to make the change permanent you could run a script to echo the values after boot, or what I do is edit "/etc/init.d/raspi-config" and change the value there.

User avatar
Taxicletter
Posts: 218
Joined: Sat Mar 05, 2016 4:25 pm
Location: Antwerp, Belgium
Contact: Website

Re: Expecting Too Much

Wed Mar 30, 2016 3:25 pm

It feels as if everything runs more smoothly now. Not sure if that's because of the overclocking or the force_turbo, but I'll leave everything as it is, as long as it goes well :-).

I have a class 10 16GB card. Starting up from a USB stick is faster?

Thanks for the info, I know a little more now :-).
--::--::- 3 x Raspberry Pi 3 - Raspbian Lite 9 - RuneAudio - one broke (wifi) - not in use -::--::--

pxgator
Posts: 105
Joined: Mon Feb 16, 2015 6:45 pm
Location: Southern Colorado, USA

Re: Expecting Too Much

Wed Mar 30, 2016 6:08 pm

It feels as if everything runs more smoothly now. Not sure if that's because of the overclocking or the force_turbo, but I'll leave everything as it is, as long as it goes well
Same here :D everything is running smoother and faster. Sure hope it stays
that way lol. It's definitely usable as a general purpose desktop now. IMHO the
RPi 3 is another remarkable $35 SBC from the UK. Thank you Eben !!
Last edited by pxgator on Sat Apr 02, 2016 2:08 am, edited 3 times in total.
So what's all this RPi stuff anyhow? Well folks, it's a feat of engineering from
the UK almost as remarkable as the De Havilland Mosquito and the Colossus.

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Expecting Too Much

Wed Mar 30, 2016 7:30 pm

But doesn't work at my Ubuntu-Mate OS
I'm sure it's there somewhere, Ubuntu-Mate probably uses a slightly different directory structure.

"Initial turbo" sets turbo speed until cpufreq takes over, or in your case 40 seconds if the boot should ever take that long to reach the point where it checks for the shift key.

When you see the boot messages scroll by it checks to see if the shift key is held down, and if not it will then say switching to "ondemand" governor. Initial turbo only works up until that point, then the ondemand governor takes over. I've never timed it but probably about 6~8 seconds into the boot it switches to the governor.

User avatar
Flagbit
Posts: 37
Joined: Tue Mar 22, 2016 11:03 pm
Location: Earth, 51.316°N 9.393°E

Re: Expecting Too Much

Wed Mar 30, 2016 7:36 pm

Thank you for the information JimmyN.

Taxicletter wrote: Starting up from a USB stick is faster?
Yes, afaik SD-Card is only up to 21 MB/s, USB2.0 (at least at PI3) up to 40 MB/s.
I have a cheap USB3.0 USB stick with 35 MB/s, 12 MB/s read, write on the PI3.
Here is a how-to (first page last post): viewtopic.php?f=66&t=12015
-- My 2 Cents, Coin Heatsink: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=141441
-- Snappy Pi 3: Coin Heatsink, 1300Mhz Overclocked stable (could void warranty), Ubuntu-Mate on USB-stick

User avatar
Flagbit
Posts: 37
Joined: Tue Mar 22, 2016 11:03 pm
Location: Earth, 51.316°N 9.393°E

Re: Expecting Too Much

Thu Mar 31, 2016 4:00 pm

I chose a different way to start the Ubuntu-Mate OS from USB:
I used the programm Gparted and two SD-cards, one external SD-card reader and one USB-stick.

On one SD-Card I installed Raspian and added gparted

Code: Select all

sudo apt-get install gparted
and on the other I installed Ubuntu-Mate.
The Ubuntu-Mate SD-card I inserted in the external card reader and copied the Ubuntu-Mate partition with Gparted to the USB-Stick.

Maybe it is easier and you need no second computer when using noobs light (do you need then a network cable to connect to the Internet ?) and install the two OS on one SD-card, copying then the unused Ubuntu-Mate with Gparted to the USB-stick.
Lastly I changed root=/dev/mmcbl... into root=/dev/sda1 in cmdline.txt.

Flagbit
-- My 2 Cents, Coin Heatsink: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=141441
-- Snappy Pi 3: Coin Heatsink, 1300Mhz Overclocked stable (could void warranty), Ubuntu-Mate on USB-stick

User avatar
Taxicletter
Posts: 218
Joined: Sat Mar 05, 2016 4:25 pm
Location: Antwerp, Belgium
Contact: Website

Re: Expecting Too Much

Fri Apr 01, 2016 11:23 pm

Flagbit wrote:Thank you for the information JimmyN.

Taxicletter wrote: Starting up from a USB stick is faster?
Yes, afaik SD-Card is only up to 21 MB/s, USB2.0 (at least at PI3) up to 40 MB/s.
I have a cheap USB3.0 USB stick with 35 MB/s, 12 MB/s read, write on the PI3.
Here is a how-to (first page last post): viewtopic.php?f=66&t=12015
OK, but isn't it only faster at the startup? I mean, once your computer is started, most of the OS is in some RAM, so it doesn't matter where it came from in the beginning?
--::--::- 3 x Raspberry Pi 3 - Raspbian Lite 9 - RuneAudio - one broke (wifi) - not in use -::--::--

User avatar
Flagbit
Posts: 37
Joined: Tue Mar 22, 2016 11:03 pm
Location: Earth, 51.316°N 9.393°E

Re: Expecting Too Much

Sat Apr 02, 2016 4:36 pm

I would say the difference while starting programs and switching windows was bigger then with overclocking.

What it loads to cache and when, I don't know.
-- My 2 Cents, Coin Heatsink: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=141441
-- Snappy Pi 3: Coin Heatsink, 1300Mhz Overclocked stable (could void warranty), Ubuntu-Mate on USB-stick

User avatar
Flagbit
Posts: 37
Joined: Tue Mar 22, 2016 11:03 pm
Location: Earth, 51.316°N 9.393°E

Re: Expecting Too Much

Mon Apr 04, 2016 9:45 pm

I did not try the "better" SD cards with higher speed at 4k sized data, but will do soon when I get one of them, to compare USB to "fast" SD.

http://www.jeffgeerling.com/blogs/jeff- ... crosd-card
-- My 2 Cents, Coin Heatsink: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=141441
-- Snappy Pi 3: Coin Heatsink, 1300Mhz Overclocked stable (could void warranty), Ubuntu-Mate on USB-stick

User avatar
Taxicletter
Posts: 218
Joined: Sat Mar 05, 2016 4:25 pm
Location: Antwerp, Belgium
Contact: Website

Re: Expecting Too Much

Tue Apr 05, 2016 10:59 pm

I will try running Ubuntu Mate from an USB stick soon, I will tell you how it went ;-).
--::--::- 3 x Raspberry Pi 3 - Raspbian Lite 9 - RuneAudio - one broke (wifi) - not in use -::--::--

User avatar
Flagbit
Posts: 37
Joined: Tue Mar 22, 2016 11:03 pm
Location: Earth, 51.316°N 9.393°E

Re: Expecting Too Much

Wed Apr 06, 2016 12:00 pm

The "fast" SD-card from the link abbove starts around 3sec quicker then my cheap USB3.0 stick.
It seems the 4k read/write speed (small files) is here more important then the sequentiel read/write speed (big files)

(Pi3 start screen, noobs boot sd, sd-boot/usb-boot ubuntu-mint, desktopscreen: 27s/30s (1200Mhz, turbo enabled) )

Anyway, the fast SD-card is as good or better as my USB3.0 stick. :)
A fast and good USB stick should be the best, but also expensive.

For me the fast SD seems as the best and cheapest solution for snappy pi3 until we can boot without sd-card from usb-stick.

Flagbit

I will try running Ubuntu Mate from an USB stick soon, I will tell you how it went .
Would be good to see other results to compare :)
-- My 2 Cents, Coin Heatsink: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=141441
-- Snappy Pi 3: Coin Heatsink, 1300Mhz Overclocked stable (could void warranty), Ubuntu-Mate on USB-stick

User avatar
Flagbit
Posts: 37
Joined: Tue Mar 22, 2016 11:03 pm
Location: Earth, 51.316°N 9.393°E

Re: Expecting Too Much

Sun Apr 10, 2016 11:57 pm

Even a SSD hardisk in a USB 3.0 external case did not boot much faster then the fast SD-card.
-- My 2 Cents, Coin Heatsink: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=141441
-- Snappy Pi 3: Coin Heatsink, 1300Mhz Overclocked stable (could void warranty), Ubuntu-Mate on USB-stick

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: Expecting Too Much

Mon Apr 11, 2016 2:20 am

OK, but isn't it only faster at the startup? I mean, once your computer is started, most of the OS is in some RAM, so it doesn't matter where it came from in the beginning?
My $12 32GB Samsung Evo+ UHS-1 sdcard @ 100 MHz has Write speed @ 20 MB/s, @ Read speed @ 41 MB/s
DNPNWO

User avatar
Flagbit
Posts: 37
Joined: Tue Mar 22, 2016 11:03 pm
Location: Earth, 51.316°N 9.393°E

Re: Expecting Too Much

Mon Apr 11, 2016 7:02 pm

Yes, this one I have also.
I only was not able to overclock it.

SSD showed me 40/40 read/write speed.
-- My 2 Cents, Coin Heatsink: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=141441
-- Snappy Pi 3: Coin Heatsink, 1300Mhz Overclocked stable (could void warranty), Ubuntu-Mate on USB-stick

User avatar
liudr
Posts: 685
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Expecting Too Much

Mon Apr 11, 2016 9:17 pm

Flagbit wrote:Yes, this one I have also.
I only was not able to overclock it.

SSD showed me 40/40 read/write speed.
Isn't that at or above the theoretical maximum for USB 2.0 (480bps) already? My external hard drive can do 100MB/s write. So I suppose if I use it on my pi, it will be fast enough for the pi. Correct?
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

User avatar
Flagbit
Posts: 37
Joined: Tue Mar 22, 2016 11:03 pm
Location: Earth, 51.316°N 9.393°E

Re: Expecting Too Much

Mon Apr 11, 2016 10:44 pm

Afaik the HDD has a slower respond (iops or ms)

You can compare the maximums of the devices with e.g. CrystalDiskMark at a Windows PC.
Fast SD-Cards have a faster response as a HDD.
-- My 2 Cents, Coin Heatsink: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=141441
-- Snappy Pi 3: Coin Heatsink, 1300Mhz Overclocked stable (could void warranty), Ubuntu-Mate on USB-stick

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: Expecting Too Much

Wed Apr 13, 2016 1:44 am

Flagbit wrote:Yes, this one I have also.
I only was not able to overclock it.

SSD showed me 40/40 read/write speed.
Highly unlikely that you have 40 read/write.

You can check how fast the performance of your sdcard actually is like so:

Code: Select all

#!/bin/bash

DATAMB=${1:-512}
FILENM=~/test.dat
[ -f /flash/config.txt ] && CONFIG=/flash/config.txt || CONFIG=/boot/config.txt

trap "rm -f ${FILENM}" EXIT

[ "$(whoami)" == "root" ] || { echo "Must be run as root!"; exit 1; }

HDCMD="hdparm -t --direct /dev/mmcblk0 | grep Timing"
WRCMD="rm -f ${FILENM} && sync && dd if=/dev/zero of=${FILENM} bs=1M count=${DATAMB} conv=fsync 2>&1 | grep -v records"
RDCMD="echo 3 > /proc/sys/vm/drop_caches && sync && dd if=${FILENM} of=/dev/null bs=1M 2>&1 | grep -v records"
grep OpenELEC /etc/os-release >/dev/null && DDTIME=5 || DDTIME=6

getperfmbs()
{
  local cmd="${1}" fcount="${2}" ftime="${3}" bormb="${4}"
  local result count _time perf

  result="$(eval "${cmd}")"
  count="$(echo "${result}" | awk "{print \$${fcount}}")"
  _time="$(echo "${result}" | awk "{print \$${ftime}}")"
  if [ "${bormb}" == "MB" ]; then
    perf="$(echo "${count}" "${_time}" | awk '{printf("%0.2f", $1/$2)}')"
  else
    perf="$(echo "${count}" "${_time}" | awk '{printf("%0.2f", $1/$2/1024/1024)}')"
  fi
  echo "${perf}"
  echo "${result}" >&2
}

getavgmbs()
{
  echo "${1} ${2} ${3}" | awk '{r=($1 + $2 + $3)/3.0; printf("%0.2f MB/s",r)}'
}

systemctl stop kodi 2>/dev/null
clear
sync

[ -f /sys/kernel/debug/mmc0/ios ] || mount -t debugfs none /sys/kernel/debug

overlay="$(grep -E "^dtoverlay" ${CONFIG} | grep -E "mmc|sdhost")"
clock="$(grep "actual clock" /sys/kernel/debug/mmc0/ios 2>/dev/null | awk '{printf("%0.3f MHz", $3/1000000)}')"
core_now="$(vcgencmd measure_clock core | awk -F= '{print $2/1000000}')"
core_max="$(vcgencmd get_config int | grep core_freq | awk -F= '{print $2}')"
turbo="$(vcgencmd get_config int | grep force_turbo | awk -F= '{print $2}')"
[ -n "${turbo}"    ] || turbo=0
[ ${turbo} -eq 0 ]   && turbo="$(cat /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy)"
[ -n "${core_max}" ] || core_max="${core_now}"

echo "CONFIG: ${overlay}"
echo "CLOCK : ${clock}"
echo "CORE  : ${core_max} MHz, turbo=${turbo}"
echo "DATA  : ${DATAMB} MB, ${FILENM}"
echo

echo "HDPARM:"
echo "======"
HD1="$(getperfmbs "${HDCMD}" 5 8 MB)"
HD2="$(getperfmbs "${HDCMD}" 5 8 MB)"
HD3="$(getperfmbs "${HDCMD}" 5 8 MB)"
HDA="$(getavgmbs "${HD1}" "${HD2}" "${HD3}")"

echo
echo "WRITE:"
echo "====="
WR1="$(getperfmbs "${WRCMD}" 1 ${DDTIME} B)"
WR2="$(getperfmbs "${WRCMD}" 1 ${DDTIME} B)"
WR3="$(getperfmbs "${WRCMD}" 1 ${DDTIME} B)"
WRA="$(getavgmbs "${WR1}" "${WR2}" "${WR3}")"

echo
echo "READ:"
echo "===="
RD1="$(getperfmbs "${RDCMD}" 1 ${DDTIME} B)"
RD2="$(getperfmbs "${RDCMD}" 1 ${DDTIME} B)"
RD3="$(getperfmbs "${RDCMD}" 1 ${DDTIME} B)"
RDA="$(getavgmbs "${RD1}" "${RD2}" "${RD3}")"

echo
echo "RESULT (AVG):"
echo "============"
printf "%-33s   core_freq   turbo   overclock_50    WRITE        READ        HDPARM\n" "Overlay config"
printf "%-33s      %d        %d     %11s   %10s   %10s   %10s\n" "${overlay}" "${core_max}" "${turbo}" "${clock}" "${WRA}" "${RDA}" "${HDA}"
Select All /paste the above code here:
(save 'cntrl' + 'x', then 'y', then 'enter')

Code: Select all

sudo nano sdbench.sh
Then:

Code: Select all

sudo chmod +x sdbench.sh
Then run the benchmark read/write speed test:

Code: Select all

sudo ./sdbench.sh
DNPNWO

User avatar
Taxicletter
Posts: 218
Joined: Sat Mar 05, 2016 4:25 pm
Location: Antwerp, Belgium
Contact: Website

Re: Expecting Too Much

Sun Jul 03, 2016 9:37 pm

I finally had the time to install Ubuntu MATE on an USB-stick. The manual in this thread (first page, bottom) didn't give me enough information, I tried this manual: https://www.youtube.com/watch?v=tSGA-63FniU.

I use a USB 2 stick, because I read somewhere USB 3 wouldn't work (but now I also read someone uses it successfully).

I don't see better performance (even worse). It seems the resizing didn't work (I'm not sure). Is it because it's USB 2? I removed the SD card while running Ubuntu, to be sure I was not still running on the SD card.

(@Flagbit: it is a long time ago, but I told you I'd let you know, to compare results. Bad result here... I put Raspbian on a EVO SD-card, because I read good things about those. Not sure if it makes a difference.)



EDIT: I double checked, the resizing worked. And I changed the cmdline.txt and etc/fstab like described.
--::--::- 3 x Raspberry Pi 3 - Raspbian Lite 9 - RuneAudio - one broke (wifi) - not in use -::--::--

Return to “General discussion”