How will lemmy scale?

I already get rate-limited like crazy on lemmy and there are only like 60,000 users on my instance. Is each instance really just one server or are there multiple containers running across several hosts? I’m concerned that federation will mean an inconsistent user experience. Some instances many be beefy, others will be under resourced… so the average person might think Lemmy overall is slow or error-prone.

Reddit has millions of users. How the hell is this going to scale? Does anyone have any information about Lemmy’s DB and architecture?

I found this post about Reddit’s DB from 2012. Not sure if Lemmy has a similar approach to ensure speed and reliability as the user base and traffic grows.

https://kevin.burke.dev/kevin/reddits-database-has-two-tables/

SlovenianSocket,
@SlovenianSocket@lemmy.ca avatar

As far as I’m aware lemmy does not support load balancing or high availability as it currently stands. But development is still in its infancy and I’m sure that’s a top priority

agressivelyPassive,

It's not only about scaling a single instance, but scaling the fediverse.

Currently, each instance sends all events to all federated instances. That means, essentially each instance needs to store and process a significant part of the entire fediverse. That's insane and has to be addressed.

ollie,

I don’t think it officially supports it but it does work! Lemmy.world is currently running on multiple containers load balanced by nginx. look at u/ruud latest post about it

Iron_Lynx,

My expectation, or at least hope, is that Lemmy will grow horizontally, i.e. more instances for more specialised content, instead of vertically, i.e. more communities in singular, larger instances. Since it’s all federated, you can get to stuff in other instances.

I just had an idea. Let’s compare reddit and lemmy as land use metaphors.

Reddit is like one monolithic megacity. It’s full of communites, some big, encompassing entire neighbourhoods, and others smaller, having one street, one block, maybe even just one building.

Lemmy is like a country, with every instance a city. Some cities are big and varied, others are smaller and specialised, like ones dedicated entirely to fishing or aviation or being German. And you can choose a city to settle in and move between cities for your content. Some cities will be more open to sharing content with residents of other cities, and others will put up bigger restrictions. There are jokes about parts of the userbase on 4chan or Tumblr forming their own subcommunities, and the fediverse allows this in a very material way.

My expectation is that more cities may emerge as people develop more specialised communities. And since there are many cities, there is some resilience in the system. If an instance goes down, you’ve lost one instance. Out of christ knows how many. Chances are some of its content is duplicated across other instances, so nothing of value is lost. Meanwhile, if (/when) Reddit goes down, all of Reddit is gone.

In short, I hope lemmy develops more, smaller, specialised instances over time. Reddit allowed very niche insterests to have a corner, and despite that, I think the fediverse is more suited to allow for that than a centralised service.

webghost0101,

The way i see it the best way forward would be each community runs there own instance and what we now call communities should become subtopics of that community.

So for example. Asklemmy could be an instance and its members are all people who believe in the value of that instance and want to be involved in sustaining it.

Explainlikeiam5 could be a subcommunities of this instance because its philosophy is largely the same. If asklemmy has plenty of scientist members they could open a askscience subcommunity too.

The majority of user traffic would all come from other smaller homerun instances.

Big instances that try to be everything at once are a side effect of the massive growth we are experiencing, they work now but will slowly become more centralized and are therefore doomed to fail (in my opinion)

To recalculate. How can we help Lemmy grow? By being proactive users that maintain something small we chose to care about.

CanadaPlus,

Lemmy uses PostgreSQL, with a number of tables. It’s pretty standard stuff, looks like, and it’s in Rust. It’s assumed there’s only going to be one server per instance right now, but I’d expect that one server could keep up with a reasonable volume.

I already get rate-limited like crazy on lemmy and there are only like 60,000 users on my instance.

Is that a typical number of users to have already? Wow, we really are growing.

Rate limiting is it’s own thing, I guess some work will need to be done to find a non-exploitable way to do it that still scales.

tgxn,
@tgxn@lemmy.tgxn.net avatar

60,000 users is also a LOT for a Lemmy instance. They’ve gone from ~8,000 to 60k+ in a matter of weeks. I’m sure there will be many performance and efficiency improvements coming soon. Hopefully people spread out a bit more across other instances with less users!

LostRedditor,

I love Lemmy but your question is legit. I just signed up with lemmy.world because lemmy.ml is down.

Before making a post in lemmy.world guess what? lemmy.world isn’t responding. I know they have scheduled maintenance at 9 CET but it was 20 minutes before that.

roadrunner_ex,
@roadrunner_ex@lemmy.ca avatar

It’s a challenge, for sure. It is known that there are some inefficiencies in the codebase, which are actively being worked on. But besides that, it’s tricky to know where bottlenecks are until the user influx happens, particularly with the novel federation architecture. Maybe it’s impossible to scale, maybe not, but we only now are seeing a testable use case. I would expect optimization work to start bearing fruit, but these thing take time.

NettoHikari,

Well, I run an instance, too. It’s not big at all, but I was thinking about the issue of scaling, too. You can only scale up a single server so much…

But on the other hand, Lemmy is still young. We’ll find solutions to that problem.

Also, interesting article. I only took a glance at it, but having only two tables kind of suggests that Reddit is using a relational database. So, if they’re not “normalizing” everything, why not use a completely different paradigm, like what MogoDB etc. has?

marsara9,
@marsara9@lemmy.world avatar

Lemmy is entirely open source, so you can see what their architecture looks like, etc… here: github.com/LemmyNet/lemmy.

Rate limits, as I understand them from the code, should only apply on a per-IP basis. So you should only be seeing rate limit errors if:

  • your behind a CGNAT and multiple people who use your ISP are using Lemmy
  • you’re sending A LOT of requests to your instance yourself
  • the admin of your instance has significantly lowered the rate limits (viewable here: /api/v3/site)
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • wartaberita
  • uselessserver093
  • Food
  • [email protected]
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • TheResearchGuardian
  • SuperSentai
  • feritale
  • oklahoma
  • Testmaggi
  • KbinCafe
  • Ask_kbincafe
  • KamenRider
  • All magazines