Mike, when I did apply the full Drupal method outlined for advagg's Drupal based 404's, I got slower (and skewered) response times for most static assets pulled via advagg's aggregation through a CDN. This given Drupal 404 method handling certainly made the advagg 'report' status happy - but real life benchmarks indicated I had a 40% slower response to static asset requests.
I went back to do handling this the 'previous' Nginx way (fast selected 404's that Drupal only will only ever see for for 2 chosen locations -> imagecache + advagg + more as required).
Testing: Benchmark testing indicated that the 'lost' 40% performance was restored. However, 'advagg' does complain - about my setup not being so 'cool'. (Is this a legacy of the Apache piglet syndrome coding factor?)
So, for me, after days spent on a variety of mod's for this advagg aggregation testing, I am about to hack out (grin) advagg's 'report' reasoning on 404 drupal handling. I suspect it was reasoned more for Apache +Drupal + .htaccess logic. For despite all the report 'complaints' issued by advagg reasoning - it works fast - with nginx + php-fpm. I find I have forgotten most of the 'Apache methods' I once needed and coded (2 years ago)!
Have you thought about some serious Nginx compat? I am....(have)
Great project by the way! Just kindly allow some of your good patience to extend those D6's that have moved the RU 'nginx' Drupal way. I think there is more than just me?
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | advagg-1169702-30.patch | 12.58 KB | mikeytown2 |
| #18 | debug.png | 76.64 KB | mikeytown2 |
| #5 | advagg-1169702-5.patch | 3.63 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 commented#1116618: Need a nginx setup doc
People have gotten this working with nginx.
Comment #2
Peter Bowey commentedWorks fine for nginx Mike. Just concerned with the advagg 'status report values' of doing so....
Comment #3
mikeytown2 commentedRun this code as php input and let me know what you get
You should have this for data
And this should be in the headers
Comment #4
mikeytown2 commentedWhat I should do is have admin/settings/advagg/info display this information for you in one of the fieldsets.
Comment #5
mikeytown2 commentedwith this patch you can go to "admin/settings/advagg/info" select "Asynchronous debug info" and it should output the correct debugging info. Patch has been committed.
Comment #6
Peter Bowey commentedRefer #3, #4, and #5
Thanks Mike, *much appreciated* - will help work through this... (later)
For the moment, a 'heads up' on a related [nginx] issue; when I run advagg rebuild, I note that it rapidly opens a lot of http connections (probally normal). I get nginx warnings that 'hit over' my current nginx domain setting 'max connection limit' [gulag]; eg [nginx.conf]
Captured nginx logs during rebuild:
I am 'bashing away' at improving this nginx<->advagg marriage in between actual work projects...
... 'more to come' ...
Comment #7
Peter Bowey commentedreferring #6
Just had a rather large 'advagg rebuild' speed improvement = 185% [cool]
I increased the nginx 'max connections limit';
[limit_conn gulag 20;][Conclusion:] advagg rebuild does open a lot of async' http connections! That is good!
I just did not expect it,... hmm what about DdoS limits.... OK there are other ways....
Comment #8
Peter Bowey commentedBy heck, the *more http connections* I allow, the faster goes the advagg rebuild.... +400%
Truly we have a async http, now for some DdoS limits.
Comment #9
Peter Bowey commentedReport for #5
Notes 1: I note that this is nginx's '404' response and not what should be sent to Drupal! Will investigate!
Notes 2: My commercial CDN [Edgecast] strips out advagg's header append [X-Advagg] +
<!-- advagg_missing_fast404 -->!Above is 'More or less proven' by routing to my [local] own CDN.
Will now 'code' around this problem...
Comment #10
Peter Bowey commentedOK, (change = no Nginx 404 handler) we now have the correct 'advagg debug' report:
However, advagg reports this status (which is the concern that I have been chasing):
Comment #11
mikeytown2 commentedWhat does the CDN debug output look like?
Comment #12
Peter Bowey commentedHave not done CDN debug yet?
However, I have noted this problem doing it 'the Drupal 404 way' (for advagg):
A short 'wait' and the above 500 error becomes a live static asset.
This does not occur unless I 'give in' to the Drupal 404 method.
OK, which CDN 'debug' are you referring too?
Comment #13
mikeytown2 commentedIt should be below the normal one on the info page with he CDN url
Comment #14
Peter Bowey commentedRefer to #12
The above nginx 500 error' shows a stream of errors like this in [nginx error log]:
Will investigate my nginx.conf settings :)
Comment #15
Peter Bowey commentedRefer to #11
Comment #16
mikeytown2 commentedOn admin/settings/cdn/details what mode are you running? Origin Pull or File Conveyor?
Comment #17
Peter Bowey commentedI would hardly call that 'debug' option (for CDN).
It is more CDN stats (enable)
Comment #18
mikeytown2 commentedThere's a second text area below the first one; what does it say? It should have the CDN url.
See attachment for example
Comment #19
Peter Bowey commentedThank Mike!! :)
Interesting, compared to the above *.png sample???
Comment #20
Peter Bowey commented#19 looks like a return error for an incorrect URI - via drupal_http_request() in common.inc
Hmmm... looking....
Grep search in advagg folder:
Possible area I need to look at is: (in advagg.install)
Looking deeper.
advagg.admin.inc
Comment #21
Peter Bowey commentedStep 2: Debugging the URI used in both advagg's [advagg.install] and [advagg.admin.inc]...
Logic: I placed 2 strategic PHP error_log() placements at the value in $url_cdn - before the function call to drupal_http_request($url_cdn). See code fragments above...
The value of $url_cdn (in both places) is:
/sites/peterbowey.com.au/files/advagg_css/css_missing11714652981306508212_0.cssDebug Result: For both advagg.install and advagg.admin.inc, we have advagg offering a 'relative url' as a URI for the function drupal_http_request($url_cdn)? Double Duh?
Comment #22
Peter Bowey commentedStep 3: addition to URI in #21
I placed a temp. code edit / addition to 'force' the correct URI required for the advagg's [advagg.install file] and [advagg.admin.inc file] like so:
And finally, the advagg module all works as it should! :)
Now the final advagg 'CDN result debug' report is (below):
'Sigh', advagg is now processing CDN use 'as it should' (great news), so now to trace through why the correct URI commission is not occurring for the advagg CDN. A call made with URI = 'relative' (rather than absolute).
Comment #23
Peter Bowey commentedAggregate Static fetch time results are now normal!
See: http://www.webpagetest.org/result/110527_9V_PWYJ/2/details/
Thanks Mike, for without your new advagg debug feature, I would have floundered for some days on this issue!
I tidied the final advagg code with same 'prefix CDN hack' I used earlier!
Comment #24
mikeytown2 commented@peter bowey
If I where you, I would create a module that implements hook_file_url_alter(), see cdn.module for an example. I would have it weigh more than CDN (heaver then 10,000) so it runs after it; this way you can add in the prefix and not have to hack everywhere to get this working correctly with your CDN setup.
I'm going to mark this fixed.
Comment #25
Peter Bowey commented#24 'comment only' = leave as 'fixed' status!
Thanks Mike,
I am still 'dense' enough to remain curious why I needed to re-form this URI (patch).
My first CDN path mod (addition)., I can understand - but not this one (all above).
In this 'case' http://drupal.org/comment/edit/4527382, I am not just adding a 'prefix' - I am reforming a malformed URI (an absolute).
Where the 'heck' does advagg derive
$url_cdn = 'relative'?eg:
$url_cdn = '/sites/peterbowey.com.au/files/advagg_css/css_missing...'My CDN Module map is:
where relative??
Comment #26
mikeytown2 commentedNot sure why your getting that.
file_create_url() should run cdn_file_url_alter() which should detect that this is a file that should be CDN-ed and replace the relative path with the absolute path pointing to your CDN. As for why file_create_url() didn't work, I would look into your CDN settings and/or see if you hacked cdn_file_url_alter in a way that is preventing this from working.
Comment #27
mikeytown2 commentedOne thing I will do on that status page is make sure file_create_url is returning an absolute path.
Comment #28
Peter Bowey commentedRefer #26
Thanks Mike, I have zero 'hacks / mod's' in that region.
In total I only have 2 advagg mods - both to allow my 'unusual CDN URI' (1) a 'prefix' + 2) 'force a URI')
I can only 'guess' that it is the way advagg reacts to my CDN (module) mapping array.
advagg seem to just ignore it :)
No other effects...
It is not important to chase....
Comment #29
Peter Bowey commentedMany thanks Mike!
(you are a dedicated D6/7 coder)
Comment #30
mikeytown2 commentedDid it anyway; committed this patch.