[DM-MUG] Networking and web access

Arne Quanbeck dmmug@dmmug.org
Sat, 1 Nov 2003 20:00:25 -0800 (PST)


--- jim Lagnese <jlagnese@mac.com> wrote:
> Actually, caching was in regards to Mac OS 8 or 9. 
Yes, OS 9 and OS X are quite a bit different. Both
systems can benefit from a browser cache, if it is
designed properly. A cache that is not very efficient
will actually cause the browser to run slower. Web
browser performance is a complicated issue. Caching is
only one of a number of things that have an impact on
web browser performance.

For a more detailed, technical description, read
below.

> > From: Chris Rinehart <dinobot@mindspring.com>
...
>Safari
> seems to run faster on
> > dial-up without caching. I don't know if the
> browser has to compare the
> > page being called with the page in the cache but
> in OSX there is a
> > difference. 

Some browsers, such as some versions of Internet
Explorer, pay little attention to what is on the
network, and just pull the page out of the cache if it
has it. This can improve performance since it reduces
the amount of disk and network activity, but sometimes
causes the browser to present the user with an old
version of the page. 

Other browsers, such as some versions of Netscape,
compare the page to the network every session or every
time the page is loaded. This is why it is rare to see
an out of date version of a page in a Mozilla or
Netscape browser. 

Checking the page against the network does not take
much time, even on a dial up connection. All the
browser has to do is ask the server what the date on
the file is.

The primary slowdown for many browser caches is the
file system. The file system keeps track of the
information on your computer. The Mac's file system is
great for getting large files off the drive quickly.
It performs quite poorly when it is asked to get many
small files. This is easy to test. If you create a
folder with 5,000 files that has a total size of 5 MB
and another folder with a single 5 MB file, the folder
with a single 5 MB file in it will copy in almost no
time, the folder with 5,000 files will take a few
seconds. A web page is typically made up of 30 or 40
files. 

Since maintaining the cache on the file system is
usually done as part of the primary browser process,
file system accesses can slow down the web browser.
Sometimes the delay from the file system, disk
accesses, and processing of the cache is longer than
the time it would take to just ignore the cache and
fetch the files, even over a modem. For example, the
size of a one image from a menu on a web site was 802
bytes. A 56k modem can download about 5 of these in
one second. With most browsers, the cache will
generally speed up operation with a small number of
files. Pages with fewer, larger files will benefit
more from a browser's disk cache.

Using a RAM disk will eliminate part of the delay, and
may provide a significant speedup, particularly on a
machine with a slow IDE hard drive. The RAM disk does
not get rid of  the operating system overhead, but is
faster than a hard drive. If the files saved on the
RAM disk are not saved from one browsing session to
the next, performance will be better by simply turning
the disk cache off.

I did a quick performance test on a few configurations
to show the general impact of caching on web browser
performance.
>From slowest to fastest:
1. First Load (disk cache made less than 1 second
difference) (14-17 secs)
2. Disk cache (13-15 secs) hard drive
3. Disk cache (12-14 secs) ram disk
4. squid + disk cache (8-10 secs) hard drive
5. squid + disk cache (7-8 secs) ram disk
6. squid + no disk cache ( 6-7 secs)
7. squid + memory cache (4-6 secs)
8. Memory cache (4-5 secs) second load

Notes on the tests:
The Mac used for these tests is a Power Mac 7500 with
a 250 MHz G3 upgrade card. The drive the disk cache
was on is a 7200 RPM 9 GB SCSI hard drive. The browser
used  is Mozilla 1.0rc3. Different browsers will have
different performance. The system was running OS 9.1.

In this test, a squid server running on an Athlon 900
based Linux system was used. Squid also runs on Mac OS
X.

The Internet connection is a 256k ADSL connection. As
these tests were conducted across the Internet, some
of the differences in numbers may be related to
traffic conditions.  

In the past I have used the same configuration with
dial-up connections. Squid can improve performance on
any connection by eliminating some redundant
transfers, especially when multiple machines share the
same network connection. 
Arne

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/