Sunny Garden Hub

The Sunny Gardener - April 2024

Mastodon Creates US Non-Profit

The Mastodon project announced this month that they had established a non-profit in the USA.

There was some initial furore over the move, particularly around the inclusion of, for example, Biz Stone, co-founder of Twitter on the board of the new non-profit. The announcement has since added an FAQ section at the end clarifying several points, in short:

The core development team is still the same 2-3 developers, and nothing has been moved or sold to anyone in the US.

Media Storage Outage

On April 28th our hosting provider OVH experienced an outage of their object storage system which sunny.garden uses to store media files. Existing posts and media were still available, but new images/video could not be posted or received during that time.

Fortunately the outage only lasted an hour or so before OVH was able to resolve it and things returned to normal.

Database Clean-up

sunny.garden’s database is currently growing at a rate of about 200MB per day, or 1.5GB/week. And the server also hosts the media cache, and a separate ElasticSearch database that provides search results.

At about this same time last year I upgraded the disk storage on sunny.garden from 80GB to 160GB, and at near 85% disk usage it was getting to the point where another upgrade was needed.

Of course a larger disk means larger hosting cost, so before going down that route, I wanted to look into how much effect a database cleanup would have. This took two parts…

Step one was deleting old cached posts from remote servers that have no stars, boosts, bookmarks or replies, and are from accounts nobody is following anymore… basically things we can be pretty sure nobody is going to miss. This can be done while the server is online, so I ran this process and it helpfully recovered about 20GB of space.

Step two was vacuuming or compacting the database. When data is deleted from the database, that space is not immediately freed up on the disk, but is instead marked as empty space for possible later re-use. The problem with this is the free space can become fragmented such that it never actually gets re-used and simply takes up space… similar to how defragging your hard-drive used to be a routine part of PC maintenance.

Compacting the database requires taking the server offline, which I did yesterday for about half an hour. Altogether this regained about 40GB of disk space in total.

Disk space usage chart for the past two days. Starting around 85% there is a short spike up to 98% before dropping down to 70% on the first day, then another spike up to 98% before dropping down to 60% on the second day.

Something I didn’t appropriately account for is the amount of extra space that the compacting process uses, basically making a new copy of a large part of the database before deleting the old copy, meaning that unfortunately in order to free up space, you already need to have a lot of free space. You can tell from the graph above that both cleanup steps barely squeaked by, hitting almost 99% disk usage.

Luckily it worked out this time, but I’ll need to be more careful in planning cleanups in the future. For now, it looks like we’ve bought another 6 months or so before having to reconsider upgrading the disk again.

Summary

A typical month activity wise, with the number of reports staying low as usual.

53 new users, 509 active users, 55k interactions, 8 reports opened, 8 reports resolved

Hosting Costs

With a successful database cleanup performed, hardware upgrades (and associated cost increases) have been staved off once again!

Cost spreadsheet, text follows.

Expand Hosting Costs
sunny.garden 2024-05-01
Main Server 8-16GB-160GB -$69
Media Storage 332GB/mo. -$12
Media Bandwidth Free $0
Backups 107GB/mo. -$17
Domain Name $35/yr -$3
Email Server -$5
Donations One-Time $20
Donations Recurring $53
Monthly Totals
Previous Balance $152
Total Expenses -$106
Total Donations $73
Balance $119

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