• Resolved alexmvp

    (@alexmvp)


    Hi,

    We are seeing a high CPU and Network Usage when Auto-Optimize (2.7.0 or 2.7.2) is enabled on a large site, the site is in pre-production, it doesn’t have live traffic, we are testing crawling a sample of 2770 different pages using SiteBulb only TTFB with 10 threads, cache is disabled, we are using WP 5.3.2, we were able to isolate the problem exclusively to AutoOptimize plugin as follows:

    When AO Plugin is enabled:
    Average TTFB (Time to first bite) is 2.4s
    CPU is steady up to 95%
    Network consumption : 850 mbps (mostly data received from mysql server)
    Pages Per Second 3.5 pps

    When Plugin is disabled:
    Average TTFB (Time to first bite) is 613 ms
    CPU is about 15%, some peaks to 35%
    Network consumption : 100 mbps (mostly data received from mysql server)
    Pages Per Second 13 – 16 pps

    Both tests using the same machine with Ubuntu 20.04 , nginx 1.17.10, php 7.4.3, 4 Cores, 16 GB memory using a dedicated MySQL instance 4 Cores and 40 GB memory. No other load on the web server besides this pre-production website.

    Any help really appreciated.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    you probably have a lot of AO cache misses, causing the CSS and/or JS to be re-minified time and time again. what are your AO settings?

    Thread Starter alexmvp

    (@alexmvp)

    Optimize JavaScript Code? [X]
    Aggregate JS-files? [X]
    Exclude scripts from Autoptimize:
    wp-includes/js/dist/, … list of scripts

    Optimize CSS Code? [X]
    Aggregate CSS-files? [X]
    Inline and Defer CSS? [X]
    Exclude CSS from Autoptimize:
    wp-content/cache/, wp-content/uploads/, admin-bar.min.css, dashicons.min.css

    Optimize HTML Code? [X]
    Cache-Folder:
    …/wp-content/cache/autoptimize/
    Can we write? Yes
    Cached styles and scripts 12 files, totalling 951.61 KB Kbytes

    Lazy-load images? [X]

    Critical CSS
    Account configured, long list of URL’s as auto-rules
    A few Conditional Rules

    Extra:
    Remove Google Fonts

    Preconnect to 3rd party domains
    List of URL’s

    Preload specific requests
    /wp-content/themes/twentynineteen-child/js/jquery-3.3.1.min.js

    Async Javascript-files (advanced users):
    One javascript file

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, what about “aggregate inline JS” and “aggregate inline CSS”?

    Thread Starter alexmvp

    (@alexmvp)

    They are off as they were causing issues.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, so not cache misses … have you tried narrowing this down somewhat, e.g.;
    * does this also happen when “optimize JS” or “optimize CSS” or “optimize HTML” or “lazyload images” are off?
    * specifically for CSS; does this also happen when “inline & defer CSS” is off?
    * do you have new relic or similar that can help identify bottlenecks?

    Also, (working on the side with the MVP) I added a number of Conditional Tags, based on Page Templates. The CSS used is identical per Page Template so do not need at the individual page/url level. Correct? These have all POOF disappeared. How is this supposed to work? The site is around 130K pages…. And 11 Page Templates cover about 90% of the site.

    Thread Starter alexmvp

    (@alexmvp)

    Yeah we’re tried turning things off. Turning off inline CSS decreases a bit the time, but it’s only deactivating the plugin completely that gets the full impact, also big concern is that Network usage is 8X when plugin is on, and CPU is 6X.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Morning Alex;
    Something’s very off there; whereas I could understand under specific circumstances TTFB going up some and how the same circumstances could impact CPU usage a bit, I don’t see how CPU could be X6 and even more bizarrely network usage X8 (critical CSS when communicating with criticalcss.com will generate some network traffic, but can never explain a X8 network usage rise). Also manual rules vanishing just like is clearly not something that is supposed to happen (obviously).

    Now the question indeed is; how to proceed. Do you have New Relic on the site? If so, can you add me (futtta-at-gmail-dot-com)? Can you provide me the URL of the site (feel free to mail it, also futtta-at-gmail-dot-com)?

    frank

    Thread Starter alexmvp

    (@alexmvp)

    Hi Frank, thank you for the response, we are setting up New Relic and will discuss with team on how to add a temporary account.

    Thread Starter alexmvp

    (@alexmvp)

    Hi @optimizingmatters, we added NR to the site and ran two tests this morning, same sample URLs, same server, variation is just AutoOptimize plugin enabled/disabled.
    You should receive an invite to join our NR instance.

    Thank you in advance for your help.

    Hi Frank, after you get in, will set up a couple test Manual Rules. Was trying to set up for major sections (page templates or post templates) that use the same CSS. A couple of questions. A) Assume that if a manual rule is in place, that url based rules for items using that TAG will not be created? and B) Do I need to delete existing by url Auto rules?

    Here are the sections for Conditional TAGS:
    post_name meta_value
    /colleges/by-major/agriculture-general page-college-by-major.php
    /colleges/by-state page-college-by-state.php
    /colleges/harvard-university/reviews page-college-reviews.php
    /admissions-advice/how-important-are-standardized-test-scores-compared-to-other-pieces-of-the-application page-expert-admissions-advice.php
    /scholarships/our-scholarships page-our-scholarships.php
    /scholarships/athletic page-scholarship-group.php
    /scholarships/athletic/baseball-scholarships page-scholarship-sub-group.php
    /colleges/yale-university/reviews/what-should-every-freshman-at-your-school-know-before-they-start single-college-review-question.php
    /colleges/montclair-state-university single-college.php
    /scholarships/our-scholarships/superpower-scholarship single-our-scholarship.php

    • This reply was modified 4 years, 6 months ago by haslamjj.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    sorry for the delayed response haslamjj; you can indeed create manual rules based on templates used, which should stop path-based page rules from being automatically created, but you will have to remove the existing path-based AUTO rules (as once created they are used and path-based rules take precedence).

    hope this helps,
    frank

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘High CPU and Network Usage with Auto-Optimize’ is closed to new replies.