this post was submitted on 05 Jun 2023
162 points (99.4% liked)

Lemmy

12542 readers
52 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 4 years ago
MODERATORS
 

With forewarning about a huge influx of users, you know Lemmy.ml will go down. Even if people go to https://join-lemmy.org/instances and disperse among the great instances there, the servers will go down.

Ruqqus had this issue too. Every time there was a mass exodus from Reddit, Ruqqus would go down, and hardly reap the rewards.

Even if it's not sustainable, just for one month, I'd like to see Lemmy.ml drastically boost their server power. If we can raise money as a community, what kind of server could we get for 100$? 500$? 1,000$?

you are viewing a single comment's thread
view the rest of the comments
[–] nutomic@lemmy.ml 6 points 1 year ago (2 children)

Its the one for 30 euros, Im not seeing any vps for 112. Maybe thats a different type of vps?

[–] milan@discuss.tchncs.de 3 points 1 year ago (1 children)

in vservers, it depends on the memory … and storage option for the one starting at 30…

[–] nutomic@lemmy.ml 5 points 1 year ago (1 children)

It currently has 8gb and only uses 6gb or so. CPU is the only limitation.

[–] milan@discuss.tchncs.de 5 points 1 year ago (2 children)

It does not sound like OVHs vServers offer dedicated cores, and it is common to quickly become a bottleneck with VPS offerings across hosters and for example with the initial Mastodon hypes, i had to learn that shared hardware lesson the hard way. For the price you are currently paying, maybe something like a used dedicated (or one of the fancy AMD ones) server at Hetzner is of interest: https://www.hetzner.com/sb

[–] nutomic@lemmy.ml 5 points 1 year ago (2 children)

Hetzner is great but they are very strict about piracy, so its not an option for lemmy.ml. For now the load has gone down so I will leave it like this, but a dedicated OVH server might be an option if load increases again.

[–] SemioticStandard@lemmy.ml 13 points 1 year ago (1 children)

You should use this relatively quiet time to migrate to a larger server, because when the time comes where you need to do it, you're going to be in for a world of hurt. This is the calm before the storm--take advantage of it.

Ultimately, you need to scale horizontally. You need to shard your database and separate out your different functions (database, front end, whatever back end applications you use, etc) onto different servers, all fronted by load balancers. That's going to be the only way to even begin to handle increasing load. If you don't have a small team of experienced engineers with a deep understanding of how to build for scale, and you get a sudden mass exodus of users from Reddit, you're fucked. So if I were you, here's what I'd do:

  1. Scale up to the largest instance type you can. If possible, switch (at least temporarily) to AWS and use something in the c6i instance family, such as the c6id.32xlarge. Billing for AWS instances is done by the hour, so you wouldn't need to pay for an entire month up front if you only need that extra horsepower for a few days (such as when the blackouts are planned from the 12th through 14th).

  2. Because the above will do nothing but buy you time until you crash--and if you get a huge spike of users, without horizontal scaling, you WILL crash--migrate your DNS to something like Cloudflare. From there, configure workers to respond when health checks to your site fail, so that users attempting to access the site can be shown a static page directing them to something like http://join-lemmy.org or someplace, instead of simply getting 5xx errors.

  3. Once the hug of death is over, evaluate where you stand. Reduce your instance size, if you can, and start investigating what it's going to take to scale horizontally.

I'm not a SQL expert, but I am a principal network architect, and my day job for the last 15 years has been working on scale and automation for the world's largest companies, including 7 years spent at AWS. In my world, websites like Reddit, as large as they are, are still considered to be of 'average' size. I can't help you with database, but I'm happy to provide guidance around networking, DNS, scale, automation, security, etc.

[–] sam_uk@slrpnk.net 2 points 1 year ago

I believe @ernest is just about to do a backend re-factor on https://kbin.social/ if you had the time and inclination a ticket here outlining some optimisations for horizontal scaling might be timely https://codeberg.org/Kbin/kbin-core

[–] sysgen@lemmy.ml 1 points 1 year ago

Hexbear ran (runs?) on Hetzner, I don't recall them ever having an issue.

[–] sam_uk@slrpnk.net 2 points 1 year ago (1 children)

I'm relatively new to https://elest.io/pricing but it seems an easy way to scale stuff up (and down again) Dockerised, just upgrade the plan to the next tier when needed. Pay by the hour. Downgrade it again later.

There's also a bunch of load balancer options I haven't even begun to explore yet.

If you select Hetzner it's EU based & powered by green energgy

[–] sam_uk@slrpnk.net 1 points 1 year ago

With Elestio you can choose from a range of cloud providers.

[–] epical@lemmy.ml 0 points 1 year ago (3 children)

Nowadays doesn't even make any sense to use servers. Everyone already have decent computers and/or smartphones able to host their own content (text) and their friends content. Doesn't require much. Why not create something better? We already have decentralized finance but we still using centralized social networks. How's this possible?!

[–] nutomic@lemmy.ml 5 points 1 year ago (1 children)

Then users would have to deal with key pairs. By using websites we get the domain system which users are already familiar with. And it supports normal password login which is impossible in p2p.

[–] roho@lemmy.ml 3 points 1 year ago* (last edited 1 year ago) (1 children)

Nowadays doesn’t even make any sense to use servers. ... Why not create something better?

i think you might underestimate the problem.

Jami.net (a decentralized messaging app) works p2p. it uses a torrent-like distributed-hashmap to locate the peers at any moment. (The main usability issue for nontechnical users, is that devices on an internal ip address aren't addressable from outside. This requires (a single point of failure and privacy concern), a turn-server)

They started to incorporate Git for merging chats for the reason that any of set of peers (of a group chat) can be out of reach of another set of peers, i.e. the chat continues on different branches and needs to be merged again later.(this happens in the clients-app, because there is no central server). Jami is aiming at double-digit group sizes.. That's not nearly the size of what Lemmy is handling.

[–] ch1cken@discuss.tchncs.de 1 points 1 year ago (1 children)

Everyone already have decent computers and/or smartphones able to host their own content (text) and their friends content

What if there was something like lemmy, but p2p, similar to how peertube works. And for dead content it could fallback to a server?