Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate JS and CSS throwing CPU off the roof #259

Open
joseairosa opened this issue Jun 26, 2019 · 12 comments

Comments

@joseairosa
Copy link

commented Jun 26, 2019

Hello,

I've installed today the plugin on my online shop https://animegami.co.uk. Upon installation the whole website became unresponsive. Looking at the logs and usage graphs I can see that the bottleneck is with php-fpm (7.2).

image

The two spikes you see there were from when I enabled the plugin.

After a good amount of investigation, I was able to narrow it down to the Aggregate JS and CSS option. As soon as I turn this on, the servers just go bananas. Now, I'm fairly sure there's nothing directly wrong with the plugin but there's definitely something at play here.

Couple notes:

  • eCommerce website, woocommerce
  • Over 20 concurrent users continuously throughout the day (roughly 2500 unique users/day)
  • I have criticalcss addon as well

Question?

  1. Could this be related with purging?

Any help really appreciated.

@futtta

This comment has been minimized.

Copy link
Owner

commented Jun 27, 2019

@joseairosa

This comment has been minimized.

Copy link
Author

commented Jun 27, 2019

Hi @futtta, I have both on.

@futtta

This comment has been minimized.

Copy link
Owner

commented Jun 27, 2019

@joseairosa

This comment has been minimized.

Copy link
Author

commented Jun 27, 2019

That's a good point. I will try it out.

@joseairosa

This comment has been minimized.

Copy link
Author

commented Jun 27, 2019

@futtta much less pronounced, but still incremental CPU usage to the point that it just uses all available php-fpm processes. I can see them timing out.

Any thoughts?

Just one other piece of information:

  1. I have a scalable infrastructure with various instances behind a LB.
  2. All instances share the same AWS EFS. There could be higher IO, but I've been using wp-rocket with no problem.
@futtta

This comment has been minimized.

Copy link
Owner

commented Jun 27, 2019

@joseairosa

This comment has been minimized.

Copy link
Author

commented Jun 28, 2019

-> were you also doing CSS/ JS aggregation & minification in WP Rocket?
Nope, nothing.

-> can you try with just CSS or just JS optimization to see if there are significant differences?
Will try it out. Need to wait when traffic is sllightly lower, otherwise it just completely breaks the website.

-> do you have access to profiling tools or new relic or something like that that could help pinpointing where things are slowing down?
I do, yes. The graph I shared above is from newrelic. I looked into the hooks and plugins and it's defintely related with js and css in the plugin.

@futtta

This comment has been minimized.

Copy link
Owner

commented Jun 28, 2019

OK, re. new relic; can you differentiate between autoptimizeStyles.php and autoptimizeScripts.php and/or between the CSS & JS minifier

@joseairosa

This comment has been minimized.

Copy link
Author

commented Jun 28, 2019

After initial test looks like it's related with JS side. I've been running with just CSS for 24h and no issues at all. As soon as I turned on JS optimisation (only first option and aggregation, nothing else) CPU started to go up and up. I'm monitoring on new relic... will report back soon.

@joseairosa

This comment has been minimized.

Copy link
Author

commented Jun 28, 2019

A couple notes:

Looks like initial huge load could be related with turning on CSS and JS at the same time, with no cache?
Still overall feel the website slower. Waiting for a bit more data from new relic

@futtta

This comment has been minimized.

Copy link
Owner

commented Jun 28, 2019

@futtta

This comment has been minimized.

Copy link
Owner

commented Jul 23, 2019

hey @joseairosa how are things running now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.