Hey guys, just curious, can we have multiple nodes for the same lemmy instance? If not, is this something that’s on the radar?

This would really help alleviate the load on a single server and make things much more stable and help with availability. I’m not sure if this functionality exists or if it is planned. Can anyone shed some light on this?

Thanks!

  • PriorProject@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 year ago

    I took a crack at breaking down Lemmy’s horizontal scalability in another thread: https://lemmy.world/comment/3583.

    TLDR: There are 4 processes that make up a lemmy install, you can definitely run those on different machines and that will help some. Some of the processes that make up a lemmy install are probably stateless and could be scaled out, but I’m not 100% sure on that. Postgres becomes the bottleneck at that point, and reads can be scaled out with read-replicas. Scaling PG writes is harder… but you can probably run Lemmy on 6-10 machines today if you’re determined. So Lemmy is not built on distributed technology that’s designed to scale out to hundreds of machines… but a big Lemmy install might be able to productively make use of 5 or 10.

    Will Lemmy fall over for reasons unrelated to CPU/IO/RAM capacity far before you consume all the resources on those 6-10 machines? Almost certainly it will. It would take hundreds of thousands of registered users and 10’s of thousands of active users to fully occupy all that hardware, and it’s likely that the heaviest database queries would just break long-before you got there. But as the devs find and fix performance issues, and as it becomes possible for a single Lemmy instance to handle bigger user counts before crashing… there’s a limited but useful amount of scaling ability beyond single-machine limits.

    • sup@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Thank you for your comment! The was a great write-up and I have a much better understanding of Lemmy’s infrastructure.

  • poVoq@slrpnk.net
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    There was also some previous discussion about using a S3 compatible image host as the Pict-rs backend added support for that in the latest version v0.4.x

    Lemmy is still using 0.3.x and 0.4.x is untested I think, and by default Pict-rs is proxied through the Lemmy backend server I think, but in theory it should be possible to distribute quite some load this way.