The thing about getting better is that it is an incremental process, you don't often see the monumental changes that occur over months or years. One way of noticing it is to take a snapshot of where you are, so later on you can go back read it and notice clearly the changes that has happened.

Today I'm writing down the structure of my homelab, and the websites I run for personal reasons. Later on they will be my point of reference.

DNS

All sites are registered with Unoeuro, they're a cheap yet solid service. They don't have a lot of bells and whistles, but the few they have are all that I need and those work well.

Each site has a A-record for www.DOMAIN and DOMAIN which points to a DigitalOcean elastic thing. This works a lot like Elastic IP. Except Free and simpler to use. So basically all traffic that gets routed to this IP address gets quickly routed further along to the VPN that hosts my site. DigitalOcean has a requirement, that the loadbalancer must be in the same region as the VPN. In practice this should mean that the IP of the loadbalancer leads to a physical device that is in the same datacenter as my VPN. With that in mind, the performence loss of going through the loadbalancer is presumably negliglbe. Although I have no concrete numbers at the moment.

In addition to the A-Records for the domain, there are a few special cases on some domains. My blog here for instance was originally on a subdomain, so that still needs a record.

Servers

From the DigitalOcean loadbalancer, all the traffic is directed to my loadbalancer. Here traffic is directed out. I've split the handling of traffic into two sections. One is static sites and the other is dynamic site.

Static sites

The goal is for static sites to be served by a raspberry pi cluster. At the moment, this has not been configured. I have a single raspberry pi zero in my house, which traffic to the router on port 80 is forwarded to. In the future, I hope to have a raspberry pi loadbalancer here as well which will redirect traffic to a number of pi's in my house.

Dynamic sites

Sites that require database, caching or similar non-static services are hosted by this group. This is currently hosted by a 2 GB Memory / 40 GB Disk droplet, which serves both the websites and the secondary services. Ideally I would like to have a secondary server hosting at least the database. However, I cannot justify that expense at the moment given the traffic my sites currently receive.

The loadbalancer is configured so that if the raspberry pi's are unavailable, it will default to the dynamic sites. This is neat as it means I don't have to worry too much about reliability at home.

Configuration

All non-legacy servers are configured automatically using Ansible. The provisioning process itself is still manual, but once they are up and running the ansible script takes care of the rest. It configures loadbalancers, webservers and secondary services.

There are some outstanding configuration issues with the pis. Mainly the pi-specific aspects of configuring to connect to the wifi, disabling the raspberrian accounts and similar setup.

Static Files

I'm currently running two ways of handling static files. Either directly on the server with nginx or on Amazon S3. Additionally I'm using the excellent compressor library to compress the static files, so that users will only be served a single js and a single css file for all my local content.

Legacy

I have a single legacy server, reddit-nuker, which has been running for 4 years at the moment. It was where I first played around with servers and is not automatically configured. It servers 2 sites that I've not yet migrated. This blog and Helles testing site.