Faults with CPU load spikes

Hi there,
I have just become aware that S2member is causing faults and spiking my CPU load each time. Is there some way within S2 to track down what is causing the problem?

I had a look at my error logs…see nothing there

thank you

Hi Andrew.

S2member is causing faults and spiking my CPU load each time

Each time what? that it causes faults?

What do you mean by faults?

Do you know what page or action is related to that behavior?

Thanks :slight_smile:

The CPU usage charts show the issue.
My host provider tells me that he can see it is S2Member.

That is all I know at the moment.
S2member is pretty much dormant at the moment…it basically stores data from past interactions…very little current active usage

thanks Cristian

1 Like

Let me know when you get more info from your hosting provider. :slight_smile:

Here is one url that keeps reappearing:

does that help?


I see. That’s the s2member-o.php script, that serves the CSS and JS.

I don’t see why they’d spike, though… It actually does less than a normal page, because it only loads the minimum.

Do they have any additional info they can give? Is there a query or something that is causing it to hang?

Thanks! :slight_smile:

You should enable under s2member general options —> CSS/JS lazy loading --> Yes lazy load.

I did not see much CPU use by the js/css added by s2member - but for the customer the load times increases about 0.3 to 0.5 seconds if the js is loaded - so it should only be loaded if necessary (meaning on your checkout pages)

Thanks for your suggestion, however the pages of errors occuring concurrently suggests the issue is not as simple as that.

Thanks for your message, Andrew, got the info.

Well, yes, that’s the s2member-o.php script we were talking about…

What I wonder is what page that was called from, was the user logged in or not, things that may make a difference on what that script does.

You see it doesn’t take the same on the different entries, so something different is happening on each. I’m sure you don’t get those times/loads each time the script is loaded, only happened some times.

Any extra details you could provide, would be great. Can you reproduce one of those calls with the time and spike you saw before? or does it seem random at the moment?

And if you find how to reproduce the spike, can you try deactivating other plugins and doing the test again? Same for the theme… I wonder if that could play a part.

Also, has your database been optimized lately? Maybe there’s a query that’s taking a while. I don’t know… Can your host tell you if there’s a database query that may be matching those entries you showed me?


I see that the spikes are of memory, not cpu. CPU says 0% in the log you sent me, or did I miss it?

By the way, in the one that shows the times, besides the s2member-o.php ones, there are many more for “/?wc-ajax=get_refreshed_fragments” that consistently take more time, between 30 and 60 seconds, though. Seems to be WooCommerce. https://www.webnots.com/fix-slow-page-loading-with-woocommerce-wc-ajaxget_refreshed_fragments/

And there are other ajax calls mentioned that take very long: “/wp-admin/admin-ajax.php”. You may want to look into that.

There seems to be something about your site that is slowing it down, and may not be that s2member-o in particular is slow, just showing up there as do others. I’m inclined to think there’s something about the database.

I look forward to your update. :slight_smile:

Thank you for your comments and suggestions Cristian.
The CPU does not feature there but the site has been limited at different times because of excessive CPU use.
The DB may be a problem but it does not show up in the snapshots …not sure if it would …

I will look into the WooC issue etc See what can be done to eliminate that at least.

However I am still not sure if that explains why S2member features so prominently in the info I sent.

thank you,

A bit more data confirming issue with S2 - https://www.dropbox.com/s/3jie2swwwodjabn/Weiler%20gmetrix.png?dl=0

Weirdest thing.
I tried to track down ajax problem by disabling plugins etc and re-enabling one by one… the ajax problem did not re-appear…

will need to keep checking
S2 load times did not alter throughout. FYR

Will check CP again tomorrow to see what happened over previous 24 hrs


Thanks for the update and additional info, Andrew.

So when you deactivated the other plugins, you still saw s2-o’s numbers unchanged. That’s kind of expected because no other plugins or theme are loaded in s2Member-only mode.

I’m trying to understand what part of the s2member-o load is doing that. You see, s2member-o is like loading WP with only s2Member to keep things down, so I don’t understand how it takes longer than the WP page.

Can you see where it’s hanging? Do you see a query in your logs?

I’m guessing you’re using a recent version of WordPress.

Can you reproduce those numbers in a clean installation of WordPress and s2Member?

Oh, I had missed this link. I just tried it and get a 403 by CloudFront…


What are you using to make the JS and CSS to be served from the CloudFront CDN? Maybe you need to tweak that a bit, or the CloudFront permissions?

BTB I optimised DB 2 days ago
As for the rest, I believe a lot has been dealt with in our private thread.

1 Like

what fixed it @Wandriska ?

It appears like there was some plugin issue elsewhere which appears to have been resolved by my testing…deactivating and reactivating all the plugins one by one. Ajax script was “misfiring”…has now all but stopped.

There is still some residual issue on site, but S2 does not appear to figure in it…

1 Like