Re: [squid-users] Squid to cache a DB?

From: Mikhail Teterin <mi@dont-contact.us>
Date: Fri, 17 Aug 2001 09:55:10 -0400 (EDT)

On 16 Aug, Scott Baker wrote:
> I'm doing some work for a rather large website (www.livejournal.com)
> and we're using a DB to store some image files. They're
> stored as blob files, but will always have the same type URL
> http://www.livejournal.com/userpic/3837

Although you are not asking for evaluation, I can't resist to point out,
that this is a very flawed arrangement. Many people are doing this --
for programming/administrating convenience, but it adds tremendous
overhead to web-serving -- as you already found out. Instead of serving
the file directly off the disk, the web server has to transfer it from
the DB-server, which also has to find it within a large file...

Putting http-accelerator in front of the web-server (Apache has its own
acceleration module, BTW) will speed it up, but will make the whole
thing even uglier (and bulkier) -- even more resources will be needed by
this machine. And why? So some lame admin can have it easier? It is
mighty stupid to http-accel _static_ content...

Consider storing the files in the _file system_, as it was meant
from the beginning. You can store the _file names_ in the database
for administrative purposes, but the blobs themselves can be served
directly...

> Basically this is causing a bottleneck on the database server. It's
> making a lot more requests than is necessary on the already overworked
> DB server. So what I want to do is put a squid box in front of the DB
> to cache the images as they are requested and reduce some load on the
> DB server...

        -mi
Received on Fri Aug 17 2001 - 07:55:13 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:01:42 MST