Skip to the content

Kansas State University

Examples of Quota Calculations

Example 1: one page

The simplest example of quota calculation is a user with a one personal page consisting of a single file in Hypertext Markup Language (HTML) format. No images, sounds, video clips, etc. are involved. Suppose the file is 2,000 bytes long and has been requested 200 times.

Ignoring the effects of the client cache, the quota tally for the user is:

Overhead for HTML page:   200 requests*500 bytes/request   =100,000
Bytes sent for HTML page:   200 requests*2,000 bytes/request   =400,000
Total: 500,000

The tally for this user, 500,000, is well under the 20,000,000 limit.

Example 2: one page with two graphics

Suppose a user has a single home page 2,000 bytes long. The page uses two graphic elements: a small logo or graphic of 3,000 bytes, and a portrait picture of 30,000 bytes. As in the previous example, assume the page has been requested 200 times.

Each of the three files, the HTML file and the two image files, must be requested by the web browser from the web server. Each request incurrs the 500-byte overhead.

Ignoring the effects of the client cache, and assuming all browsers load the images, the quota tally for the user is:

Overhead for HTML page:   200 requests*500 bytes/request   =100,000
Bytes sent for HTML page:   200 requests*2,000 bytes/request   =400,000
Overhead for image 1:   200 requests*500 bytes/request   =100,000
Bytes sent for image 1:   200 requests*3,000 bytes/request   =600,000
Overhead for image 2:   200 requests*500 bytes/request   =100,000
Bytes sent for image 2:   200 requests*30,000 bytes/request   = 6,000,000
Total: 7,300,000

The tally for this user, 7,300,000, is still under the 20,000,000 limit.

Effects of the client cache

When a web browser loads a page or graphic, the browser saves, or caches, a copy on the hard disk of the client computer. The next time this page or graphic is used, the client checks with the server to ensure that the saved copy is the most current. If the saved copy is current, it is used and the file does not have to be transmitted from the server again.

In quota calculations, the check to determine if the saved copy is current counts as a page request and thus adds 500 to the user's quota tally. However, if the file has not changed and thus is not transmitted from the web server, no charge is made for file transmission.

For example, assume the details of the previous example, but assume that half of the people that view the files get them from their cache. There are still 200 requests for each file, but only 100 of them result in file transmission.

Overhead for HTML page:   200 requests*500 bytes/request   =100,000
Bytes sent for HTML page:   100 requests*2,000 bytes/request   =200,000
Overhead for image 1:   200 requests*500 bytes/request   =100,000
Bytes sent for image 1:   100 requests*3,000 bytes/request   =300,000
Overhead for image 2:   200 requests*500 bytes/request   =100,000
Bytes sent for image 2:   100 requests*30,000 bytes/request   = 3,000,000
Total: 3,800,000

The tally for this user, 3,800,000, is about half the previous tally, 7,300,000. The savings is due to the client cache.

Because of the cache effect, your tally will be higher on those days when you make changes to your files.

How can I determine the sizes of my files?

The command you use to list files can also show file sizes. On the Unix system, the command

   ls -l

lists files and their attributes in the format

   -rw-rw-r--   1 neil     other       1237 Jun 20 03:00 index.html

The fifth column of output is the file size, e.g., the 1237 in the above example.

Miscellaneous Effects

The number of times an image is requested is smaller than the number of times the embedding HTML page is transmitted. There are two reasons. First, some browsers do not load images, so displaying a page with embedded graphics will not cause the image to be requested and transmitted. Second, popular graphic browsers, such as Netscape's Navigator and Microsoft's Internet Explorer, allow the user to disable the automatic display of images. Some users choose to disable image loading so that pages are displayed faster.

Pages do not always completely load. Popular browsers display information as it is received. If a page is partially loaded when the user interrupts, the transmitting user's quota tally is only charged for the portions of the files transmitted.

Finally, file requests that result in errors, e.g., request files that don't exist or can't be read, do not currently incurr the 500-byte overhead charge.