cover of episode Hosting Hachyderm

Hosting Hachyderm

2024/11/15
logo of podcast Ship It! Cloud, SRE, Platform Engineering

Ship It! Cloud, SRE, Platform Engineering

People
A
Adam Jacob
A
Avthar Suwathan
D
Dave Rosenthal
J
Justin Garrison
P
Preston Doster
Topics
Preston Doster: Hachyderm 的架构经历了从单服务器到多服务器的演变,以应对用户数量的快速增长。其基础设施架构自下而上,由数据库(Postgres)、连接池(PG Bouncer)、缓存(Redis)、任务队列(Sidekiq)等组成。为了提高性能和可靠性,Hachyderm 采用了多云策略,并使用 CDN 来缓存媒体文件。Hachyderm 的运营成本主要用于媒体存储和 CDN 服务。Hachyderm 的管理团队由核心成员和志愿者组成,团队规模相对较小,部署方式相对简单,目前主要依靠手动操作,而不是 Kubernetes 等复杂技术。Hachyderm 使用 Uptime Robot 和 Discord 来监控服务状态并进行告警,并提供公共 Grafana 仪表板用于监控关键指标。Sidekiq 是 Hachyderm 未来可能面临瓶颈的组件之一,需要考虑进一步优化和扩展。Hachyderm 进行每周一次的完整备份和每日一次的增量备份,以确保数据安全。选择在德国托管 Hachyderm 是为了遵守 GDPR 法规,并获得更强的法律保护,避免因内容问题而面临政府审查或处罚。Hachyderm 需要考虑如何平衡存储成本和用户体验,例如对历史数据的存档策略。 Justin Garrison: Hachyderm 以其公开的数据和对基础设施运行方式的透明度而闻名。对 Hachyderm 的架构和运营模式表示赞赏。 Autumn Nash: 对 Hachyderm 的发展历程和运营模式表示赞赏,特别是 Chris Nova 在早期运营中的贡献。 Dave Rosenthal: Sentry 的指标系统与追踪系统相连接,以便在深入挖掘实际问题时获得丰富的调试上下文。 Adam Jacob: System Initiative 是一款 DevOps 自动化工具,使用可视化架构图来简化基础设施管理。 Avthar Suwathan: Timescale 构建云端和开源工具,帮助开发者更好地使用 Postgres 进行时间序列分析和 AI 应用开发。

Deep Dive

Key Insights

Why did Hackaderm move from a single server in Chris's basement to a more complex infrastructure?

The initial server, Alice, couldn't handle the rapid growth from 500 users to 36,000 during the Twitter exodus. The move was necessary to scale properly and avoid legal issues with the ISP.

What are the key components of Hackaderm's infrastructure?

The core components include a Postgres database on a Hetzner metal server, PG Bouncer for connection pooling, Redis for caching, Sidekiq for handling background jobs, and Puma for the web application. Media storage is handled by DigitalOcean Spaces, and a CDN is used for caching media files.

How does Hackaderm handle federation and scaling challenges?

Federation is managed through Sidekiq, which processes incoming and outgoing events across the Fediverse. Scaling challenges are primarily focused on Sidekiq queues, which can get backed up during high activity periods. The team is also working on redundancy for the Postgres database and web server.

What is the cost breakdown for running Hackaderm?

Hackaderm costs around $1,000 per month, with the majority of the expenses going toward media storage. DigitalOcean provides the storage at a discounted rate, but the CDN costs are significant.

How does Hackaderm fund its operations?

Hackaderm is part of the Nivenly Foundation, which receives donations and sponsorships. Contributions from individuals and organizations support the server's infrastructure and operations.

What are the main scaling challenges for Hackaderm?

The primary scaling challenges are related to Sidekiq, which handles federation tasks. The team is exploring auto-scaling options for Sidekiq queues to handle spikes in activity. The database also requires redundancy to ensure failover capabilities.

How does Hackaderm handle moderation and content filtering?

Hackaderm allows individual account blocks and server-wide defederation. The moderation team is critical for maintaining a healthy community. The server also subscribes to defederation lists to block problematic content from other servers.

What are the long-term risks for Hackaderm?

The main long-term risks include the rising cost of media storage and potential changes in legal jurisdictions. The team is also concerned about the sustainability of infinite storage and the impact on user experience.

How does Hackaderm handle backups and disaster recovery?

Hackaderm performs weekly full backups and daily incremental backups, retaining data for 21 days. The backups are stored in a way that allows for quick recovery in case of a disaster.

What is the current user base of Hackaderm?

Hackaderm has approximately 55,000 accounts, with around 11,000 monthly active users. The server has seen steady growth since its inception.

Chapters
This chapter sets the stage by introducing the topic of running a large Mastodon server and the challenges involved. It highlights the decentralized nature of Mastodon and its scaling capabilities. The discussion also touches upon the history of web rings as a precursor to modern recommendation engines.
  • Introduction to running a large Mastodon server
  • Decentralized nature of Mastodon
  • Scaling capabilities of Mastodon
  • History of web rings

Shownotes Transcript

Preston Doster joins the show to tell us what it takes to run a Mastodon server with 55,000 accounts and 11,000 monthly active users.

Join the discussion)

Changelog++) members save 10 minutes on this episode because they made the ads disappear. Join today!

Sponsors:

  • Sentry) – Code breaks, fix it faster. Use the code CHANGELOG when you sign up to get $100 off the team plan. Don’t just observe. Take action. Sentry is the only app monitoring platform built for developers that gets to the root cause for every issue. 100,000+ growing teams use sentry to find problems fast.

  • System Initiative) – The future of DevOps automation (is here!) — System Initiative is an intuitive, powerful, collaborative replacement for Infrastructure as Code (IaC). The free tier is awesome (no credit card required) and you can get started) in 3 clicks.

  • Timescale) – Purpose-built performance for AI Build RAG, search, and AI agents on the cloud and with PostgreSQL and purpose-built extensions for AI: pgvector, pgvectorscale, and pgai.

Featuring:

Show Notes:

Interview

One correction about the cost to run Hachyderm. Preston said it’s about $600/mo and after the interview emailed me to let me know it’s closer to $1000/mo

Something missing or broken? PRs welcome!)