Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1212349

    After much investigation Friday, we discovered that the source of the slowdown/crashing on one of our sites was due to the auto-minification feature of Enfold. We have over 100 sites running Enfold on our servers.

    To reduce page load, Enfold will dynamically assemble stylesheets out of the components in use on a given page (so for example, a page with a slider and a two column layout would include the styles for both of those, but not the “Image” pagebuilder CSS). The problem is that there appears to be a bug in Enfold; it will continually regenerate these stylesheets.

    This causes two problems:
    1) The /wp-content/uploads/avia_dynamic/ folder will fill up with “dead” stylesheets. We have seen upwards of 16GB of dead stylesheet data from this. This does not cause site slowdown, but causes us to run out of space on the server.

    2) A cell in the wp_options table is continually updated with references to the new style concatenation. The old records in this cell are never cleared, which leads to it continuously increasing in size. When a page is loaded, Enfold attempts to load the contents of this cell into the runtime memory.

    Our sites have (usually) about 256MB of runtime memory available, shared between all users of the site. What happened on this one site was that the cell in the wp_options table had reached around 50MB in size. If as few as 6 requests were to hit the site at the same time, this would cause it to seize up and stop working. In addition, loading 50MB of data from the database per request was causing each request to be significantly slower than expected, which meant that the window for 6 requests to hit the site was dramatically decreased.

    We had run into the first of the two problems before, and had found a solution. Unfortunately, the solution requires disabling the automatic minification of the stylesheets in Enfold by adding the following filter to the site:

    add_filter('avf_merge_assets', function() {
            return 'none';
    } );

    Given that this can cause both response-time slowdown and site crashes, we have decided to implement it on every Enfold website.

    #1212513

    Hey Caorda,

    Sorry for the problem. Does it make any difference if you activate the option to delete the old CSS and JS files under Enfold->Performance?

    Best regards,
    Rikard

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.