Server Resources Randomly Max Out

Hi there,

I’ve been having a problem now with two large sites I have. One of them we’ve been having this problem with for over a year. Many times per day, the server randomly jumps to 100% CPU usage for anywhere from 30 seconds to 10 minutes at a time. We’ve been troubleshooting it aggressively but haven’t solved it.

We have a second site now, also using Pro theme and also large, that has started exhibiting identical behavior.

We’ve done extremely extensive troubleshooting and testing with error and access logs, disabling other plugins, and just generally doing everything we can.

The one consistent thing seems to be that when the CPU spikes, people are usually editing pages on the site with Pro. It’s hard to say that with 100% certainty but it appears to be the case. The only thing is, I can’t seem to recreate it.

I was wondering if you could take a look at a snippet of my access log here to tell me if it’s normal. This is from right about the time resources spiked earlier today. Looks like someone is editing a page and working with Pro,.

I see a ton of “Cornerstone-endpoints” in there, almost to an extreme extent. Is that normal?

Do you know anything about this issue? Have you seen it before??

I’ll post the log in a private response.

Hello Brian,

Thanks for asking. :slight_smile:

Are you running the website on a shared hosting environment? If the website is running on shared hosting then there might be instances of spike in resource usage. The log file data you have shared seems to be fine and I don’t see much of abnormal activity. Having said that, please try to completely deactivate Wordfence and try editing again.

I also suggest you to take a look at inputs shared in following thread:

Let us know how it goes.

Thanks.

Hi Prasant,

Thank you for your help and analysis. It is a shared environment but each instance gets dedicated resources so I don’t think it’s related to anyone else.

We have tested with and without Wordfence, since that came up quite a bit in the logs, but unfortunately it did not make a difference.

Could you send me the direct link to that thread? I can see the excerpt but I don’t see a link anywhere to look at the rest!

Hey Brian,

Here’s the link to the thread https://theme.co/apex/forum/t/server-through-the-roof/4526/11

I’d recommend that you test Pro or Cornerstone alone to determine if it’s really taking out your server resources.

If it does, the reason could be too much writing in the text elements. Each character you input in a text element is sent to the server and then brought back to the browser for you to preview. Here’s a similar case: https://theme.co/apex/forum/t/major-performance-issue-with-admin-ajax-php/45589

Please try telling your editors to write separately in a notepad or other offline writing tools and just paste the text into a text element after writing. This is just to test if what I said above is the cause.

Also, how many editors are writing at a given time?

Thanks.

1 Like

Hi Christian,

THAT’S IT! Wow, I’ve been searching for the cause of this for something like a year. While it always seemed like it might be related to Cornerstone, we were never able to recreate it so we couldn’t prove it.

Until now!

Using just myself, I opened two tabs up and began editing the home page with Pro. I just typed randomly in text boxes back and forth between them. Within about one minute, the CPU maxed out and RAM spiked as well.

And this is a beefy host environment. It’s a server with 3 cores and 6gb dedicated RAM that happily services tens of thousands of reqquests per day without topping 40% usage and averaging closer to 20-25%.

And a mere two edit screens was able to take the entire thing down in a minute.

Now, I’m by no means a rockstar programmer and my knowledge of server administration is somewhat limited, but this is a problem I knew was going on since long ago, and it literally took me an entire year to finally figure out the cause. And again: just two people editing at once was enough to bring the whole thing down.

My point being: imagine just how many people are almost assuredly having this same problem? How many countless others are suffering with these same issues but cannot, for the life of them, figure out what’s causing it?

So please, I beg of you: bring this to the developers, and make it extreme top priority for development. We need to either change the polling rate, or maybe add a “server friendly” mode or something. Or perhaps, the solution is something simple. If the purpose of the constant ajax requests are to render shortcodes, maybe have some simpler code that just waits until there IS a shortcode, and then calls everything to render it. I’m not sure!

Either way, I will certainly be informing my team to use an external text editor. I know there are a lot of people who actively use these sites so it will be difficult to train everyone, so a fix really would be fantastic.

In the meantime, I will also be posting a report about this issue on my highly-trafficked blog (according to SEM Rush, a Google search for “x theme” brings us up as #14!), and I would love to be able to post updates there and, more importantly, the fix! So anything you can tell me would be extremely helpful.

Thank you for your help! While slightly bummed it’s not something I can easily fix right away, I am quite pleased to have finally figured out the cause.

Oh and I wanted to attach a screenshot of my server usage. You’ll see where I started typing in just the two pro edit screens.

I have performance issues while working with Pro locally (Local by Flywheel) Getting “Out of RAM” warnings very often while editing in Pro. Must be the same issue.

A proper permanent solution would be greatly appreciated.

Hi There,

I’ve submitted this to our issue tracker so the developers will be made aware of it, In the meantime please follow Christian’s advise above to type your content on a text editor application first and just paste it on the Cornerstone once done to reduce the request.

Thank you for understanding,

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.