Closed (fixed)
Project:
Parallel
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Sep 2009 at 15:03 UTC
Updated:
18 Mar 2010 at 05:38 UTC
hi,
following discussions @ the high-perf group, etc. i've deployed a pound/ssl -> varnish -> apache2 -> pressflow6. perf improvements, compared to "just" drupal6 -> apache2/ssl are fairly dramatic.
i'm now considering Parallel (maybe 'real' CDN?) as a possible next-tweak.
atm, varnish is setup to generally always cache images & multimedia, CSS & javascript, and static files, as well as 'everything in most of the standard drupal directories, *.txt and *.ico'.
does this caching by varnish interfere with, or negate, the advantages Parallel provides? if so, what'd be the right 'mix' of config?
thanks!
Comments
Comment #1
mikeytown2 commentedVarnish is in front of your web server, so if varnish is setup to cache the subdomains then it should work flawlessly.
Comment #2
PGNetDev commented> it should work flawlessly.
great. makes sense to me if all the domains are http://.
if (www.)example.com is exposed @pound as https://...:443, with a cert installed as usual, then, if i wanted to ensure that all content is served only via ssl (so as to avoid the 'some content is not secure' browser warnings ...) each of cdn{1,2,3}.example.com -- facing outward from pound -- would need their own legitimate certs as well (or share a wildcard), correct?
iiuc -- and i realize i may be looking at this all wrong -- with Parallel's multiple (3) subdomains added to the picure, i've now got to properly 'route' among:
multiple listeners, certs & backends @pound
one (or multiple?) caches in varnish
multiple vhosts (main + 1 per subdomain) in apache
do you, perchance, know of a example config for a similar scenario?
thanks.
Comment #3
mikeytown2 commentedA wildcard cert for https would be the best option IMHO. Be sure to test before buying; in spite of the advice from Google & Yahoo, sometimes this will make the site take longer to download. It really depends on your setup. Testing is key; use wireshark to test in browsers that don't have a plugin that provides waterfalls. Browsers that don't follow HTTP/1.1 (most modern ones), will probably not benefit.
I don't have a config for you. Long story short make the sub domains point to the webroot.
These all go to the same directory on your server.
Comment #4
PGNetDev commentedhi,
> A wildcard cert for https would be the best option IMHO.
hm. i was afraid the multiple/wildcard cert might be required.
since a single cert is installed on a single IP-based (not named-) host, but valid only for a sinlge domain name (well, with & without 'www.')would it, instead, be possible to setup Parallel rather than on multiple subdomains,
https://(www.)example.com:443
https://cdn1.example.com:443
https://cdn1.example.com:443
https://cdn1.example.com:443
instead on multiple PORTS of the same domain? i.e.,
https://(www.)example.com:443
https://(www.)example.com:8081
https://(www.)example.com:8082
https://(www.)example.com:8083
? i'm _fairly_ sure that pound's HTTPS listener can be setup for any port, not just 443.
if this is doable, then Parallel could provide its perf boost with _one_ cert.
thoughts?
> Be sure to test before buying ...
> ... Testing is key ...
advice noted.
thanks!
Comment #5
mikeytown2 commentedUsing different ports instead of subdomains is an interesting idea. I believe it's valid html markup. Try
//www.example.com:443to be sure it works as expected. I don't know if the browser would download in parallel from the same domain though, even if its a different port. I don't think anyone has thought of this trick, so this is something that needs to be tested; I'm thinking it wont work though.Cert is browser side, so doing a server side redirect wouldn't work (in case someone was thinking about doing it this way).
Comment #6
PGNetDev commented> Try //www.example.com:443
unfortunately, that results in
An internal server error occurred. Please try again later.
and only this in logs,
==> /var/log/messages <==
Sep 24 19:25:50 edge pound: (b7c94b90) e500 response error read from 127.0.0.1:8080/GET /main/ HTTP/1.1: Connection timed out (15.004 secs)
==> /var/log/apache2/pressflow6.8081.log <==
mydomain.com xx.xx.xx.xx, 127.0.0.1 - - [24/Sep/2009:19:25:35 -0700] "GET /main/ HTTP/1.1" 200 8198 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0 FirePHP/0.3"
now to de-bork the site ...
Comment #7
PGNetDev commentedsanity check -- using just:
//www.example.com
works just fine ...
Comment #8
PGNetDev commentedhm. i lied.
*rebooted* the VM, then tried
//www.example.com:443
all's fine. well, at least the site serves, and there's no 'internal error'.
cache gremlins, methinks ... sorry :-/
Comment #9
PGNetDev commentedwell, well.
i setup Parallel to use ports 808{1,2,3} as the 'CDN servers' for CSS, JS & IMG respectively ...
i mod'd pound.cfg, varnish's vcl.conf, apache's conf, and .... don't forget firewall (!) ... and i'm serving pages from drupal with, apparently, css links rewritten to come from the assigned ports.
JS & IMG are not working ... looks like relative vs absolute links? e.g.,
in the displayed page source,
one question: which IMG formats does Parallel support? atm, i'd presuming (?):
jpg|jpeg|gif|png|tiff|tif|ico
thanks.
Comment #10
mikeytown2 commentedit uses the img html tag; so ico is not rewritten. Uses a regular expression for this.
For javascript, does your theme use the hook_preprocess_page?
http://api.drupal.org/api/function/template_preprocess_page/6
Do you do this somewhere?
$variables['scripts'] = drupal_get_js();Odds are the javascript is getting rewritten. I have a special condition set just for css because of the recolorable theme option. css/js is grabbed from
$variables['styles']and$variables['scripts']& thus i don't need a regular expression when changing the domain. Are you using "Use Hook Exit For CSS Replacement" right now?all css images should be downloaded from the subdomain or other port in your case, so not all is lost ATM.
Comment #11
PGNetDev commented> it uses the img html tag; so ico is not rewritten. Uses a regular expression for this.
ok, thanks.
> For javascript, does your theme use the hook_preprocess_page?
http://api.drupal.org/api/function/template_preprocess_page/6
yes, i use it. but note that the JS & IMG issues are also in the admin theme, which is, atm, drupal's default "Garland"
in any case, in my zen-subtheme's template.php,
-------------------------
> Do you do this somewhere?
> $variables['scripts'] = drupal_get_js();
*i* don't use it anywhere... grep'ing the entire pressflow root,
grep -rlni drupal_get_js .
./sites/all/modules/advanced_help/advanced_help.module
./sites/all/modules/print/print.pages.inc
./sites/all/modules/geshifilter/geshi-extra/drupal5.php
./sites/all/modules/geshifilter/geshi-extra/drupal6.php
./sites/all/modules/jquery_update/jquery_update.module
./themes/chameleon/chameleon.theme
./includes/common.inc
./includes/theme.maintenance.inc
./includes/form.inc
./includes/theme.inc
> Are you using "Use Hook Exit For CSS Replacement" right now?
not at the moment.
> all css images should be downloaded from the subdomain or other port in your case, so not all is lost ATM.
still hopeful ;-)
Comment #12
PGNetDev commented> Are you using "Use Hook Exit For CSS Replacement" right now?
if i DO enable it, theneven the CSS aren't rewritten ...
Comment #13
mikeytown2 commentedhmmm nothing jumps out at me as to why its not working for those content types.
Here's the code
So i'm still thinking something sets $variables['scripts'] after parallel is done.
Comment #14
PGNetDev commentedswitching to Garland to remoe my theme as a variable, it looks like _just_ js is, in fact, being 'missed'.
css is being rewritten to :8081, as above. i also note,
imgs are as well.
hm ...
Comment #15
PGNetDev commentedfound the problem -- jquery_update module.
disable it, and i've now:
<script type="text/javascript" src="//www.example.com:8082/main/misc/drupal.js?x"></script>checking (again ... should've paid better attention above. teach me for working late ...),
as you suspected.
now, is it possible to modify jquery_update, or Parallel, to allow happy coexistence?
Comment #16
PGNetDev commentedlooking closer, there's some selectivity ... note most, but not all, img & css are rewritten ... e.g., grep @ 'View Source' of the .../admin page:
Comment #17
PGNetDev commentedas an experiment, i disabled Parallel (jquery_update is still disabled, too), pulled out its ..._image_replace & ..._preprocess_page code, and added it to the END of my subtheme's ..._preprocess_page block.
subtheme pages now seem to render correctly.
viewing PageSource for rendered pages (in the subtheme; default/other themes, now, of course, do NOT use the CDN/parallel-related code) still shows a mix of, e.g., css reference -- some WITH the https://www.example.com:8081/... rewrite, and some without --
however, according to my logs, _all_ css/js/img are passing, as intended, thru their respective "cdn ports".
so, that's a bit confusing to me ...
now to do some benchmarking.
Comment #18
mikeytown2 commentedjquery_update was probably to blame; closing this issue since it's old