Current time: 12-11-2017, 05:31 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Start Render Time
06-20-2010, 10:32 AM
Post: #21
RE: Start Render Time
They don't use it across the board - I know they use it in their search results though:

http://www.webpagetest.org/result/100619.../#request1

Header shows up so I'm feeling pretty good about correctly identifying it.

What version of apache are you using? Try disabling mod_deflate and see if that makes a difference (just for testing).
Visit this user's website Find all posts by this user
Quote this message in a reply
06-20-2010, 11:06 AM
Post: #22
RE: Start Render Time
(06-20-2010 10:32 AM)pmeenan Wrote:  They don't use it across the board - I know they use it in their search results though:

http://www.webpagetest.org/result/100619.../#request1

Header shows up so I'm feeling pretty good about correctly identifying it.

What version of apache are you using? Try disabling mod_deflate and see if that makes a difference (just for testing).
Weird, i grabbed the headers with firefox and didn't see the chunked encoding header. Could be that its not being sent for firefox or that the addon is just not displaying it.
I am using apache 1.3.41. I am using mod_gzip not deflate, though i can try disabling it later tomorrow and seeing the results.
Find all posts by this user
Quote this message in a reply
06-20-2010, 11:08 AM
Post: #23
RE: Start Render Time
Oh, not sure what the complications are in 1.3. Most everything I've read is with people getting it to work in 2.2. I'm almost positive that mod_gzip on apache 1.3 does not play well with chunked encoding.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-20-2010, 11:58 AM (This post was last modified: 06-20-2010 11:59 AM by jarrod1937.)
Post: #24
RE: Start Render Time
Ok, i'm slightly confused now. Take a look:
http://www.webpagetest.org/result/100619...1/details/

Thats with the site using chunked encoding for the html doc. Now here is the previous one i showed you without any chunked encoding:
http://www.webpagetest.org/result/100619...1/details/

Now, going off what you said, the time to first byte should decrease, thus making the start render time decrease as well. As you can see, the start render time definitely did decrease in the chunked version... but if you look the chunked version actually has a larger time to first byte! Why is that? Secondly you can probably see that if i get chunked encoding working it fails to gzip the main html doc, which actually results in a longer total load time. I'm still trying to see if i can get it to both chunk the output and then gzip it too.

p.s. on a side note you might be amused to know why the chunking wasn't working... It turns out there was a directive in the .htaccess file in the main doc root that said "dechunk yes", essentially telling mod_gzip to ignore any chunking and collect the chunks to gzip them.
Find all posts by this user
Quote this message in a reply
06-20-2010, 12:05 PM
Post: #25
RE: Start Render Time
Try putting a 2-3 second sleep in right after your first flush. That will help you see easily if there is downstream buffering that is causing a problem. With the chunking disabled you should see the TTFB take the extra time from the sleep. If it is working correctly in the chunked version that time will be moved to the content download time.

It's possible that the flush and chunking are both working but mod_gzip is buffering 8KB of data (or some other amount) that is preventing it from actually going out and there may be other settings that need to be tuned. Wouldn't it be nice if it "just worked"?

Also, run a bunch of runs (5-10) as the results may be a bit variable.

Love the .htaccess rule - I assume there's some historical (or is it hysterical?) legacy reason like NCSA Mosaic can't handle chunked encoding so disable it...
Visit this user's website Find all posts by this user
Quote this message in a reply
06-20-2010, 12:39 PM (This post was last modified: 06-20-2010 12:42 PM by jarrod1937.)
Post: #26
RE: Start Render Time
Ok, chunked encoding works if i flatout disable mod_gzip:
http://www.webpagetest.org/result/100619...1/details/

I made the sleep for 10 seconds to rule out any sort of fluctuation. Though the weird thing is that i consistently see 300-400 ms cut off of my start render time simply by disabling gzip for the main html doc (without flushing any output):
http://www.webpagetest.org/result/100619...1/details/

I am not sure why this is, unzipping/uncompressing the file client side shouldn't be adding that much delay.
For now, i'm done tweaking for the night, we'll see if i can get both mod_gzip and chunk encoding working tomorrow. If not i may give mod_deflate a try, i believe its available even for older apache versions.
Find all posts by this user
Quote this message in a reply
06-21-2010, 02:47 AM
Post: #27
RE: Start Render Time
You could also disable mod_gzip (for text/html so your js and css still get compressed) and use php's gzip encoding directly.

Otherwise my guess is that mod_gzip needs to be tuned and has a certain buffer size configured that is larger than your initial flush so it sits and waits for more data to be available before compressing and streaming it down to the client.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-22-2010, 07:29 AM
Post: #28
RE: Start Render Time
After a ton of messing around with mod_gzip i eventually just disabled it for html/php pages and used php's ob_start(ob_gzhandler) with multiple flushes.
However, with that done, i see that chunked encoding indeed does work, but found that it doesn't really help my start render time. What does seem to help my start render time is a 5 second sleep after the first flush. To me this is quite weird and can't see why that is the case:

Page with no sleep delay-
http://www.webpagetest.org/result/100621...74c6de25c/

Start Render Screen (1.461 seconds):
[Image: 1_screen_render.jpg]



Exact same settings and everything but with a 5 second sleep delay-
http://www.webpagetest.org/result/100621...52c68c46a/

Start Render Screen (0.908 seconds):
[Image: 1_screen_render.jpg]


As you can see, just adding the 5 second delay shifts the start render time from 1.461 seconds to 0.908 seconds. If you look further, you can see that the output of the longer render time includes product images, whereas the second is only the base page skeleton and is outputted sooner (as it should).
So, any ideas on what would cause this?
Find all posts by this user
Quote this message in a reply
06-22-2010, 07:40 AM
Post: #29
RE: Start Render Time
On the plus side, my optimizations seem to hold across multiple product categories with the same amount of products. Wasn't sure if that would be the case given the specific way i'm maxing out the connections (spreading out the amount of images assigned to each domain to maximize each one).
Find all posts by this user
Quote this message in a reply
06-22-2010, 09:28 AM (This post was last modified: 06-22-2010 09:29 AM by jarrod1937.)
Post: #30
RE: Start Render Time
Although i am still not sure why the delay helps, but i found out that i can reduce my start render time if i move my initial output flush a bit further up the stack:
http://www.webpagetest.org/result/100621...cfc329380/

The test above simply had the .css output above anything else at an earlier point in the code, which of course makes the code invalid since it is outputted before the doctype declaration... but i can simply move the doctype up too and be good.
Though the odd thing is in order to achieve that start render time i actually had to slow down the processing by 20 ms! If i remove the sleep delay my start render time returns to 1.300 seconds, but if i keep the delay my start render time decreases to under 1 second... Its the weirdest thing ever. The only thing i can guess is that the browser needs some time to process the css before starting the render, which the delay gives it a chance to do before the cpu is bogged down by the rest of the page.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)