How much difference does a CDN make to a fediverse instance? - PieFed (join.piefed.social)
from ericjmorey@discuss.online to selfhosted@lemmy.world on 20 Feb 2024 14:25
https://discuss.online/post/5391128

cross-posted from: discuss.online/post/5391072

February 20, 2024 piefedadmin writes:

For a very small instance with only a couple of concurrent users a CDN might not make much difference. But if you take a look at your web server logs you’ll quickly notice that every post / like / vote triggers a storm of requests from other instances to yours, looking up lots of different things. It’s easy to imagine how quickly this would overwhelm an instance once it gets even a little busy.

One of the first web performance tools people reach for is to use a CDN, like Cloudflare. But how much difference will it make? In this video I show you my web server logs before and after and compare them.

Read How much difference does a CDN make to a fediverse instance?

#selfhosted

threaded - newest

originalucifer@moist.catsweat.com on 20 Feb 2024 14:33 next collapse

saves me a ton on storage costs. the bucketing for the cdn is orders of magnitude cheaper to store/deliver than from the web server itself. this would be on amazon hosting.

Toribor@corndog.social on 22 Feb 2024 12:24 collapse

Are you using cloudfront?

originalucifer@moist.catsweat.com on 22 Feb 2024 12:44 collapse

yep

Toribor@corndog.social on 23 Feb 2024 13:19 collapse

Are you using s3 for storage or block storage? S3 is pretty cheap but I’m wondering if Cloudfront would still help me with the load on the ec2 instance when federation traffic is slamming it.

originalucifer@moist.catsweat.com on 23 Feb 2024 13:38 collapse

yes!

so the way this works is, you only pay for the lift from your EC2 instance to the s3 bucket, then cloudfront serves the bucket directly to public, which is far cheaper than EC2-> public

i dont think ive even triggered the non-free tier of cloudfront yet.

tristan@aussie.zone on 20 Feb 2024 16:31 collapse

For a bit of context for those not too familiar with CDN stuff. My web server hosts about 20 small business websites. None are heavy on images or video or anything else. Most sites have well under 1k visitors a day, some are under 100.

Each month CloudFlare CDN saves me between 40-60gb of traffic which is nothing my server couldn’t handle, but over a year is ~600gb in saved data so it adds up

If you had a Lemmy instance with even just 100 active users, with all the images and videos and all the federated background communications, that would add up extremely quickly.

haui_lemmy@lemmy.giftedmc.com on 20 Feb 2024 16:56 next collapse

Sounds pretty interesting. I‘d like to know that as well.

[deleted] on 22 Feb 2024 13:47 collapse
.