3 ms·
> Each server caches copies of all incoming posts to serve them directly to their local users. There are downsides to this approach, but the positive is that it
by shagie 3y ago
> Each server caches copies of all incoming posts to serve them directly to their local users. There are downsides to this approach, but the positive is that it crudely balances server load across the network.
https://mastodon.social/@jwz/109411593248255294 https://mastodon.social/@jwz/109411593248255294 (safe to link to - and its following page via mastodon)
> Every time I do a new blog post, within a second I have over a thousand simultaneous hits of that URL on my web server from unique IPs. Load goes over 100, and mariadb stops responding.
> The server is basically unusable for 30 to 60 seconds until the stampede of Mastodons slows down.
> Presumably each of those IPs is an instance, none of which share any caching infrastructure with each other, and this problem is going to scale with my number of followers (followers' instances).
- account42 3y agoWhich URL is the one getting hammered? The HTML blog post? Or some ActivityPub resource? Why do all requests need to hit the database instead of being served by a (micro) cache? Is there anything besides the inbox endpoint that actually needs to be real-time dynamic?