Some time ago I’ve been told that the Disroot community observes high database resource usage. Some users start using NextCloud News aplication, subscribe to a number of feeds delivering high volumes of news, then stop reading the news. Over time, the amount of unread news floods the database and unfortunately NC News doesn’t provide mechanisms to purge unread items.
I’ve started investigating this issue. Here, I’d like to discuss how great FreeBSD operating system is for all sorts of development and what advanced features it provides for developers.
Last yeas I’ve upgraded my personal workstation from FreeBSD 12.0 to 12.1 and used this opportunity to change a number of design decisions when installing the system back in 2014. Among other things, I’ve decided to switch from UFS, FreeBSD’s default file system, to ZFS, ported from Solaris.
ZFS combines features usually found in separate tools: file systems, volume managers and more, making it a very powerful system administration tool. It introduces the concept of dataset, which is a named part of the available storage (see Terminology and storage structure). I’ve separated several such datasets on my system so far and yesterday I’ve created another one, to put my projects on it.
The main benefit from using ZFS in my case was that I can easily create backups of the dataset used for my important data, while project data doesn’t really need any backups. And if that project was important, I could adjust its backup policy without much trouble.
Another advanced feature of FreeBSD are jails, a sort of a lightweight virtualization. Jails can be used to run one or more FreeBSD guest systems separated from the host environment on which they run. It is convenient to maintain a test environment separate from the main system, due to the ability to experiment with system’s configuration.
By default, my jails aren’t started at boot time — I’ve decided to run them on demand only, which helps me save resources and power when I don’t work on that project.
Since I’m using pf as
firewall, I
only needed to allow network connectivity for the loopback interface
lo1
created for jails to enable host–guest communication, and set
up a bridge
interface
to let the jail communicate with the world.
FreeBSD’s advanced features can be used to completely avoid using Docker and the complexity behind it, while still having some of its benefits (easy management and automation). This is why I enjoy using FreeBSD so much: because of this well-thought design, simplicity, ease of use and availability of high-quality documentation.
bridge
interface.This work by Piotr Mieszkowski is licensed under CC-BY-SA 4.0