Rebuilding a solar powered website
In June 2023, we released a new version of solar.lowtechmagazine.com. After five years of running it on Pelican we started to realize the limitations of that platform and rebuilt the entire website in Hugo. In the release announcement, we go into more detail as to why and what has changed with the new design.
In this post, I want to highlight a comparison between we did for generating the two sites, but that only appears in the footnotes of the release announcement:
To understand the difference, we ran both the Hugo and the Pelican site generators in an experiment. The Pelican build is based on the solar theme and plugins. The Hugo build is based on the solar_v2 theme and dithering and file size calculation scripts as defined in the build script. Both sites have 447 articles across various languages and more than 1500 images. The results of the experiment are visible in the table below. The first two rows show how long it takes to build the site on first run. During the first run, all assets need to be generated and images need to be compressed, which takes longer than subsequent runs where the assets are cached. The last two rows show generation times when assets are already cached. The times displayed are the average time of three runs on both the solar server (an A20 processor with two 1 GHz cores and 1 GB of RAM) and a modern laptop (an Intel i7-8650U Processor with four cores at 1.9 GHz and 32 GB of RAM). Generating the Hugo site on the solar server without cached assets is not possible to do in one go because the process either runs out of memory or exceeds the timeout limit of Hugo. In that case, the command has to be run several times in a row. While it seems as if Hugo is slower than Pelican on the laptop, that is likely explained by the Hugo site running both a dithering logic and another compression logic for the images. In Pelican, images are only dithered and originals not recompressed.
Hugo | Pelican | |
---|---|---|
Solar Server (first run) | - | 100 minutes, 47 seconds |
Modern Laptop (first run) | 13 minutes, 31 seconds | 12 minutes, 53 seconds |
Solar Server (cached) | 11 minutes, 57 seconds | 68 minutes, 47 seconds |
Modern Laptop (cached) | 46 seconds | 04 minutes, 57 seconds |
The solar server uses 2.6 Watts when it is building a site (full performance). It takes 2.99Wh (68 mins at 2.6W) to build the Pelican site. The new site only takes 20% of the CPU time and therefore energy compared to the old site: 0.51Wh.
We published the Hugo theme solar_v2 online.