We've been running Advagg on a production site for about two months now to combat the 'broken CSS for anonymous users after cache flush' issue, and it had been working fine. Yesterday, requests to the site were just spinning. I was able to log in to the site after a few minutes. Disabling Advagg fixed the problem immediately.

I noticed that on some pages, CSS or JS was not being aggregated as it should have been, and all files were being @import-ed. I've migrated the site to a development environment to try to replicate the issue but it hasn't happened yet after re-enabling Advagg there. The only module enabled is Advanced CSS/JS Aggregation.

I noticed in the README that it requires you disable core CSS and JS aggregation. This was not possible in our environment since these values are enforced in settings.php. We do this on our university Drupal deployment for all sites, so disabling these settings is not possible, but Advagg was working fine during the last few months with core aggregation settings enabled. Are there definite known issues with this configuration? I didn't know about ?advagg-debug=1 until just now, so if I can replicate the issue, I'll try to get debug info.

I've attached the settings in use. Thanks in advance.

CommentFileSizeAuthor
qdr5.png117.27 KBvinmassaro
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

I haven't tested advagg under any kind of load with core's aggregation enabled.

vinmassaro’s picture

Can you think of a way that I can dynamically enable or disable core CSS/JS aggregation? As in, the value of preprocess_css and preprocess_js in $conf in settings.php based on Advagg being available? I tried function_exists('advagg_init'), module_exists('advagg'), and variable_get('advagg_enabled') to try to check the existence of it and set $conf accordingly, but it doesn't seem to work. I'm not sure if these conditions will run in settings.php. Thoughts?

mikeytown2’s picture

http://drupalcode.org/project/advagg.git/blob/refs/heads/6.x-1.x:/README...

You can completely disable advagg by using a query string parameter. You can also enable core by query string parameter as well. The user needs to have the permission "bypass advanced aggregation".

Try adding ?advagg=-1&advagg-core=1 to the end of a url to test this out.
example url: www.example.com/node/1?advagg=-1&advagg-core=1

With the advagg module enabled this will turn advagg off and core's aggregation on. See advagg_init() for an example of how this works.

vinmassaro’s picture

Thanks for your quick response. I wasn't very clear in my question. We use a settings.php template in our deployment that sets $conf and enforces CSS and JS aggregation. Since core aggregation should be disabled while using Advagg, I was looking for a way to dynamically set those values based on Advagg being in use or not. Some sites may use it, many won't. This is a few hundred sites in a university non-multisite deployment. We want core aggregation enabled by default.

mikeytown2’s picture

settings.php doesn't know about what modules are loaded so changing the template wont help. If you look at the bootstrap process the first thing drupal does is load conf_init() which loads settings.php; thus things inside of settings.php can not be very "drupally" as in checking what modules are enabled, as the database isn't accessible.

I would recommend creating a module that implements hook_init and do something like this

function my_init() {
  global $conf;
  // If advagg exists and is enabled, turn off core aggregation. 
  if (module_exists('advagg') && variable_get('advagg_enabled', ADVAGG_ENABLED)) {
    $conf['preprocess_css'] = FALSE;
    $conf['preprocess_js'] = FALSE;
  }
}
vinmassaro’s picture

Status: Active » Closed (fixed)

Ah, I didn't realize that is what you meant. It works perfectly! Thanks again!

vinmassaro’s picture

Status: Closed (fixed) » Active

Re-opening because I'm still seeing major slowdowns after this is working. Pages are taking a very long time to load (60 seconds) and the page is not attaching advagg aggregates (CSS and JS are being added as if aggregation is disabled). I'm not sure if it's related to the fact that files are stored on NFS and there may be a lot of files sitting in sites/default/files for sites that I am seeing this slowdown on. It seems to work OK on sites with not many files in sites/default/files.

mikeytown2’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)

Can't reproduce the reported issue. Issue is old so going to close it out.