this post was submitted on 12 Jun 2023
405 points (100.0% liked)

Lemmy.World Announcements

29077 readers
127 users here now

This Community is intended for posts about the Lemmy.world server by the admins.

Follow us for server news 🐘

Outages πŸ”₯

https://status.lemmy.world/

For support with issues at Lemmy.world, go to the Lemmy.world Support community.

Support e-mail

Any support requests are best sent to info@lemmy.world e-mail.

Report contact

Donations πŸ’—

If you would like to make a donation to support the cost of running this platform, please do so at the following donation URLs.

If you can, please use / switch to Ko-Fi, it has the lowest fees for us

Ko-Fi (Donate)

Bunq (Donate)

Open Collective backers and sponsors

Patreon

Join the team

founded 2 years ago
MODERATORS
 

At the time of writing, Lemmyworld has the second highest number of active users (compared to all lemmy instances)

Also at the time of writing, Lemmyworld has >99% uptime.

By comparison, other lemmy instances with as many users as Lemmyworld keep going down.

What optimizations has Lemmyworld made to their hosting configuration that has made it more resilient than other instances' hosting configurations?

See also Does Lemmy cache the frontpage by default (read-only)? on !lemmy_support@lemmy.ml

top 50 comments
sorted by: hot top controversial new old
[–] ruud@lemmy.world 323 points 1 year ago (17 children)

Thank you for all the compliments.

This ride reminds me of Mastodon.world in November. Details on that are here: https://blog.mastodon.world/and-then-november-happened

So I started lemmy.world on a 2CPU/4GB VPS. Keeping an eye on the performance. Soon I decided to double that. And after the first few thousand of users joined, doubled it again to 8CPU/16GB. That also was the max I could for that VPS type.

But, already I saw some donations come in, without really asking. That reminded me of the willingness to donate on Mastodon, which allowed me to easily pay for a very powerful server for mastodon.world, one of the reasons it grew so fast. Other (large) servers crashed and closed registrations, I (mainly) didn't.

So, I decided to buy the same large server (32cpu/64threads with 128GB RAM) as for masto (but that masto one has double the RAM). With the post announcing that, I also mentioned the donation possibilities. That brought a lot of donations immediately, already funding this server for at least 2 months. (To the anonymous person donating $100 : wow!).

Now next: to solve the issue with post slowness. That's probably a database issue.

And again: migration took 4 minutes downtime, and that could have been less if I wasn't eating pizza at the same time. So if any server wants to migrate: please do! If you have the userbase, you'll get the donations for it. Contact me if you have questions.

[–] SteveJobs@lemmy.world 57 points 1 year ago (2 children)

What kind of pizza was it?

[–] ruud@lemmy.world 67 points 1 year ago (2 children)
[–] sarsaparilyptus@beehaw.org 11 points 1 year ago (1 children)
load more comments (1 replies)
[–] darkstar@lemmy.zip 21 points 1 year ago

Asking the important questions

[–] Balthazar@sopuli.xyz 27 points 1 year ago

And this kindness and willingness to help is why I've already fallen in love with Lemmy. Thank you good sir, thank you dearly for helping the next generation of internet denisens :D

[–] million@lemmy.world 15 points 1 year ago (1 children)

Nice job, thanks very much for the write up.

Out of curiosity are you cloud hosting or do you own a server on a rack somewhere? Scaling with Kubernetes or VMs or just running bare-metal?

load more comments (1 replies)
[–] grouvie@lemmy.help 14 points 1 year ago

Interesting writeup. I'm curious about the resource usage of the Lemmy backend and frontend deployments. Do you have any insights on the resource utilization of these deployments?

[–] SteelBeard@lemmy.world 12 points 1 year ago

Hey, you rock. This place is pretty cool.

[–] QuazarOmega@fedia.io 10 points 1 year ago

Amazing stuff!
I hope others will follow suit, it's the biggest hurdle right now for serious adoption in my opinion and you crushed it!

[–] Soullioness@lemmy.world 10 points 1 year ago (1 children)

What does it cost per month to operate your servers, namely this one?

[–] poVoq 19 points 1 year ago (2 children)

They just upgraded to a dedicated server for 180€/month today.

load more comments (2 replies)
load more comments (10 replies)
[–] psychothumbs@lemmy.world 190 points 1 year ago (2 children)

Looks like the guy who runs it runs a lot of fediverse servers, I guess he knows what he's doing: https://lemmy.world/u/ruud

[–] kiwifoxtrot@lemmy.world 110 points 1 year ago

@ruud runs a top 10 mastodon server.

[–] maltfield@monero.house 80 points 1 year ago (2 children)

Yes. And I'm asking him to share his tweaks here with the community so that others instance admins can shore-up their servers :)

[–] PriorProject@lemmy.world 113 points 1 year ago

Fwiw, he has been providing quite a lot of transparency in his posts to this community. He's shared his hardware config in detail, posted maintenance posts with brief descriptions of what he's doing, and replied to comments around specific config tweaks. I haven't catalogued a list of links, but I've seen him do all of these things in the last 48h. It's easy to imagine that all these things could be compiled in real time into a how-to, but it's a pretty big deal just to keep the lights on right now, and pretty difficult to understand whether tweaks that helped your setup are generally applicable or only situationally useful and happen to perform well for your specific setup.

I'm sure we will see more high-performance Lemmy guides in the future, but at this point no one has more than 36h of experience with high-performance Lemmy. Give them a minute to catch up.

[–] Kris@lemmy.world 15 points 1 year ago (1 children)

More like throw more $$$ at the problem has been the solution.

[–] MetaCubed@lemmy.world 12 points 1 year ago (1 children)

Saying this without any knowledge of lemmy's backend... Large, high user count databases with (very quickly) growing demand take more power than generally expected. At a certain point, throwing money at the problem is the solution.

load more comments (1 replies)
[–] PriorProject@lemmy.world 165 points 1 year ago (24 children)

I'm not an admin, but have followed the sizing discussions around the lemmyverse as closely as I can from my position of lacking first-hand knowledge:

  • lemmy.ml is the biggest instance by user count, but runs on incredibly modest 8-cpu hardware. Their cloud provider doesn't provide any easy scale up options for them, so they can't trivially restart on a bigger VM with their db and disk in place. I suspect this means that instance is going to suffer for a bit as they figure out what to do next.
  • lemmy.world on the other hand was running on a box at least twice as big as lemmy.ml at last count, and I believe they can go quite a bit bigger if they need to.
  • The lemmy.world admins also run mastodon.world and lived through the twitterpocalypse, seeing peak user registrations rates of 4k per hour. So this is not their first rodeo in terms of explosive growth, I'm sure that experience gives them some tricks up their sleeve.
  • The admin team is pretty clearly technically strong. If I recall correctly, ruud is a professional database admin. One of the spooky parts of Lemmy performance-wise is the db. If ruud or others on the admin team custom-tuned their pg setup based on their own analysis of how/why it's slow, they may be getting more performance per CPU cycle than other instances running more stock configs or that are cargo-culting tweaks that aren't optimal for their setup without understanding what makes them work.

I'm surprised that sh.itjust.works isn't growing faster. They also have a hefty hardware setup and seemingly the technical admins to handle big user counts. I wonder if it's a branding problem, where lemmy.world sounds inviting and plausibly serious where sh.itjust.works sounds like clowntown even though it's run by a capable and serious team.

[–] Pspspspspsps@lemmy.world 127 points 1 year ago* (last edited 1 year ago) (5 children)

I wonder if it's a branding problem, where lemmy.world sounds inviting and plausibly serious where sh.itjust.works sounds like clowntown

That was my thought process when choosing an instance tbh. I'm not a tech person, I looked at the list and lemmy.world was the first 'safest feeling' instance that had open sign up. I saw sh.itjust.works and didn't even check their sign up process, there was too many periods in the strange name and it just looks weird to me as someone not used to these things. Edit: spelling

[–] Z______@lemmy.world 36 points 1 year ago* (last edited 1 year ago) (1 children)

I definitely second the motion on it being a branding problem. Stuff like sh.itjust.works seem to me like something that dark basement tech nerds would come up with that is "edgy" and really only used by them and other people like them.

I'm not really into the ironic "edgy" aesthetic and part of the struggle with this transition for me has been orienting myself in the space because I don't want to commit to some "sketchy" edgelord URL

[–] darkwing_duck@sh.itjust.works 30 points 1 year ago (2 children)

something that dark basement tech nerds would come up with that is β€œedgy” and really only used by them and other people like them.

That's exactly what it is and why I love it. The whole thing about this federated networking is that it doesn't matter where you signed up.

[–] ericjmorey@lemmy.world 10 points 1 year ago (2 children)

Where you sign up entirely determines your local feed.

Just like with reddit, I don't use defaults.

[–] Mjb@feddit.uk 13 points 1 year ago (1 children)

The least useful of the three feeds

load more comments (1 replies)
load more comments (1 replies)
[–] Guy_Fieris_Hair@lemmy.world 17 points 1 year ago* (last edited 1 year ago)

I do think join-lemmy.org could possibly be changed to show server usage/capacity and uptime. When I initially signed up I went for lemmy.ml because what the heck is the difference? Honestly I was having all kinds of timeouts and thought the entire lemmy-verse was probably struggling. I was concerned that was the experience everyone was getting that they were going to leave because it is unsustainable.

But I ended up seeing a page showing the uptime of serversnand lemmy.world was 100% (at that point). So I figured I'd start an account here. HOLLY CRAP IT IS SO MUCH FASTER. I would have had a hard time sticking around if it all worked like lemmy.ml.

I started a community on lemmy.ml. Wish I would have done it here.

load more comments (3 replies)
[–] RetroEvolute@lemmy.world 50 points 1 year ago* (last edited 1 year ago) (1 children)

I originally signed up with sh.itjust.works, but I wanted to be on the instance with the majority of migrants.

Also, it sounds dumb, but I think the sh.itjust.works domain is just kinda weird, technically has a "curse word" in it (not that I personally care), and they don't support NSFW content (which isn't just used for porn). So, it didn't make sense to have that as my home instance. πŸ€·β€β™‚οΈ

Edit: Also, this is my first comment on here! Hello world! πŸ‘‹

[–] PriorProject@lemmy.world 14 points 1 year ago (1 children)

Yeah, I get it. Naming optics aside, it seems an instance with a lot of headroom relative to others, with a capable team. Would be near the top of my word-of-mouth options in spite of the idiosyncratic name.

load more comments (1 replies)
[–] ClassyHatter@fedia.io 38 points 1 year ago

Lemmy.world was just migrated to a dedicated server: https://lemmy.world/post/75556

[–] Master@lemmy.world 32 points 1 year ago (3 children)

Can confirm... I didnt sign up for sh.itjust.works solely because of the name... I dont particularly want that attached to every post I make.

load more comments (3 replies)
[–] darkwing_duck@sh.itjust.works 14 points 1 year ago* (last edited 1 year ago)

That's actually awesome for users of sh.itjust.works. Like myself.

[–] tigerdactyl@sh.itjust.works 13 points 1 year ago (2 children)

I’ve been having issues registering for lemmy.world so I went with sh.itjust.works and it’s been great so far

load more comments (2 replies)
[–] wheen@lemmy.world 13 points 1 year ago (1 children)

Can none of this scale horizontally? Every mention of scaling has been just "throw a bigger computer at it".

We're already running into issues with the bigger servers being unable to handle the load. Spinning up entirely new instances technically works, but is an awful user experience and seems like it could be exploited.

[–] PriorProject@lemmy.world 41 points 1 year ago* (last edited 1 year ago)

It's important to recall that last week the biggest lemmy server in the world ran on a 4-core VM. Anybody that says you can scale from this to reddit overnight with "horizontal scaling" is selling some snake oil. Scaling is hard work and there aren't really any shortcuts. Lemmy is doing pretty well on the curve of how systems tend to handle major waves of adoption.

But that's not your question, you asked if Lemmy can horizontally scale. The answer is yes, but in a limited/finite way. The production docker-compose file that many lemmy installs are based on has 5 components. From the inside out, they are:

  • Postgres: The database, stores most of the data for the other components. Exposes a protocol to accept and return SQL queries and responses.
  • Lemmy: The application server, exposes websockets and http protocols for lemmy clients... also talks to the db.
  • Lemmy-ui: Talks to Lemmy over websockets (for now, they're working to deprecate that soon) and does some fancy dynamic webpage construction.
  • Nginx: Acts as a web proxy. Does https encryption, compression over the wire, could potentially do some static asset caching of images but I didn't see that configured in my skim of the config.
  • Pict-rs: Some kind of image-hosting server.

So... first off... there's 5 layers there that talk to each other over the docker network. So you can definitely use 5 computers to run a lemmy instance. That's a non-zero amount of horizontal scaling. Of those layers, I'm told that lemmy and lemmy-ui are stateles and you can run an arbitrary number of them today. There are ways of scaling nginx using round-robin DNS and other load-balancing mechanisms. So 3 out of the 5 layers scale horizontally.

Pict-rs does not. It can be backed by object storage like S3, and there are lots of object storage systems that scale horizontally. But pict-rs itself seems to still need to be a single instance. But still, that's just one part of lemmy and you can throw it on a giant multicore box backed by scalable object storage. Should take you pretty far.

Which leaves postgres. Right now I believe everyone is running a single postgres instance and scaling it bigger, which is common. But postgres has ways to scale across boxes as well. It supports "read-replicas", where the "main" postgres copies data to the replicas and they serve reads so the leader can focus on handling just the writes. Lemmy doesn't support this kind of advanced request routing today, but Postgres is ready when it can. In the far future, there's also sharding writes across multiple leaders, which is complex and has its downsides but can scale writes quite a lot.

All of which is to say... lemmy isn't built on purely distributed primitives that can each scale horizontally to arbitrary numbers of machines. But there is quite a lot of opportunity to scale out in the current architecture. Why don't people do it more? Because buying a bigger box is 10x-100x easier until it stops being possible, and we haven't hit that point yet.

[–] Druidgrove@lemmy.world 12 points 1 year ago (3 children)

I'm now going to start incorporating "Sounds like clowntown" into my everyday conversations - that's funny!

load more comments (3 replies)
[–] WaffleFriends@lemmy.world 12 points 1 year ago

I had a very similar thought process when choosing my instance. lemmy.world seemed like it would be more open to new users than an instance named sh.itjust.works. Idk why that was my thought process but I’m here now

[–] StrayPizza@lemmy.world 9 points 1 year ago

I hope lemmy.ml can upgrade at some point. A lot of the slowness I'm running into is trying to browse/discovery communities that happen to live on that instance.

load more comments (14 replies)
[–] neighbourbehaviour@lemmy.world 59 points 1 year ago* (last edited 1 year ago) (1 children)

It's known in the industry as the throw-hardware-at-it optimization. It's often effective and what's needed to buy time for software optimization to come in.

[–] OsrsNeedsF2P@lemmy.ml 21 points 1 year ago (1 children)

As someone who got burnt out on one of their last businesses due to optimizing too early - Yes!!!

Doing it "properly" with "stateless servers" and "autoscaling" with "Kubernetes" costs a hell of a lot more money than a 64 Core server with 256 GB of RAM

load more comments (1 replies)
[–] MasterBlaster@lemmy.world 45 points 1 year ago (4 children)

Talk about dumb luck! I chose this server (apparently 2 days after launch) because docmentation suggested choosing a less populated server to spread the load. Now I'm on one of the biggest and most stable. Me so happy!

[–] atlasraven31@lemm.ee 11 points 1 year ago

I didn't choose this server but I can still join and post. Greetings from Lemm.ee!

load more comments (3 replies)
[–] netburnr@lemmy.world 35 points 1 year ago* (last edited 1 year ago)

He has been posting updates along the way. It's a combo of upgrading the server as it hits its limits and tuning of his web proxy and docker container to handle the increased load and federation requirements.

Been doing an amazing job of it too. I just randomly chose this instance and I'm glad.

Edit. Here is his last post https://lemmy.world/post/75556

[–] andrew@radiation.party 16 points 1 year ago (7 children)

Likely experience and knowledge improving the quality of deployment. Most instances are likely underspecced, are on hosts that aren't easy to scale up with, or are maxed out in their current offering tier (lemmy.ml comes to mind there)

load more comments (7 replies)
[–] wilberfan@lemmy.world 9 points 1 year ago

Just subscribed at Patreon to support the cause! πŸ‘

load more comments
view more: next β€Ί