Good morning Fedi friends!
I had to delete the toot I published earlier because sharing a URL to my new self-hosted Ghost blog overwhelmed the server & took the whole site down (even with powerful caching in place).
This is apparently a common problem: github.com/mastodon/mastodon/i…
Anyway! I spent the past few months learning some basic coding & I was able to manually install Ghost, edit Nginx configs & do other dev magic. It's super empowering! 💪
As they say: link in bio 😅
Reduce load of preview fetching on third-party servers · Issue #23662 · mastodon/mastodon
Steps to reproduce the problem Posting an image on Mastodon causes hundreds or thousands of federated servers to fetch the preview details all at once, causing a high load for the target server and...GitHub
leberschnitzel
in reply to Elena Rossini ⁂ • • •Elena Rossini ⁂
in reply to leberschnitzel • • •Troed Sångberg
in reply to Elena Rossini ⁂ • • •ping @renchap - I know this is on the roadmap but there seems to be different opinions on how this works considering the 0-60 sec random delay in Mastodon before fetching. Here's a recent case.
@_elena
Renaud Chaput
in reply to Troed Sångberg • • •This is still on our roadmap, but I need to point out that this is not a Mastodon issue but a Fediverse-wide one, and despite many people pointing our to the issue, nobody wrote an FEP (or started the discussions to do one). We will do it, when we have some bandwidth…
Troed Sångberg
in reply to Renaud Chaput • • •@renchap
Thanks for the reply, yes, this is exactly why I pinged you. We have those who've spent a lot of developer resources on trying to sort it out their end (CoffeGeek) and others like Elena here who might not have - but the experience is still the same, creators have their web sites completely downed for several minutes after posting to Mastodon.
With the Mastodon dev team quite small, could it be worthwhile to request some help from the community in tracking the core issues down perhaps? There are lots of people on here who deal daily with high availability systems and should be able to figure this out. It requires the help of someone with lots of followers though to push some test content every now and then.
@_elena
Elena Rossini ⁂
in reply to Troed Sångberg • • •Renaud Chaput
in reply to Elena Rossini ⁂ • • •Did you update your Ghost config to include the caching options? ghost.org/docs/config/#caching
I would advise a maxAge of 10s to 60s at least for the frontend
Configuration - Adapt your publication to suit your needs
Ghost - The Professional Publishing PlatformElena Rossini ⁂
in reply to Renaud Chaput • • •@renchap thank you Renaud! I’ll look into tweaking this 🙏
@troed
Steve Wart
in reply to Elena Rossini ⁂ • • •Elena Rossini ⁂
in reply to Steve Wart • • •patpro
in reply to Elena Rossini ⁂ • • •Elena Rossini ⁂
in reply to patpro • • •ティージェーグレェ
in reply to Elena Rossini ⁂ • • •The "traditional" way to mitigate the so-called "slashdot effect" (see: en.wikipedia.org/wiki/Slashdot…) other than optimizations (e.g. just serve up static content which reduces server load, or buy and use servers with faster CPUs, more cores, more RAM, etc.) is to use a CDN (Content Distribution Network, see: en.wikipedia.org/wiki/Content_…). There used to be a free/academic CDN called CoralCDN, which was pretty awesome; but I don't think anything similar has replaced it?
OFC, BitTorrent and PeerTube and other p2p paradigms obviate the utility of a CDN, but they tend to require a bit more effort to set up.
CC: @patpro@social.patpro.net
effect that occurs when a popular website links to a smaller website, causing a massive increase in traffic
Contributors to Wikimedia projects (Wikimedia Foundation, Inc.)Elena Rossini ⁂
in reply to ティージェーグレェ • • •@teajaygrey thank you for the advice! @renchap suggested I should look into my Ghost caching settings: ghost.org/docs/config/#caching because they seem to be badly configured.
it's really bizarre what keeps happening whenever I publish something on here because my VPS plan offers 4TB of bandwidth and I use so little. Like, it's basically undetectable in my dashboard. I'll dig into the config files, make the suggested tweak and do some A/B testing
Configuration - Adapt your publication to suit your needs
Ghost - The Professional Publishing PlatformRenaud Chaput
in reply to Elena Rossini ⁂ • • •As I explained, you set up Varnish for caching, but your Ghost install is configured to not allow any caching. This is not a bandwidth problem, once you have proper caching configured all should be fine.
@teajaygrey
Elena Rossini ⁂
in reply to Renaud Chaput • • •@renchap thank you Renaud! 🙏 I just tried adding the caching code in config.production.json but got a JSON error message... will try figuring it out.
One last question: how did you see that the MaxAge was set to 0? (like what do I need to do to check it myself)?
Renaud Chaput
in reply to Elena Rossini ⁂ • • •With curl, the best tool to troubleshoot those issues.
By running `curl -I https://news.elenarossini.com/`, it will display the HTTP headers sent from your server for your homepage. You will see that the `Cache-Control` header sets a max age of 0 (= do not cache), and that the `age` header (set by Varnish) is 0. If caching works, you should see a `age` value greater than 0.
Elena Rossini ⁂
in reply to Renaud Chaput • • •patpro
in reply to Elena Rossini ⁂ • • •I'm not super comfortable giving advice about a virtual server I know nothing about, but diagnose a bandwidth limit is hopefully straight forward: you probably pay for a bandwidth allowance so you could compare what comes out of your server to that allowance. A local script logging Tx and Rx for your network interface every 10 seconds should do the trick.
Take a look at your log files too, you might discover an explicit limit that is not bandwidth related (too many open files, for example). Having data before / during and after an incident is precious.
Further actions will depend on the root cause, obviously. You could pay for more bandwidth and / or shrink your media files, or you could add some RAM to accommodate more simultaneous connections, etc.
Elena Rossini ⁂
in reply to patpro • • •@patpro thank you! for additional context: mastodon.social/@_elena/114261…
Elena Rossini ⁂
2025-04-01 07:21:16
Seth is a Perpetual Startup ⁂
in reply to Elena Rossini ⁂ • • •Elena Rossini ⁂
in reply to Seth is a Perpetual Startup ⁂ • • •