Crashing influxdb on Raspberry Pi 3+ because insufficient memory

A few days ago I’ve noticed that my influxdb installation wasn’t working properly. The server was crashing constantly.

I’ve checked the logs using

sudo journalctl -u influxdb -b

and found this

May 12 23:12:18 pi3plus influxd[30173]: ts=2019-05-12T21:12:18.440902Z lvl=info msg="Opened file" log_id=0FNU47~W000 engine=tsm1 service=filestore path=/mnt/databases/influxdb/data/_internal/monitor/342/000000020-000000002.tsm id=0 duration=14
May 12 23:12:18 pi3plus influxd[30173]: runtime: out of memory: cannot allocate 2121015296-byte block (16056320 in use)
May 12 23:12:18 pi3plus influxd[30173]: fatal error: out of memory
May 12 23:12:18 pi3plus influxd[30173]: runtime stack:
May 12 23:12:18 pi3plus influxd[30173]: runtime.throw(0xbc70be, 0xd)
May 12 23:12:18 pi3plus influxd[30173]:         /usr/local/go/src/runtime/panic.go:608 +0x5c
May 12 23:12:18 pi3plus influxd[30173]: runtime.largeAlloc(0x7e6c15dd, 0x60101, 0x76f91a20)
May 12 23:12:18 pi3plus influxd[30173]:         /usr/local/go/src/runtime/malloc.go:1021 +0x120
May 12 23:12:18 pi3plus influxd[30173]: runtime.mallocgc.func1()
May 12 23:12:18 pi3plus influxd[30173]:         /usr/local/go/src/runtime/malloc.go:914 +0x38
May 12 23:12:18 pi3plus influxd[30173]: runtime.systemstack(0x1c4e3c0)
May 12 23:12:18 pi3plus influxd[30173]:         /usr/local/go/src/runtime/asm_arm.s:354 +0x84
May 12 23:12:18 pi3plus influxd[30173]: runtime.mstart()
May 12 23:12:18 pi3plus influxd[30173]:         /usr/local/go/src/runtime/proc.go:1229
May 12 23:12:18 pi3plus influxd[30173]: goroutine 27 [running]:
May 12 23:12:18 pi3plus influxd[30173]: runtime.systemstack_switch()
May 12 23:12:18 pi3plus systemd[1]: influxdb.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
May 12 23:12:18 pi3plus systemd[1]: influxdb.service: Unit entered failed state.
May 12 23:12:18 pi3plus systemd[1]: influxdb.service: Failed with result 'exit-code'.

This happened because I’ve recently added statistics from my FritzBox with regards to my DSL line speed. The statistics have a high cadence, which means that many entries are created in influxdb in a short amount of time. Influxdb tries to create an index in RAM for these entries and is overwhelmed by the mass of data.

Therefore, I stopped the service with

sudo systemctl stop influxdb

and followed the suggestion from the upgrade instructions to use the influx_inspect tool.

I’ve executed influx_inspect as sudo and changed the permissions of my DB content folter later on with

chown -R influxdb:influxdb <folder>

This command may take a while to complete, depending on the size of your DB.

Once it is finished you can restart influxdb with

sudo systemctl start influxdb

Your server should now be stable again. The index is now disk based instead of being memory based, which could cause troubles on the limited resources of the Raspberry Pi.

Prepare your Mac for macOS Mojave 10.14

So Apple release the final version of macOS Mojave aka. 10.14. Before you start your update, you should check, if your important tools are 64bit compatible.

This version of macOS will annoy you with warnings about your apps being 32bit each time you start them. While you will still be able to execute 32bit apps in Mojave, I used the opportunity to get rid of a few 32bit apps.

How do you check, which apps are still 32bit? You can verify this from the system information app. Click on your Apple symbol in the menu line and select „About this Mac“. Click on „System Report“. Check now Software/Applications. You can filter the list by „64-bit (Intel)“. Each app marked with „No“ should produce the popup.

In my case I had these apps replaced by either updates or different tools:

  • AudioBookBuilder – version 2.0 will be made public or maybe not  – replaced with AudioBook Binder 
  • Caffeine – no Update and no longer being developed – replaced with KeepingYouAwake
  • iMovie 9 – no Update for this version possible – export all projects and delete, replace with never iMovie version
  • ViMediaManager v0.7α14 – replaced with MediaElch
  • DVD player – will get an update later

Be sure to update all your other 64bit apps as well before you start the update. 

Howto fix Deutsche Telekom slow Mac App Store download speeds

macOS Mojave was released to the public on Monday. As I’m still suffering under terrible problems with macOS High Sierra Updates, I’ve decided to give my Mac a chance and to download Mojave.

macOS Mojave installer start screen

I’ve started the download from the Mac App Store and the download speed was really slow. I’m using a 50MBit VDSL connection provided by the Deutsche Telekom. All other Downloads are fast and saturate the connection at about 5,5MB/s.

Really slow downloads from the App Store. This one should download for 5 and a half hour

The Download from the Mac App Store is terribly slow at around 200kB/s. After searching for problems with Deutsche Telekom and slow App Store speeds, I’ve stumbled over this page.

The solution to my slow download rates seem to be the used DNS server. Even if you use the DNS from Quad9 or the one from Google, you will have slow downloads.

A fast download from the App Store with 5,5MB/s. It finishes in 22 minutes

The recommended IPv4 DNS server are quite fast. I’ve setup a new Network Profile with these DNS server and I have now the full download speed again.

You can switch your network profile afterwards to your local DNS server.

How to clean install Mac OS High Sierra without APFS on internal SSD

Did you ever wonder how you can make a clean install on your Mac with High Sierra without being forced to use APFS? Well, I just reinstalled my mac using this method and want to explain how I acomplished this:

First of all, you’ll need to boot from a Mac OS Version below 10.13 High Sierra. Otherwise you’ll get an error message „Helpertool crashed“. So in my case I booted from a 10.12 Sierra USB stick.

You can now use the Disk Utility of the recovery OS you currently booted from to clean you complete disk. Format the volume HFS+ journaled and choose a simple name without spaces like „internal“ (which I used for my internal SSD). Attach the USB stick which contains the High Sierra installer. You can create this installer following these instructions.

Now exit Disk Utility and open a Terminal. Go to the Volume of your attached High Sierra USB Stick.

cd /Volumes/“Install macOS High Sierra“

Start the installation of High Sierra to the freshly formatted HFS+ volume mounted as „internal“. This clean installation will also create the Recovery HD partition.

„Install macOS High Sierra.app“/Contents/Resources/startOsInstall –agreetolicense –converttoapfs NO –volume /Volumes/internal

More information can be found here. A video of the process and more details are here. If you execute the startOsInstall command with –usage you’ll get a list of available parameters.

 

Installing Mac OS Sierra (10.12) on a MacbookPro 5,5 (Mid 2009)

Mac OS Sierra was released yesterday. However, our good old MacbookPro 5,5 (Mid 2009) isn’t officially supported anymore. Luckily, there are people who figure out what is necessary to patch the official installation so that it can be installed again 😉

I’ve backuped the Macbook and gave the given instructions a try. Instead of reinstalling everything I only updated from El Capitan to Sierra. After the first restart, the Macbook shut down, as it didn’t found a valid boot partition.

So I rebooted again to the patched installation media and ran the proposed „macOS Post Install…“. I’ve selected my type of Macbook and let it patch. Additionally I’ve ran the „Force Cache Rebuild“ command and rebooted.

The Macbook booted to Sierra 🙂 However, the FaceTime camera wasn’t detected and I wasn’t able to get it working again. Since there was a „Legacy USB Support injector“ I think this might cause the problem. The FaceTime camera is connected internally over USB so it seems to have some problems.

I don’t think this is a big problem. You’ll probably get this somehow fixed with a little time and patience. However, since I’m running a real Mac hardware (and no Hackintosh), I don’t want to fiddle around with such basic hardware problems.

Therefore I can only recommend you to leave your Macbook on El Capitan (10.11) as the largest supported OS. Seems that Apple wants to get rid of devices older than 7 years, even if they are still doing great (with a SSD and 8GB RAM).