woensdag 22 juli 2015

Reducing mdadm speed for USB-RAID on RPi2.

Last few days I've had a problem. At certain moments my LAN interface on my RPi2 stopped working, making the RPi2 unreachable from the network.
The LAN interface internally runs on the same USB controller as the USB-ports. To debug my problems I've reduced my throughput to my USB flashdrives to 400kbit/s to offload the USB a bit.

As root/su user I've given the next commands. The first reduces the throughput to around 400kbit/s the second one is to make sure a 10kbit/s throughput is guaranteed.

echo 400 > /proc/sys/dev/raid/speed_limit_max
echo 10 > /proc/sys/dev/raid/speed_limit_min
The result is a reduced throughput as expected. Now hope it will fix my problems.

Update: Problem not solved. Crunching brain to see what to do next. However speed was reduced, so I will keep this blog post online. Partial success.

Update2: Problem solved. 
I run my Pi via an Adafruit Powerboost 500c. While the output power of this device is enough the charge rate isn't. So the LiPo battery slowly drains. The product page already warned me. When the voltage is too low, the Pi dies and does not reboot. After that the battery charges again because of the lower current demand of the Pi that's not running anymore. I've modified my Powerboost 500c to get a charge rate of 600mA (out of spec), and now the setup runs fine for >10 days already. Time to upgrade to a Powerboost 1000c.