My blog (@coxy) is hosted on a very small server package from the hosting company. It costs me about £10/month and does the job just fine.
Until I installed the #ActivityPub plug-in on #WordPress and now every interaction I get from #Mastodon to my WordPress blog takes the site offline.
@matt In what way does the site go offline? Does the PHP service get killed?
Does anything show up in the error logs?
@thomasp I don't know. I don't know how to do server management.
...that's why I outsource oslo.town hosting to masto.host
Let me go and check the logs.
@matt certainly doesn't seem good...
Might be worth asking your hosting provider if they have any idea what's happening. If it is somehow taking down the PHP-FPM service (or whatever PHP backend is in use), then that's pretty unusual, and something they should look at.
@thomasp I'm guessing its due to all the requests coming in from way over 300 servers at the same time.
You can see when the requests stop being successful and start failing. I think it triggers some sort of limit on the server.
@matt Could be, yes. If PHP-FPM isn't configured for a high performance setup, it could well get overwhelmed by a flood of requests like that.
Either the settings need tweaking (which is probably a thing only the hosting provider could do), or use of server-side caching could help.
@matt I'm curious if those requests for / are fetching with a JSON accept header, or if they're actually fetching the HTML of the front page. Can't remember enough about the fediverse workings...
"After consulting with our Tech team, it would appear to not be a server config issue on our end, rather it would be a plugin trying to communicate with 3rd party software.
If you can find a specific PHP variable that may be causing the issue, we can look to increase it, but it likely warrants a web developer to also investigate the matter.
Another alternative would be moving you to a more powerful server subscription to accommodate the higher CPU usage."
@annika Thanks! Will take a look
@thisismissem I have Cloudflare set up, but the site still goes down
Does this make sense: https://oslo.town/@matt/111693835980201114
Now, after moving the wp-cron.php tasks from running as default, to scheduling them in the backend (cPanel), the site throws up a database error now for a minute or so instead of... just not loading at all.
Any advice welcome.
@matt I've nothing, cc @pfefferle any ideas?
@matt @thisismissem WP_Cron will not be triggered by external calls (at least not by ActivityPub). It might be the default behaviour, but then it shouldn't cause a lot of load if there is nothing to trigger.
It's very hard to get a page cached properly on a small/low price hosting plan. Cloudflare has some issues with ActivityPub requests: https://dustinrue.com/2023/09/wordpress-activitypub-and-cloudflare/ and caching does not always vary between Browser Calls and ActivityPub Calls: https://github.com/Automattic/wordpress-activitypub/issues/580
@pfefferle @matt @thisismissem Yeah, I learned a very painful lesson when I hosted WordPress on a cheap plan years ago. As soon as a certain number of people viewed the site at the same time, it would crash.
I think I was using GoDaddy at the time.
Also, security was a pain to maintain.
@matt @thisismissem Have you tried WP Super Cache? This works really nice with ActivityPub and I think they also support API caching.
@pfefferle @thisismissem Thanks for the tips and advice! I'll install WP Super Cache and see where I get with the rest of this!
Appreciate the support.