I was happy to learn briefly about BigPipe & D8. Would be great to have some documentation to help explain more about how to get started. I did test that it installs nicely with SimplyTest.me, but it would be good to be able to know what else you'd need to do. Seems like there's no configuration at the moment.

Comments

mgifford created an issue. See original summary.

Wim Leers’s picture

Indeed, there's no documentation.

Showcasing this on simplytest.me is a great idea! I was planning to set up bigpipe.wimleers.com. I'll create a big_pipe_demo project — or something along those lines, with clear examples of personalization/slowness that really showcases the impact of BigPipe.

Then we can have both a simplytest.me link (to show there's zero hacks, that it's easy to set up) and a link to my own demo site, to just see what it feels like.

Question: do you think the demo site used in the screencast on the project page is sufficiently clear? I could easily turn that into a module. Oh, or perhaps a "BigPipe demo" installation profile?

Fabianx’s picture

BigPipe used to have trouble on simplytest.me - but I never found out why really. I think it had to do with NGINX or Varnish or such.

Wim Leers’s picture

Oh, interesting! I wonder if the X-Accel-Buffering: no header that you added fixed that?

Wim Leers’s picture

Title: Documentation & SimplyTest.me Example » SimplyTest.me demo + live demo
Component: Documentation » Miscellaneous
Assigned: Unassigned » Wim Leers
Related issues: +#2621394: Initial README + document relation to Page Cache & Dynamic Page Cache modules

BTW, the documentation was done in #2621394: Initial README + document relation to Page Cache & Dynamic Page Cache modules. And it's now available, in the beta2 release.

So, this is now just about setting up the demo material.

mgifford’s picture

Thanks Wim! It's exciting stuff.

Fabianx’s picture

Simplytest.me does still not support BigPipe / chunked transfer encoding - it always gives back Content-Length, which means the flush() is ignored.

This might be, because Patrick adds some JS to every page by sending a 2nd HTML document after the first one.

Need to ping Patrick on IRC for that.

We should test:

- Acquia DevCloud
- Pantheon
- Platform.sh

patrickd’s picture

1. Launched sandbox on simplytest.me
2. Installed big_pipe module
3. Internal Dynamic Page Cache is already enabled
4. Set Page cache to 1 hour (/admin/config/development/performance)
Response headers contained "Content-Length".

=> Bypassed HAProxy and accessed apache2 vhost directly
Still "Content-Length" in response.

=> Disabled the snippet that is added to every page via php.ini "auto_prepend_file"
Still "Content-Length" in response.

The problem might be the fcgi configuration I use to restrict users within their vhosts.

Is there some simple PHP script for testing this? (that kind of.. tries to use "bigpipe" in a minimal way)

Fabianx’s picture

#8:

You will need to be logged in for now or have an open session, but the simplest is to test via curl (in chrome: right-click, copy as curl):

The test.php is like that:


echo "First content\n";
flush();
sleep(1);

echo "Second content\n";
flush();
sleep(1);

echo "Third content\n";
flush();
sleep(1);

then use:

$ curl -v -v -v http://d8.local/test.php
* About to connect() to d8.local port 80 (#0)
*   Trying ::1...
* Connection refused
*   Trying 127.0.0.1...
* connected
* Connected to d8.local (127.0.0.1) port 80 (#0)
> GET /test.php HTTP/1.1
> User-Agent: curl/7.28.1
> Host: d8.local
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Mon, 14 Dec 2015 18:25:17 GMT
< Server: Apache
< X-Content-Type-Options: nosniff
< X-Powered-By: PHP/5.5.14
< Transfer-Encoding: chunked
< Content-Type: text/html
< 
First content
Second content
Third content
* Connection #0 to host d8.local left intact
* Closing connection #0

And you will see that first content, second content, third content are send with 1s in delay.

Edit:

And thanks a lot for looking into this Patrick!

patrickd’s picture

Thanks, that helped a lot to understand the actual problem!

Turning output_buffering = Off in php.ini made the example script correctly working when called directly

$ ./php/5.5/php -c php.ini test.php

Content is still buffered somewhere else when directly calling apache2 though.

And as suspected Fcgi is doing some buffering too:

  <IfModule mod_fcgid.c>
    FcgidOutputBufferSize 0
  </IfModule>

And it works!

so.. let's just try this out and see whether it has any negative impact

This will be deployed within the next hour.
edit: has been deployed on all servers

mgifford’s picture

Thanks @patrickd & @Fabianx!

Fabianx’s picture

Works like a charm now on simplytest.me, now we only need the demo content and profile!

For best effect:

- Enable BigPipe module
- Create an article
- Create a normal user
- Logout
- Login as normal user
- Click on article
- See DPC and BigPipe work together and comment form coming later.

WIN!

Wim Leers’s picture

Nice! This means we should also document

  <IfModule mod_fcgid.c>
    FcgidOutputBufferSize 0
  </IfModule>

@patrickd I opened #2636930: Document how to disable FastCGI's and IIS' response buffering for that. I don't know anything about FastCGI. Could you confirm that #10 is indeed the best way to solve it? Isn't there some kind of header that can be sent to disable FastCGI's buffering? Or generally speaking: something that doesn't require an .htaccess/HTTPD config change? Because not everybody may be allowed to do this.

patrickd’s picture

No idea, that was the only solution I found, sorry

krlucas’s picture

I created a Big Pipe demo install profile here:
https://www.drupal.org/sandbox/krlucas/2637020
https://simplytest.me/project/2637020

Not sure if this is what you all had in mind. In addition to an example user and article, it also includes a couple of intentionally slow loading example blocks with configurable max-age. Anyway, happy to help out with some more real world-ish examples!

thpoul’s picture

Wim Leers: Or generally speaking: something that doesn't require an .htaccess/HTTPD config change? Because not everybody may be allowed to do this.

Could something like ob_end_flush() help get around it?

Wim Leers’s picture

#16: no, that's PHP's buffering, not FastCGI's. Anyway, that's now all documented thanks to #2636930: Document how to disable FastCGI's and IIS' response buffering. This issue is now solely about the demoability.

Wim Leers’s picture

Status: Active » Fixed

d'oh, I totally forgot about #15… :( I just finished writing a big_pipe_demo module that allows the end user to manipulate the slowness (duration) of every block, and even disable BigPipe altogether by just manipulating the URL. It also includes optional (i.e. default) configuration for Bartik.

See https://www.drupal.org/project/big_pipe_demo.

Simplytest.me demo: https://simplytest.me/project/big_pipe_demo (don't forget to enable the "BigPipe demo" module). Live demo to follow (having server problems). Here's a link that will work for the next 24 hours: https://dm7r1.ply.st.

Will update the project page momentarily.Project page updated.

krlucas’s picture

RE: #15. No worries Wim! Thanks for all your work. I continue to evangelize D8 Big Pipe any chance I get and your demo is awesome.

Wim Leers’s picture

@krlucas: I welcome issues that add new blocks. I think in particular your block doing an external web services call would be a great addition. And perhaps your install profile can be changed to use big_pipe_demo? Then we all win :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.