In this case study we will look the carbon benefit of a static site.
Site generators like HUGO are currently all the hype. The idea is to write your website in simple markdown but still benefit from nice styling and templating.
The result will be a one-time generated page which saves server compute resources, is faster to deliver and, hopefully, also save carbon emissions.
We will create a simple Wordpress site and then port the design and posts to HUGO. We will measure the carbon emissions of Wordpress for parsing the page with the database and PHP, and we will also measure the cost of HUGO generating the static HTML page.
We will then look at the savings of HUGO and the potential tipping point if you build your page too often, where HUGO might be less optimal than Wordpress.
Also we will talk about hosting, as we will see that just moving your site to Wordpress without using a webhosting that can actually turn OFF the server you will have a close to zero impact in carbon emissions.
Cost of building around 1-6 Joules -> Link
Cost of RAM and disk not looked at. RAM however more than one order of magnitude lower in internal tests
We will try then the absolute most minimal setups to make the comparison as fair as possible.
CURL vs. Firefox
Exclude functionality for containers in measurement!
All the software we are talking here about and are basing our calculations on you can run yourself and falsify.
The chart on the right side shows the relation of the HUGO build process (~1.4 J), the HUGO energy per web request (~1 J) and the energy for a web request o Wordpress (~10 J)
Since we have repeated the measurements 3 times we attached the error bars, which represent the 95% confidence interval.
The measurements are already an order of magnitude off, which is kind of what we assumed from the start. A static site is enormously more efficient, even if you also include the build process. Even for this simple setup it is around 10x.
Note: If you want to drill down on the details of the measurement like: How long was the pre-heat time of the CPU, how long was the pre-idle time, which CPU was used, what was the measurement resolution etc. please check the details on the links in the box above.
When optimizing for low carbon and low energy hosting is a very important topic.
If you were just to replace the Wordpress site with a static site but the server will continue to run in idle it might be that your total energy savings are very minimal.
If you look at the simplified load to energy curve from Microsoft you can see that just by having the machine in idle you are already using a significant portion of energy.
These curves are, as said, simplified and a real curve might look better or worse. Very good and industry used measurements are the curves from the SPECpower team.
Typically a server runs at least at 10-15% load when it is fully hypervised and this means that when you are one client on the server you are typially in the flat part of the curve.
An optimization for pure compute has the lowest effect here.
Also you have to take into account that a typical webserver that only serves webpages is mostly idle. Therefore typically the idle power draw is your major concern, and not so much the minimal load that your website puts onto the server.
If you have a typical web application (say a website) that has typically long patterns of idle time / time between requests, than you should go for a hosting solution that can dynamically scale to zero.
Cloudflare for instance provides such a feature with their Cloudflare Pages product that also supports HUGO out of the box.
We have looked at some rough metrics on the energy usage of Wordpress and HUGO in comparison and also looked at the potential minimal gain if you just have your website moved to a static version but do not adress the idle power draw issue.
If your website with wordpress however maxes out your CPU to > 80% the solution to go to Cloudflare Pages might not be the best scenario anymore.
Our goal of this case study was to educate developers in what order of magnitude the energy budgets of idle power draw and compute power draw for a typical server are.
Also how the energy compares between the request to a static site and a Wordpress site.
You see that the exact path for optimizing your energy consumption for hosting depends on your load, but is always better when we look at static sites.
Further considerations might however include meta-criteria like the cost of development and maintenance, which will typically incur carbon or energy costs in the phyisical world.
If you want your specific architecture analysed or get a more detailed understanding for the optimization potential in your architecture shoot us an email at [email protected]