Sunny Garden Hub

The Sunny Gardener - July 2024

TL;DR This month’s post is pretty techy, so if you don’t want to read all that:

Adding a Secondary Server

Around mid-month I noticed that system load on the server had increased to a point where it made sense to look into another possible upgrade.

CPU Busy 73%, Sys Load (5m avg) 127%, Sys Load (15m avg) 105%, RAM Used 69%. A CPU usage graph over one day showing an increase in CPU usage and stolen CPU time over the past 12 hours.

A one-day chart of server system load. The yellow and green areas are the CPU in use by the server, the purple at the top is CPU time that we couldn’t use because it was being used by other servers hosted on the same hardware. The blue area in the middle is the remaining free CPU.

The previous server upgrade was about six months ago, and while the local active user count is about the same, the server activity level has increased, likely due to a combination of gaining some more active users as well as overall increase in fediverse activity and connections between local and remote users.

There is some relief on the horizon, as the upcoming Mastodon v4.3 release is expected to bring optimizations in image processing, which should reduce CPU load on the server, based on what I’ve seen reported by other admins running nightly builds.

Since I don’t know when that release will be arriving, I still wanted to take some of the pressure off short term.

Main Server

Without going into too much detail “a Mastodon server” is actually a collection of multiple programs, which can run all on one computer, but they can also be separated out onto multiple computers so that each component has dedicated hardware to run on.

Those components are:

Currently, the majority of the system load on sunny.garden is a combination of the web server and sidekiq workers.

Last 6 month line graph showing sidekiq jobs processed per day, typically 1M to 1.2M per day. During July, the graph trends upward slightly, reaching 1.2M to 1.5M per day.

A 6 month graph of sidekiq jobs processed per day. Every action performed by a server, such as sending, liking, or boosting a post, may create multiple sidekiq jobs to actually carry out the work (often one job per recipient). There has been a 20-30% increase since the end of June.

New Worker Server

Since the sidekiq workers are one of the least disruptive components to separate out, that’s what I’ve moved onto a new secondary worker server.

The new worker server has only 2 CPU cores and 2 GB of RAM, compared to the 8 cores and 16 GB of the main server, but they are dedicated entirely to running sidekiq and not shared with the other components. This has made a considerable improvement to the system load on the main server, which is running comfortably once again.

CPU Busy 19%, Sys Load (5m avg) 25%, Sys Load (15m avg) 22%, RAM Used 50%. 7 day CPU usage graph, the first few days cycle up and down between 20-50%, but the most recent 3 days only reach between 10-20%. There are occasional spikes in the graph marking where cleanup or backup operations took place.

7 day chart of main server CPU load, from before the worker server was added. CPU use reduced by about half after the worker was added.

CPU Busy 22%, Sys Load (5m avg) 24%, Sys Load (15m avg) 23%, RAM Used 69%. 7 day CPU usage graph, but the data only starts about 4 days ago, and begins cycling between 20-50% each day. This graph is smoother and lacking any notable spikes.

7 day chart of the new worker server CPU load.

Now that the separation has been set up, it’s possible to easily add or remove sidekiq resources without any interruption to the main server at all.

I’ll go into the costs for this down below.

Summary

Active users up somewhat, and overall activity noticeably higher this month.

55 new users, 512 active users, 66k interactions, 9 reports opened, 9 reports resolved

Hosting Costs

I do my best to keep the cost of running the server down, not so low that things will bog down on a busy day, but not so high that there are wasted resources. I don’t want to pay for – or ask users to donate towards – server power that is not being put to good use.

It’s one server, Michael. What could it cost?

The additional cost of the new worker server is $7 per month, but conveniently after this month, this should be offset by a $7 reduction in the cost of running backups. This is because I was previously using a secondary backup server just to run backups, but the new worker server can do that job as well, with minimal effort.

The new worker server is one of a line of new offerings from our hosting provider OVH which provide twice as many CPU cores for similar or lower prices than were available before.

Cost spreadsheet, text follows.

Expand Hosting Costs
sunny.garden 2024-08-01
Main Server 8-16GB-160GB -$69
Worker Server 2-2GB-40GB -$7
Media Storage 342 GB -$13
Media Bandwidth Free $0
Backups 557 GB -$18
Domain Name $35/yr -$3
Email Server -$5
Donations One-Time $70
Donations Recurring $68
Monthly Totals
Previous Balance $73
Total Expenses -$114
Total Donations $138
Balance $97

Canadian Dollars

As always, thank you to everyone that has donated on ko-fi! There’s no obligation or expectation that you donate in order to use the server, and I’m still able to cover any shortfall myself if needed.

– Brook