ADAM'S WEB PRESENCE

4 October 2004

How Coral Cache saved my Butt

Filed under: Nerd Notes — adam @ 1:57 pm

Well, as some of you may know, I run a little website called www.doctort.org which was to promote my band, The 5000 Fingers of Dr. T. We made several songs and videos between 1994 and 2002. The web server is run from a DSL connection here at my house. The site has been running since 1998 and so far the 128kbit connection has been enough to handle the modest amount of traffic we get.

One evening a couple of people rang me to say they could not access my web site. After checking out the server, I couldn’t see anything wrong with it just that everything was really slow, I thought it was a problem with my ISP.

But then I checked the web logs and saw loads and loads of requests for one particular video clip “The Butt Squeezing Factory”, a rather silly clip which my cohort Jasper von Patterntangle had made back in 2000. There seemed to be a large number of people who requested the clip and then cancelled the download part-way through.

So what I figured was happening was that since so many people were trying to download it, the server had slowed to a crawl and people looked at their browser saying “ETA 240 hours” or so and so cancelled the download.

What should I do about this ? I could take the web server offline but that would not be a very good solution. So I tried to figure out why the sudden interest. I looked at the logs again. As I suspected, nobody was visiting the web site, the video was being downloaded from an external link. I then checked the referer log and saw that the hits were coming from www.alldumb.com

Sure enough, on the front page of www.alldumb.com was a link to my video. Now the next step was how to deal with this.

I vaguely remembered reading about some free mirror service somewhere which can take the load off servers when they get slashdotted. So I went to slashdot.org to have a look for any clues. I had to shut down my web server at this point since my link was totally overloaded and I couldn’t access the web at all. After searching around on Slashdot for a bit, I found a mention of “Coral Cache” and looked that up on Google. Found ‘em here:

http://www.scs.cs.nyu.edu/coral/

It turns out that Coral Cache is run by the New York University and it works exactly as advertised. It will pick up a file from your web server and cache a copy on its server. All you need to do is change the link on your own website and the rest is automatic and free. It continues to amaze me that such useful things exist in the world!

So I Coralized my link. It took Coral Cache almost an hour to cache the video (only 11MB) because the link was so overloaded. But that still didn’t solve the problem because people were not going to my web page to see the redirected link.

Well, what to do. I thought of deleting the video from the site so everyone would get an error 404 but it is a fine video clip and I really do want people to download it and now with Coral Cache on the case, it should be possible for everyone to be happy.

So while I was waiting for Coral Cache to grab my file, I had a read of the Apache manual. I found the Redirect command. So with this simple command in the Apache configuration file:

   Redirect /videos/videos/The_Butt_Squeezing_Factory.mpeg http://www.doctort.org/videos

I could get the links coming from alldumb.com to redirect to the video clips web page and from there, the user can click on the Coralized link to the video clip. It meant I had to move the video clip to a different folder and then wait another hour for Coral to cache it again but that was it. Beautiful. Now people can not only download the file from a fast Coralized link, they can also see the other video clips I have to offer (all of which I have Coralized now!).


UPDATE 2006 - I am running Apache2 these days and have a 1 megabit DSL link. I also have a little space on my ISP’s server so I have put my high-demand files there and am not using Coral Cache anymore. It was very useful at the time though.


Powered by WordPress