Wordpress site is spiking - what can I do?

My site is on a shared server (top of 3 levels) - what can I do on cloudflare to help avoid 500 errors?
I’ve done all the normal stuff (optimize pictures, etc)

It depends on the site, but you didn’t tell us your site’s URL. Page Caching on Wordpress can help. Busy sites need better hosting, especially if it’s a commerce site. You could use Cache Everything, but causes problems when improperly configured.

It’s HotPopSongs.com.
Normally ~1000 visits a day, no problem.
Spiking this past week with 30-50,000 a day.
I’ve done all the normal caching and minimizing stuff, including Cloudflare.

The front page does not look dynamic (comments, etc), so I would add a Cache Everything rule for just that page:
Page Rule #1) Match hotpopsongs.com/ and add setting: Cache Level (Cache Everything), Edge Cache TTL (1 day, or whatever you’re ok with).

Remember that that page is cached for a day, so if you make changes, I suggest you Purge Cache by URL and just purge the homepage URL. I don’t think it needs the HTTPS part, but you can experiment with that.

Again, you didn’t say, but you should have a Page Cache plugin set up on your site. I like WP Fastest Cache because it’s simple and effective.

Thanks… I do have cache plugins set but it was/is overwhelming the server.
I did as you said (exactly what I think will work)
Much appreciated!!

1 Like

You haven’t set a Cache Everything page rule for the home page. That will take a huge load off your server.

I had turned it on for about an hour, which increased the data base error connection.

  • I was never able to get it while it was on.

When I turned it back off, I could get in about 1/2 the time.
Turned it on again…

Turned it on again, and no connection via mobile or desktop.

It looks like the rule is off and it’s still getting the database connection error. Cache Everything won’t cache an error condition, so it’s highly unlikely it’s related to your database connection error.

Turned it on again.
Google Analytics says there ~440 on the site live, and its bumping all around, so somebody is on the site even though I can’t be.
I really appreciate your persistence in helping me!

I added Argo as well. I’m hoping that w ill help.

Argo just speeds up existing connections. With a slight assist on tiered caching so not all new requests for static files hit your server.

Well…that just kicked in nicely. The main page showed up in about one second, then the rest of it continued to load, so the visitor experience just improved a lot.

Some nice stats for you to look at:
https://www.fastorslow.com/app/profile/b72420d3-b9eb-5add-b734-e6968483d8a1

I just noticed your comments are from a Facebook plugin. This should make Cache Everything easier since your comments aren’t hosted on your site.

Try these page rules:

  1. Match: example.com/wp-admin/* (Bypass Cache)
  2. Match: example.com/wp-login/* (Bypass Cache)
  3. Match: example.com/* (Cache Everything & Edge Cache TTL)

That should put the whole site into Cache for however long you’ve set Edge Cache TTL, but not mess up wp-admin. Bear in mind that if you browse around your own site while Logged In, it may cache that page with the backend links showing, like the WordPress Admin Toolbar if you’ve set it to show on the entire site while logged in. And any “Edit” links on pages you see as an admin.

For the whole site, should I have hotpopsongs.com/*
Cache Level: Cache Everything
OR
hotpopsongs.com/
Cache Level: Cache Everything

The first one. It will cover the main page, and all other pages. But make sure it’s the last rule, so wp-admin and wp-login don’t get caught up in the cache.

I just figured it out.
Now I’m the 600 active people on the site range.
They stay for 30 seconds, which is about right, so all is well.
Thanks soo much!

1 Like

How long did you set Edge Cache TTL for? Hopefully at least 24 hours, since you seem to post about once a day.

EDIT: Looks like about 5 days. That should be good. You may have to manually purge the entire cache when you add content, though you can probably get away with only purging the front page URL so everything else stays in cache.

Actually I just re-schedule pages at one year intervals so it is timely (Christmas songs come up in late November to mid December for example.

Normally this site gets ~900 to 1200 visits a day.
I’m at 67,000 so far today.
This, I’m sure, is temporary.
People are bored at home, looking up the number one song when they were born, or age twelve.
It’s crazy, and getting bigger every day.

I appreciate you taking the time to help.
I’m an organic SEO guy, not so technically adept.

1 Like