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

Lemmy

2172 readers
4 users here now

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

For discussion about the lemmy.ml instance, go to [email protected].

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
[–] [email protected] 13 points 1 year ago (3 children)

What's the current bottleneck?

[–] [email protected] 38 points 1 year ago (1 children)

SQL. We desperately need SQL experts. It's been just me for yeRs, and my SQL skills are pretty terrible.

[–] [email protected] 2 points 1 year ago

Put the whole DB in RAM :-)

Makes me remember optimization, lots of EXPLAIN and JOIN pain, on my old MySQL multiplayer game server lol. A shame I'm not an expert ...

[–] [email protected] 23 points 1 year ago (4 children)

There are some SQL database optimisations being discussed right now and apparently the picture resizing on upload can be quite CPU heavy.

[–] [email protected] 40 points 1 year ago (2 children)

SQL dev here. Happy to help if you can point me in the direction of said conversation. My expertise is more in ETL processes for building DWs and migrating systems, but maybe I can help?

[–] veroxii 20 points 1 year ago (1 children)

I've been helping on the SQL github issue. And I think the biggest performance boost would be to separate the application and postgresql onto different servers. Maybe even use a hosted postgresql temporarily, so you can scale the db at the press of a button. The app itself appears to be negligible in terms of requirements (except the picture resizing - which can also be offloaded).

But running a dedicated db on a dedicated server - as close to the bare metal as possible give by far the best performance. And increase it for more connections. Our production database at my data analytics startup runs a postgresql instance on an i9 server with 16 cores, 128GB RAM, and a fast SSD. We have 50 connections set up, and the run pgbouncer to allow up to 500 connections to share those 50. And it seamlessly runs heavy reporting and dashboards for more than 500 business customers with billions of rows of data. And costs us less than US$200pm at https://www.tailormadeservers.com/.

[–] [email protected] 7 points 1 year ago

And I think the biggest performance boost would be to separate the application and postgresql onto different servers.

I think hexbear.net (an older lemmy fork-ed site) is working on this in conjunction with moving back to a modern lemmy version

[–] [email protected] 5 points 1 year ago* (last edited 1 year ago) (1 children)

apparently the picture resizing on upload can be quite CPU heavy

This suggestion probably won't help with hosted VPS, but lib nvJPEG pushes crazy theoretical numbers for image resizing.

Maybe this could be worth investigating?

[–] [email protected] 8 points 1 year ago* (last edited 1 year ago)

Probably not, but it does mention a more general CUDA based solution that might be interesting to add to Pictrs. I could for example move my Pictrs instance onto a server that does have an older Nvidia GPU to accelerate stuff (to use for Libretranslate and some other less demanding ML stuff).

Edit: Ok looks like the resizing is anyways only supported on Pictrs 0.4.x which most Lemmy instances are not using yet. However this seems to use regular ImageMagick in the background, so chances are quite high that it can be made to work with OpenCL: https://imagemagick.org/script/opencl.php

[–] [email protected] 6 points 1 year ago (1 children)

And may be the bandwidth. Serve thousands and thousands need at minimum 1gbps.

[–] [email protected] 10 points 1 year ago

Its mostly text so bandwidth shouldnt be a problem.