Current time: 12-16-2019, 02:31 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Slow PNGs and GIFs ?
11-22-2011, 12:49 AM
Post: #1
Slow PNGs and GIFs ?
Hi,
after migration to new machine, we did some optimalisation of the pages. The biggest issue seems to be with the image files, as it takes several seconds to download them (altho having only some 17Kb ...). Here is current waterfall

http://www.webpagetest.org/result/111121...1/details/

Please the very long bars for GIFs and PNGs Sad For Example this

URL: http://img1.valka.cz/images10/homepage_icons/ico-01.png
Host: img1.valka.cz
IP: 89.185.250.36
Location: Czech Republic*
Error/Status Code: 200
Start Offset: 2.952 s
DNS Lookup: 225 ms
Initial Connection: 160 ms
Time to First Byte: 317 ms
Content Download: 1819 ms
Bytes In (downloaded): 17.8 KB
Bytes Out (uploaded): 0.4 KB


The webserver is Lighttpd, multiple 15k SAS disks in raid serving the files, no significant load (8 cores, load average: 0.21, 0.47, 0.41, iostat acting cool as well), 1Gbps network on backbone.

When I do local (same country) test using Google Chrome and Page Speed extension, I get speed for ico-01.png like 10ms instead of those 1800ms. Im connected on shared 10Mbps wifi line.


I wonder, what makes such a horrible difference ? Does it take like two seconds for 17Kb to travel from Europe to webpagetest server ?

(please note that putting amazon CDN instead to serve those files didnt change a thing, please see this result

http://www.webpagetest.org/result/111120...#request44

)

Or is there any problem with recieving PNG / GIF files ? I really cannot understand those results Sad

Thanks for any advice !
Find all posts by this user
Quote this message in a reply
11-22-2011, 06:53 AM
Post: #2
RE: Slow PNGs and GIFs ?
This happens due to TCP slow start.

Wiki:
http://en.wikipedia.org/wiki/Slow-start

Try to download images (at least a few) from the main domain, where html comes from.

Here is an example, on how to successfully exploit slow start:
http://www.webpagetest.org/result/111121_6P_28JBV/
Find all posts by this user
Quote this message in a reply
11-23-2011, 01:08 AM
Post: #3
RE: Slow PNGs and GIFs ?
thank you for your answer, I didnt have any idea about that. But changing to main domain didnt help to serve the files any quicker Sad

http://www.webpagetest.org/result/111121_11_28KS6/

i still think that downloading the 17Kb file to the other side of the world still shouldnt take two seconds Sad
Find all posts by this user
Quote this message in a reply
11-23-2011, 06:26 PM
Post: #4
RE: Slow PNGs and GIFs ?
(11-23-2011 01:08 AM)Letus Wrote:  thank you for your answer, I didnt have any idea about that. But changing to main domain didnt help to serve the files any quicker Sad

http://www.webpagetest.org/result/111121_11_28KS6/

i still think that downloading the 17Kb file to the other side of the world still shouldnt take two seconds Sad

Here is a test result from the Paris node, which is much closer to the origin Servers':
http://www.webpagetest.org/result/111122...1/details/

And I agree, even with TCP Slow Start it shouldn't take 1 second to download a 14.4 KByte image.
And if you look at objects 5-17, establishing a TCP connection shouldn't take 1 second as well...
Find all posts by this user
Quote this message in a reply
11-23-2011, 08:33 PM (This post was last modified: 11-23-2011 08:36 PM by Marvin.)
Post: #5
RE: Slow PNGs and GIFs ?
I've ran a test on the home page of your hosting provider. It seems their web site may be suffering from the same issue like yours. Not all, but a large number of their static files take unusually long time to download:

http://www.webpagetest.org/result/111123...1/details/

Perhaps you may consider moving to a different host.

Marvin
Find all posts by this user
Quote this message in a reply
11-25-2011, 02:12 AM
Post: #6
RE: Slow PNGs and GIFs ?
Thanks again for the tests ... I guess I must have done something wrong - Lighttpd webserver is fast especially with static files, so sending images should be easy for it (and my current average on the whole webserver is like 20 requests per second, 300 kbyte/s so I guess nothing terrible). When I run ab command with 30-50-100 concurrent users getting 1000 images, it serves like 4000 static images per second (but I admit, within the same 1gbps network, not from outside internet, havent measured that), so I do not see any harddrive or memory or configuration bottleneck ... Might it be keep-alive ON causing this ? I'd say no, but who knows, I've learned the hard way that in IT the things are really working the exact opposite you expect it to Smile

Can someone run the command

ab -c 20 -n 1000 http://forum.valka.cz/images10/homepage_...ico-01.png

againts my server from USA and let me know the result ? This is what I see when AB'ing the server from another quadcore machine within the same network :


ab -c 20 -n 1000 http://forum.valka.cz/images10/homepage_...ico-01.png

Code:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking forum.valka.cz (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        lighttpd/1.4.19
Server Hostname:        forum.valka.cz
Server Port:            80

Document Path:          /images10/homepage_icons/ico-01.png
Document Length:        17933 bytes

Concurrency Level:      20
Time taken for tests:   0.391 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      18221000 bytes
HTML transferred:       17933000 bytes
Requests per second:    2559.37 [#/sec] (mean)
Time per request:       7.814 [ms] (mean)
Time per request:       0.391 [ms] (mean, across all concurrent requests)
Transfer rate:          45541.31 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     1    1   4.6      1      72
Waiting:        0    0   2.0      0      46
Total:          1    1   4.6      1      72

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      1
  80%      1
  90%      1
  95%      1
  98%      1
  99%      1
100%     72 (longest request)



Repeated runs, same command

Code:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking forum.valka.cz (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        lighttpd/1.4.19
Server Hostname:        forum.valka.cz
Server Port:            80

Document Path:          /images10/homepage_icons/ico-01.png
Document Length:        17933 bytes

Concurrency Level:      20
Time taken for tests:   0.186 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      18221000 bytes
HTML transferred:       17933000 bytes
Requests per second:    5363.51 [#/sec] (mean)
Time per request:       3.729 [ms] (mean)
Time per request:       0.186 [ms] (mean, across all concurrent requests)
Transfer rate:          95438.04 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       1
Processing:     1    3   0.6      4       6
Waiting:        0    1   0.7      1       3
Total:          1    4   0.5      4       6
WARNING: The median and mean for the processing time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      4
  80%      4
  90%      4
  95%      5
  98%      5
  99%      5
100%      6 (longest request)


Code:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking forum.valka.cz (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        lighttpd/1.4.19
Server Hostname:        forum.valka.cz
Server Port:            80

Document Path:          /images10/homepage_icons/ico-01.png
Document Length:        17933 bytes

Concurrency Level:      20
Time taken for tests:   0.188 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      18301727 bytes
HTML transferred:       18012287 bytes
Requests per second:    5317.08 [#/sec] (mean)
Time per request:       3.761 [ms] (mean)
Time per request:       0.188 [ms] (mean, across all concurrent requests)
Transfer rate:          95031.08 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       1
Processing:     1    3   1.0      3       8
Waiting:        0    1   0.8      1       5
Total:          1    4   1.0      4       8

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      4
  80%      4
  90%      5
  95%      5
  98%      6
  99%      6
100%      8 (longest request)

I do not see any reason the static files shoud have this problem Sad

Thanks alot for the help with this topic, I really appreciate it and Im happy to learn new stuff.
Find all posts by this user
Quote this message in a reply
11-25-2011, 07:27 PM
Post: #7
RE: Slow PNGs and GIFs ?
it seems I may have found the problem, there might be disk speed issue. The gzipped files are being served from disk cache (once they are gzipped, they are stored in a separate directory and served direcly from there if requested again) on another disk, but the images are being served from disk, that seems to have slow response and transfer rate ... With repeated requests like AB test, this is not visible, as the file gets cached by the linux system I'd say, but with random access to various files this is not possible and it might cause the above visible problems. Let me investigate this and come back with results
Find all posts by this user
Quote this message in a reply
12-10-2011, 03:56 AM
Post: #8
RE: Slow PNGs and GIFs ?
well, even after migration to another disk I didn't achieve any improvement with the PNG files Sad still the results look ackward, even when CDN is in the game

http://www.webpagetest.org/result/111209...1/details/

seriously, what the heck is wrong with those PNG files ? Sad
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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