Federation syndication

I’m quite sure this is of no interest to anyone but me, but I finally managed to fix a longstanding weird issue with my website.

I realise that me telling you about a bug specific to my website is like me telling you about a dream I had last night—fascinating for me; incredibly dull for you.

For some reason, my site was being brought to its knees anytime I syndicated a note to Mastodon. I rolled up my sleeves to try to figure out what the problem could be. I was fairly certain the problem was with my code—I’m not much of a back-end programmer.

My tech stack is classic LAMP: Linux, Apache, MySQL and PHP. When I post a note, it gets saved to my database. Then I make a curl request to the Mastodon API to syndicate the post over there. That’s when my CPU starts climbing and my server gets all “bad gateway!” on me.

After spending far too long pulling apart my PHP and curl code, I had to come to the conclusion that I was doing nothing wrong there.

I started watching which processes were making the server fall over. It was MySQL. That seemed odd, because I’m not doing anything too crazy with my database reads.

Then I realised that the problem wasn’t any particular query. The problem was volume. But it only happened when I posted a note to Mastodon.

That’s when I had a lightbulb moment about how the fediverse works.

When I post a note to Mastodon, it includes a link back to the original note to my site. At this point Mastodon does its federation magic and starts spreading the post to all the instances subscribed to my account. And every single one of them follows the link back to the note on my site …all at the same time.

This isn’t a problem when I syndicate my blog posts, because I’ve got a caching mechanism in place for those. I didn’t think I’d need any caching for little ol’ notes. I was wrong.

A simple solution would be not to include the link back to the original note. But I like the reminder that what you see on Mastodon is just a copy. So now I’ve got the same caching mechanism for my notes as I do for my journal (and I did my links while I was at it). Everything is hunky-dory. I can syndicate to Mastodon with impunity.

See? I told you it would only be of interest to me. Although I guess there’s a lesson here. Something something caching.

Responses

Joe Crawford

How Latin America Revolutionized Baseball:

Some Latinos were able to bend the rules because of their skin color, but they were never considered “superstars” by the general public or media before 1947—except for one. His name was Adolfo Lugue from Havana Cuba, and he was considered a “white-Cuban.” In 1923, Adolfo won 27 games for the Cincinnati Reds and went on to play for 20 years.

Although he reached success, the majority of light-skinned Latino players of that time had a brief run with the league. In the 1950s, that started to change. In 1951, we saw the first two Latinos in MLB history make the All-Star game.

The Desert from Cat and Girl

Age is more than just a number for one candidate but not the other:

The other guy, on the other hand, does not have his heart in the right place. He does not care about what’s best for America. He only cares about himself. He is a declared authoritarian and fascist who will govern like one, and he has vowed to get revenge on his perceived enemies. The presidency is a get out of jail free card for him, and he will do whatever it takes to get it. The scary thing is, with the help and complicity of the corporate American media machine, he is well on his way to getting his wish. The old guy who has done a masterful public relations job of not seeming to be old, might very well beat the old guy who is not quite as adept and not making public perception his reality.

L is for Licensing from Nick’s 26 Days of Type, ongoing.

Vision 1993 from Tim Bray:

For me, that last point is at the center of everything. I want to be in a park at night and see fiery snakes climbing all the trees. I want to walk into a big-box store and have a huge glowing balloon appear over the Baking Supplies. I want floating labels to attach to all the different parts of the machine I’m trying to fix.

I think a lot about the Bridge novels from William Gibson quite a lot. But those Bridge novels continue to loom large. Virtual idols, virtual reality goggles, rampant poverty, hacking as a commonplace, everyone with a computer, virtual global communities, predatory global corporations. That’s the future we live in now.

Speaking of a bleak future suffused with authoritarians, let’s fast forward to the past where it was Donald Duck seconded to let folks know that Nazis suck: Duck and Cover: Donald’s World War II Short Subjects.

Webbed Briefs which I learned about via an offhand comment on Mastodon and are absolutely right up my alley. Puns, frippery, and whimsey plus markup, code, and a18y comments in tight video nuggets? I slept on this but now I enjoy them quite a bit.

WEBBED BRIEFS are brief videos about the web, its technologies, and how to make the most of them. They’re packed with information, fun times(TM), and actual goats.

Federation syndication

Although I guess there’s a lesson here. Something something caching.

Something something caching is definitely a quote of the day to me.

Raw Doggin’ Reality: 18 Months Above the Influence from June of last year from The Coyoteverse. I’ve bought a few pieces of art from Stardust Coyote over the past few years. Brilliant collages artist.

The biggest gift that sobriety gave me was time. I gained SO much time these last 18 months. No evenings lost to drunkenness where I can’t remember things clearly. No mornings (and let’s be real into afternoons sometimes) lost to hangovers. No extending a bad mood into the next day by medicating with alcohol and then dealing with a hangover. It’s amazing what 18 months of no hangovers can give you. I was able to work on art, finish projects, and enjoy time with my husband, friends, and family. I got up every day feeling pretty good and this was the biggest gift sobriety gave me. This is something I’ll remember even as I return to alcohol.

Move fast with broken things from mathowie:

From his instagram, I followed a link to his Facebook profile, and since he didn’t have much of a web presence, pretty much all his time was spent on Facebook. I expected to see his profile frozen in amber but strangely, on his birthday each year in early June, there were dozens of jubilant happy birthday comments from his Facebook friends. Scrolling back, you see the same pattern every year in June, dozens of people shouting happy birthday with happy emoji and GIFs and images.

My Mom’s been dead more than 10 years but I don’t have the heart to close her account on FB. It’s still a place to share about her. “Happy Birthday in Heaven” is a perfect kind of bittersweet remembrance. Nothing easy about it but it’s a nice kind of sadness.

That’s a good amount of links. Maybe not for you, but for me, to remember.

1 Like

# Liked by Marty McGuire on Monday, February 12th, 2024 at 7:12pm

Related posts

That fediverse feeling

Mastodon is a vibe shift in the best possible way.

JavaScript

Inside me there are two wolves. They’re both JavaScript.

adactio.com on Mastodon

@adactio.com@adactio.com

Indy web

Maps—they don’t love you like I love you.

Syndicating to Mastodon

Posting notes from my own website to my Mastodon account.

Related links

Mastodon is a gateway | Andy Bell

I’ve been very guilty of putting all my eggs in the Twitter basket over the last couple of years, especially, and all of that has been destroyed by one bellend billionaire. I’m determined not to make that mistake again and even more determined to make my little home on the internet—this website—as lovely and sustainable as I can make it.

Tagged with

The Demise of the Mildly Dynamic Website

It me:

Broadly, these are websites which are still web pages, not web applications; they’re pages of essentially static information, personal websites, blogs, and so on, but they are slightly dynamic. They might have a style selector at the top of each page, causing a cookie to be set, and the server to serve a different stylesheet on every subsequent page load.

This rings sadly true to me:

Suppose a company makes a webpage for looking up products by their model number. If this page were made in 2005, it would probably be a single PHP page. It doesn’t need a framework — it’s one SELECT query, that’s it. If this page were made in 2022, a conundrum will be faced: the company probably chose to use a statically generated website. The total number of products isn’t too large, so instead their developers stuff a gigantic JSON file of model numbers for every product made by the company on the website and add some client-side JavaScript to download and query it. This increases download sizes and makes things slower, but at least you didn’t have to spin up and maintain a new application server. This example is fictitious but I believe it to be representative.

Also, I never thought about “serverless” like this:

Recently we’ve seen the rise in popularity of AWS Lambda, a “functions as a service” provider. From my perspective this is literally a reinvention of CGI, except a) much more complicated for essentially the same functionality, b) with vendor lock-in, c) with a much more complex and bespoke deployment process which requires the use of special tools.

Tagged with

Mastodon is just blogs

Do you still miss Google Reader, almost a decade after it was shut down? It’s back!

A Mastodon server is a feed reader, shared by everyone who uses that server.

I really like Simon’s description of the fediverse:

A Mastodon server (often called an instance) is just a shared blog host. Kind of like putting your personal blog in a folder on a domain on shared hosting with some of your friends.

Want to go it alone? You can do that: run your own dedicated Mastodon instance on your own domain.

This is spot-on:

Mastodon is just blogs and Google Reader, skinned to look like Twitter.

Tagged with

Bird’s-eye View · Paul Robert Lloyd

I love not feeling bound to any particular social network. This website, my website, is the one true home for all the stuff I’ve felt compelled to write down or point a camera at over the years. When a social network disappears, goes out of fashion or becomes inhospitable, I can happily move on with little anguish.

Tagged with

Pinboard is Eleven (Pinboard Blog)

I probably need to upgrade the Huffduffer server but Maciej nails why that’s an intimidating prospect:

Doing this on a live system is like performing kidney transplants on a playing mariachi band. The best case is that no one notices a change in the music; you chloroform the players one at a time and try to keep a steady hand while the band plays on. The worst case scenario is that the music stops and there is no way to unfix what you broke, just an angry mob. It is very scary.

Tagged with

Previously on this day

3 years ago I wrote Prediction

What I’m hoping for in 2021.

5 years ago I wrote Back at CERN

Bringing web history alive. Again.

7 years ago I wrote From New York to Porto

From FOMO to imposter syndrome in a fortnight.

17 years ago I wrote Après Web Directions North

A great conference with the best post-conference activities ev-ah!

19 years ago I wrote The web is a many-splendoured thing

About a week ago, I was having a chat with Andy about all things web related. It seems that Andy and I use the web in very different ways.

20 years ago I wrote My iBook is iBack

All is well with the world once again. UPS delivered my iBook this morning after trying and failing yesterday morning (nobody home).

20 years ago I wrote PHP sendmail frustration

I spent hours last night tearing my hair out trying to fix a mystifying PHP problem.

21 years ago I wrote Darwin Day

Happy Darwin Day!

22 years ago I wrote The Always Amusing Euphemism Generator

Have some fun winding the pork wristwatch.

22 years ago I wrote The new iMac Animations

Here’s a match made in heaven: Pixar have come up with a couple of animated shorts featuring the new iMac

22 years ago I wrote Examples of abuse of the Apostrophe

The Apostrophe Protection Society presents a rogue’s gallery of snaphots depicting some of the worst offenses against the apostrophe.

22 years ago I wrote Java Spectrum Emulator

This is fantastic!