Zipping files and download speed
am 17.01.2008 14:26:48 von RobG
Can anyone direct me to where I can get statistics on download speed
of plain text files versus zipped files? I'm keen to find out if
zipping files really does make them download faster since, as far as I
know, modems compress data before it is transmitted.
Clearly zipped files can't be compressed very much by the modem but
plain text files can, so just because you zip a file to half its size,
does it download in half the time?
I don't have a suitable web server setup to test this hypothesis, I'm
hoping someone here can point me to an article or statistics that can
provide an answer.
--
Rob
Re: Zipping files and download speed
am 18.01.2008 00:04:58 von sean dreilinger
RobG wrote:
> Can anyone direct me to where I can get statistics on download speed
> of plain text files versus zipped files? I'm keen to find out if
if you're talking about setting apache to compress text and text/html content
on-the-fly, this is a good summary:
http://www.websiteoptimization.com/speed/tweak/compress/
and there's a small table of http compression comparison stats for different
websites excerpted from andrew king's book here:
http://www.websiteoptimization.com/speed/18/18-2t.html
the performance gains you realize would depend on what fraction of your audience
is requesting compressed content (about 85% in my experience) and what
proportion of your current bandwidth consists of content that would be
compressed when you flip the switch.
> zipping files really does make them download faster since, as far as I
> know, modems compress data before it is transmitted.
in my own experience, the compression reduces bandwidth on text/html content by
4x or 5x, which creates a faster user experience and a noticeable drop-off on
bandwidth graphs. even if your site consists of a single html document that in
turn loads many images, your dialup modem-based users may notice the speed
improvement as that initial html document (and stylesheets) will download
faster, and they can begin reading text as the images or multimedia elements
continue to download and fill in.
there is some cpu overhead on the sending side to compress the content
on-the-fly, and some on the receiving side to decompress -- but it has never
been enough to justify turning off compression once its been enabled.
there are several http compression modules for apache, including two different
modules that share the same name: mod_deflate.
if you're using apache 2.x, mod_deflate by ian holsman comes bundled with the
distribution: http://httpd.apache.org/docs/2.2/mod/mod_deflate.html
if you're using apache 1.x, you have to choose and build your own http
compression module; the best one i've found for apache 1.x is also named
'mod_deflate', except this work is by Igor Sysoev and is available here:
http://www.sysoev.ru/en/
hth
--sean
--
sean dreilinger - http://durak.org/sean/
Re: Zipping files and download speed
am 21.01.2008 20:02:42 von sulu
sean I think you missunderstand him.
This sounds like the yenc versus uuencode arguament to me. But is also
applicable to any text v zipped situation
The point being people assume that zipping a file "increases bandwidth"
allowing data to be transmitted faster because the file is smaller.
This was the misconception that gave rise to "yenc" in the first place.
In fact you can't "increase bandwidth" The amount of bandwidth you have
is what you have - end of story - unless you change hardware. Compression
technology can only produce a given compression (The science topic to
read is information theory for why... in other words it explains why
zipping a zip tends towards larger not smaller files)
So a broadband modem capable of transfering data at say 1 mbyte per
second (as an example) will not transfer 2Mbytes in the same second even
if you compress it in a zip file. The transfer time will be the same.
The reason is - all modems including broadband modems provide the best
bandwidth their hardware is capable of - and they do so using compression
on the fly. That bandwidth is fixed -the term bandwidth is seldom used
correctly.
When a zip file or a text file is presented to the modem it will decide
on the fly how to compress the data for the maximum throughput - and the
recieving modem on the other end will uncompress it on the fly.
This means using zip rar or yenc for that matter is a pointless waste of
time if your ONLY consideration is modem transfer speed.
If you want to keep program files together - then do use zip/rar.
You can of course choose to turn off the modem compression but its a bit
stupid as the compression used in modems is targetted directly at getting
the best possible compression for the transfer to achieve the
manufacturers quoted bandwidth capability - where as say zip is more
interested in compressing "files".