MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
Combination of edge cases triggers ~200ms delay in TTFB
Current time: 08-05-2020, 11:33 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combination of edge cases triggers ~200ms delay in TTFB
10-24-2014, 03:34 AM (This post was last modified: 10-24-2014 04:08 AM by josephscott.)
Post: #1
Combination of edge cases triggers ~200ms delay in TTFB
I recently spun up a private instance of WPT using the ami-2a1cb142 EC2 image. In general I've been really happy with it.

Now I'm tracking an usual edge case. Here are the factors:
- Chrome, on Windows ( the EC2 instance mentioned above )
- Nginx w/ SPDY enabled, and gzip compression ( level 5 or 6 is what I've tested with )
- A file that is 1,602 bytes or smaller ( exact size might vary depending on how well it compresses ) that is the first resource requested in a SPDY connection

To simplify testing this I've reproduced the conditions on my private site with these two files:

- https://josephscott.org/dev/spdy/test-slow.html
- https://josephscott.org/dev/spdy/test-fast.html

These contain mostly random characters, the only difference between the two is a single character ( test-fast.html is 1,603 bytes, test-slow.html is 1,602 ).

The test-fast.html request is very quick, works the way I'd expect. The test-slow.html has a ~200ms delay in the time to first byte.

If these resources were just part of a page and the initial file requested in the SPDY connection was larger then this ~200ms delay never happens. It doesn't happen for smaller files that are requested after the initial connection.

I've provided HAR files for test results from my private instance:

- https://josephscott.org/dev/spdy/josephs...2-fast.har
- https://josephscott.org/dev/spdy/josephs...3-slow.har

The only difference in the two tests is the resource requested, and the only difference between those is one byte.

The delay doesn't happen when testing with IE 10 - https://josephscott.org/dev/spdy/josephs...J-IE10.har

So far I've only been able to recreate this delay using the WPT EC2 instance. But, I've got one other data point that confuses this as well. I found a small file on cloudflare.com to test against - https://www.cloudflare.com/static/javasc...13-08-01-1 - and it doesn't have the ~200ms delay.

This leads me to believe that the wptdriver isn't the only variable, but at the same time I'm only able to produce this delay on my EC2 instance.

In addition to sites at work and reproducing it on my personal site, there are others where this happens too:

- slow: https://thethemefoundry.com/wp-content/t...design.svg
- fast: https://thethemefoundry.com/wp-includes/...?ver=1.2.1

You can also see this when running tests from webpagetest.org:

- Chrome, slow: http://www.webpagetest.org/result/141023_K9_VX2/
- Chrome, fast: http://www.webpagetest.org/result/141023_D2_VXH/
- IE 10: http://www.webpagetest.org/result/141023_89_VXR/

It isn't an exact comparison to my private instance, but you can still see the TTFB delay in there.

I haven't been able to reproduce this on my Mac, an older Windows 7 desktop, the Windows 8 system of a co-worker. I can't even reproduce this on separate non-WPT EC2 images:

- Windows_Server-2012-R2_RTM-English-64Bit-Base-2014.09.10 (ami-904be6f8)
- Windows_Server-2008-R2_SP1-English-64Bit-Base-2014.09.10 (ami-dc65c8b4)

Based on the data that I have so far it looks like this could be a bug on the Nginx side ( since CloudFlare doesn't seem to have this issue ), but not being able to reproduce it on other Windows clients still leaves me with a small chance that this is WPT related ( or one of the components, like dummynet ).

Has anyone else seen this issue? If not, can others reproduce it with their WPT installs? And the big piece, can anyone reproduce this on a Windows system that has never had WPT installed?

Thank you.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Combination of edge cases triggers ~200ms delay in TTFB - josephscott - 10-24-2014 03:34 AM

Forum Jump:


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