WebPagetest Forums
TTFB for small images/files can be > 5 seconds - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: TTFB for small images/files can be > 5 seconds (/showthread.php?tid=12668)



TTFB for small images/files can be > 5 seconds - ether6 - 11-21-2013 09:29 AM

I have unfortunately been getting results such as this from this awesome page speed tester and others. This is really frustrating because I think I am doing everything in my power to speed things up, but I have the occasional file with a 4-6 second load time. In the example below, the icon_facebook_link.png is ~1.5k.

http://www.webpagetest.org/result/131120_SQ_1BKH/1/details/

The result below is with the pagespeed module (https://developers.google.com/speed/pagespeed/module) active:

http://www.webpagetest.org/result/131120_VN_1BHH/1/details/

The file it typically chooses to wait on is often the facebook or twitter icon, which is interesting considering I have a dozen or so other png-24 icons on that page.

Any thoughts and/or help are appreciated. I scoured the forum for over an hour and couldn't really find much for this exact issue. BTW, running Drupal CMS on an Amazon EC2 instance with Bitnami Cloud Hosting.


RE: TTFB for small images/files can be > 5 seconds - GreenGecko - 11-27-2013 12:27 PM

Are you using a micro instance? I think my watch has more power available than one of those...

I'd say that these delays are caused by external forces. Try running on a small instance and see if you still have the problem. My site ( which is on a VPS, but one of my own... ) runs a LEMP stack - Percona MySQL 5.6, PHP 5.4 - with ngx_pagespeed, and usually returns straight A's.

With pagespeed, have you tried the inline_images and inline_css filters - both of those should be converted ( also using memcached to store pagespeed stuff is a good idea )???


RE: TTFB for small images/files can be > 5 seconds - robzilla - 11-27-2013 06:57 PM

When I call the icon_facebook_link.png directly from Chrome and reload a bunch of times, I also get a few longer load times among those. And when I loaded the full site, it hung on ui_arrow_designtools.png and drupal.js; probably on others at another try. I would first look into disk performance of your VM, if you can, and perhaps run an ab (ApacheBench) test on a static file to see what kind of variations in load time you get. This seems to be affecting the TTFB of your pages as well (ranges from 0.5s to 2.5s).


RE: TTFB for small images/files can be > 5 seconds - ether6 - 12-07-2013 05:26 AM

Thanks for the replies guys.

@GreenGecko
I ran a test with the mirco instance, switched over to the small instance, ran two tests, switched back to micro and ran another test, and the results were:

run 1 (micro): 10.2 s
run 2 (small): 4.8 s
run 3 (small): 3.9 s
run 4 (micro): 17.7 s

I did not experience any unusually long hang-ups on any files when running the small instance unlike the micro (7.8 s and ~15 s respectively). I'll check out the inline_images, inline_css. Not sure I fully understand what you are saying regarding memcached, but I'll look into it.

@robzilla
I've never really used Apache Bench, but following this tutorial (http://www.petefreitag.com/item/689.cfm) and running this command:

ab -n 1000 -c 100 http://etherblue.com/sites/default/files/icon_facebook_link.png

I came up with what I think are fairly typical/good results (on the micro instance):

Server Software: Apache
Server Hostname: etherblue.com
Server Port: 80

Document Path: /sites/default/files/icon_facebook_link.png
Document Length: 1198 bytes

Concurrency Level: 100
Time taken for tests: 0.792 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 1431000 bytes
HTML transferred: 1198000 bytes
Requests per second: 1262.92 [#/sec] (mean)
Time per request: 79.182 [ms] (mean)
Time per request: 0.792 [ms] (mean, across all concurrent requests)
Transfer rate: 1764.88 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 2 1.7 1 9
Processing: 8 74 12.5 78 86
Waiting: 8 74 12.5 77 85
Total: 13 76 11.6 79 89

Percentage of the requests served within a certain time (ms)
50% 79
66% 80
75% 81
80% 82
90% 83
95% 85
98% 85
99% 86
100% 89 (longest request)