My site keeps going down from excessive bandwidth consumption! How do I fix this?
type: tip
reliability: - low
understandability: - very hard to understand
time saving: - small loss
usefulness: - very high
difficulty: - hard
required skill: - expert
overall: 15 of 48 points,
If you're consuming too much bandwidth, often, you need to cut down on the file sizes of your files like images. Over the internet, file size is everything and can make or break the game if it's rediculous. If you've happened to have seen something in the FAQ page and in two other areas of my site, you've probably seen videos [or even downloaded one or two]. Compression is what really matters. Compressed files not only help saving some room on your hard drive, but it shortens download time, reduces your bandwidth consumption, and saves your limited disk space you have. Over my connection, it would take 9 hours to download my biggest 140 MB video [however, with something like NetZero high-speed, it may only reduce to about 1 hour or less, because of file compression [the advertisement says up to 5 times faster, wrong, it can be much faster, even 50 times, depending highly on the file downloaded]]. Compressing it would reduce it to maybe 20 seconds, a gigantic difference. All my videos compress so well that they are far better than what MP3 could even get! Sometimes, a single frame can be only 7 bytes!
Images are very common on the internet everywhere. I have quite a few images on my site myself, but they are fully optimized for file size and file compression. The topic banner above, the tipsntricks figure, is also optimized. I could use dithering in 4-bit color* to further reduce the file size. When using drawings from your graphics editor, avoid saving in JPG as with GIF or PNG, it would look much better and compress far better [unless you used some very high-powered special effect].
You can enlarge or shrink an image indirectly by adding the width="x" and height="y" attributes within the image tag [if you're using a standard HTML editor [where you write the code]]. This can save a lot of disk space, and magnifying an image by twice the size isn't too bad, but much more is not recommended unless there's a good reason for it. Also, crop your images in as much as you can without ruining your image. This may have minimal effect though, especially with JPG images like photos. With GIF and PNG, avoid interlacing as that adds another 100 bytes or so.
Here's a complete list on how to reduce your bandwidth:
- Try limiting the page size to no more than 50KB if at all possible, and that includes the HTML, pictures, and everything else you have.
- If you use the same picture along several different pages [like I have here on my site, you can see the same picture from as many as ten different pages], or even the same page, it doesn't cost any bandwidth, because the computer stores it in the cache to refer off of from there. However, some users do clear out their cache once in a while, so they still do take some bandwidth away, but it wouldn't be as intense.
- For really large pictures, try resizing them to half their width and height, and then expand them out to double their size. This really doesn't distort them too much, but at least it keeps the main quality. Those with large monitors and a low resolution may find this highly noticable.
- Also, for really large pictures, try using a lower quality picture if possible. This mainly works with JPGs only though, and they often hog up a lot of space. Cutting an image down by one-third of the image size [not file size] and reexpanding it to true size can distort it more than twice of what you see with just double. It is not recommended that you use images that are greater than 800 by 600 pixels [or an area of 480,000 pixels] unless you use low quality.
- Avoid music and multimedia as they really hog up disk space. Though I have videos, they are fully optimized for compression [the major reason for the low-quality images] as I know the secret to file compression. If you want some background music for your site, it is highly recommended that you use a MIDI file or an MP3 file no more than 12 Kbps for quality. If you're using MIDI, these files are very small, but sound is limited. MP3, if you choose to use it, must be kept short and is recommended that you keep it under 10 seconds [10 seconds is 15 KB at the highest quality recommended].
There is a formula to estimate your bandwidth consumption. I think it goes as follows:
BAN=(DSU÷PC)×TPV
In this formula, BAN is what your bandwidth value is. DSU is disk space used for all your files. PC is your total page count [the number of readable documents you have]. TPV is your traffic page views or the number of visitors you have that read some of your pages.
Footnotes:
* Dithering and how it's used is explained in high-details on this neat report.