Up to Main Index Up to Journal for July, 2018 JOURNAL FOR MONDAY 16TH JULY, 2018 ______________________________________________________________________________ SUBJECT: Benefits of thinking small DATE: Mon 16 Jul 20:52:53 BST 2018 Some eagle-eyed users noticed that I cross-compiled the recent v0.0.10 release of WolfMUD on one of my Raspberry Pi — specifically I used a Raspberry Pi 3 :) I find it encouraging that there is so much interest in what I do with a Pi. I know some people want me to stick to just WolfMUD stuff, other people like the little diversions now and again. This is going to be one of those diversions. Guess you can’t annoy all the people all the time :) Before I go off on my diversion, I have been working on WolfMUD stuff as well. I’ve been giving this site some much needed attention. Broken and/or dead links have been fixed, replaced or dropped. Versions v0.0.1 to v0.0.5 of WolfMUD in the downloads section have moved into the attic. I’ve also started looking over the main, non-journal pages of the site and started refreshing or updating them as required. This is a work in progress that will take a while to complete. For the time being[1] all of my WolfMUD development, and writing for this journal, have moved mainly to a Pi 3, sometimes a Pi Zero W. If you haven’t tried a Pi Zero W yet, for £10/$10 they are amazing little computers. I use the Pi 3 the most, the Zero for when I want to be ultra mobile. The several other Pi (model B) I reserve for experiments. The Pi 3, and even the Pi Zero, handle writing, editing, compiling and other tasks just fine. I wouldn’t want to use a Pi Zero as my only machine, compared to the desktop or the Pi 3, the Pi Zero is a tad sluggish. However, it is still very usable and after a while I don’t really notice the lack of performance much. In fact the Pi Zero will happily[2] run WolfMUD with 500+ players — connecting from another machine, over WiFi — with 500+ players the CPU gets up to 56°C in a minimally vented case[3]. The Pi 3 is faster, and I tend to use it more than the Pi Zero. Could I see a Pi 3 as a main machine? Possibly. Can I see myself using a Pi Zero to put my own WolfMUD server online again, so that people can ‘try before they buy’? Yup, and I have another Pi Zero W standing by :) Moving WolfMUD development from a desktop PC to the Pi 3 and Pi Zero was straight forward. I did need to recompile my utilities written in Go, being careful to use Arm7 on the Pi 3 and Arm5 on the Pi Zero. I also needed to pay more attention to I/O and the SD Card in the Pi. The ‘/tmp’ folder is on a tmpfs mount, and swap is using zram. I also set the new Go compile cache to use ‘/tmp’ via GOCACHE[4]. I’ve had to cast a critical eye over some of my scripts. For example, I have a script to ‘build’ this static website from plain text files. I’m not saying it’s a good script, but it does the job I need it to do. However, the script was blindly running gzip and compressing all of the HTML, CSS and font files regardless of whether they had changed or not. Bas news for the longevity of the SD Card. A quick update fixed that, and made it run faster. Sometimes I’ll be working on a new journal entry and want to review the page in an actual web browser. It now takes 1 second on the Pi 3 to refresh the static site with any changes. A forced rebuild of the whole site takes 6 seconds, but then I only have 435 pages :P The Pi Zero? 4 seconds for a refresh and 30 seconds for the whole site. The desktop also benefits from the update of course. It now takes ½ second for a minor change and 1½ seconds to regenerate the whole site. I could make things faster still. The site generator always regenerates all of the index pages as it does not track which pages under the index have changed. This is a simple trade of losing some performance for simplicity of design and implementation. Maybe I should revisit that now? The way I look at all this is: If WolfMUD runs and performs on a tiny, resource constrained, Pi Zero then it’ll do just fine on your average desktop… -- Diddymus [1] The reasons as to why I’ve moved development to the Raspberry Pi are long enough for their own journal entry. For now accept “because I can, there are benefits to thinking small and most importantly — it’s fun!”. [2] Happily, as in no special tweaking of network settings or anything. [3] In the current hot weather the Pi Zero idles at 40°C in a room at 29°C. [4] This does mean the cache is blown away after a reboot. Up to Main Index Up to Journal for July, 2018