You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Forrest Aldrich <fo...@forrie.com> on 2006/06/26 18:19:27 UTC

[users@httpd] Caching large amounts of small images... the best way?

We are developing a new infrastructure that will serve up images 
directly from a database.

In front of this process, we would like to place a cache of the most 
frequently accessed images.  This would serve to reduce the load on the 
database image server.

The images are small (under 200k).

My question is what is the most effective way to do this (without a 
commercial cache solution like akamai).

Some thoughts:  some apache proxying tricks, squid, or a lightweight 
daemon that's dedicated to caching.

Along those thought lines are the underlying filesystem, etc.

Any pointers would be appreciated, thank you.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Caching large amounts of small images... the best way?

Posted by Joshua Slive <jo...@slive.ca>.
On 6/28/06, Forrest Aldrich <fo...@forrie.com> wrote:
>
> Are there some docs on mod_disk_cache - examples of implementation, etc.
> (beyond the description on the website).

http://httpd.apache.org/docs/2.2/caching.html#disk

There isn't much to the configuration, although you need to understand
that it uses standard HTTP caching rules, so your content needs to
send appropriate cache-control headers.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Caching large amounts of small images... the best way?

Posted by Forrest Aldrich <fo...@forrie.com>.
Joshua Slive wrote:
> On 6/27/06, Forrest Aldrich <fo...@forrie.com> wrote:
>>
>> This appears to be experimental.
>
> I don't believe mod_cache/mod_disk_cache is experimental in 2.2.2.  It
> is in earlier versions, but I've already recommended you stay away
> from those.
>
>>
>> How would an approach like this compare to a product such as Squid (in
>> terms of use).  Obviously Squid is very much more specialized and
>> requires resources to scale properly.
>
> I haven't used squid's caching, so I can't compare.  But a big
> advantage of mod_cache is that it can be used on the origin server
> itself -- no need to put a proxy in front.  This should reduce the
> load and complexity signficantly.  (It can also be used on a proxy, if
> you want a multi-tiered architecture.)
>
> mod_disk_cache should give you speeds that are better than apache
> httpd's static file access speeds.  In other words, it will be WAY
> faster than anything that requires database access.
>
> Joshua.

Are there some docs on mod_disk_cache - examples of implementation, etc. 
(beyond the description on the website).

Thanks.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Caching large amounts of small images... the best way?

Posted by Joshua Slive <jo...@slive.ca>.
On 6/27/06, Forrest Aldrich <fo...@forrie.com> wrote:
>
> This appears to be experimental.

I don't believe mod_cache/mod_disk_cache is experimental in 2.2.2.  It
is in earlier versions, but I've already recommended you stay away
from those.

>
> How would an approach like this compare to a product such as Squid (in
> terms of use).  Obviously Squid is very much more specialized and
> requires resources to scale properly.

I haven't used squid's caching, so I can't compare.  But a big
advantage of mod_cache is that it can be used on the origin server
itself -- no need to put a proxy in front.  This should reduce the
load and complexity signficantly.  (It can also be used on a proxy, if
you want a multi-tiered architecture.)

mod_disk_cache should give you speeds that are better than apache
httpd's static file access speeds.  In other words, it will be WAY
faster than anything that requires database access.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Caching large amounts of small images... the best way?

Posted by Forrest Aldrich <fo...@forrie.com>.
Joshua Slive wrote:
> On 6/26/06, Forrest Aldrich <fo...@forrie.com> wrote:
>> We are developing a new infrastructure that will serve up images
>> directly from a database.
>>
>> In front of this process, we would like to place a cache of the most
>> frequently accessed images.  This would serve to reduce the load on the
>> database image server.
>>
>> The images are small (under 200k).
>>
>> My question is what is the most effective way to do this (without a
>> commercial cache solution like akamai).
>>
>> Some thoughts:  some apache proxying tricks, squid, or a lightweight
>> daemon that's dedicated to caching.
>>
>> Along those thought lines are the underlying filesystem, etc.
>>
>> Any pointers would be appreciated, thank you.
>
> Apache's mod_cache + mod_disk_cache was designed for jobs exactly like
> this.  Make sure you use version 2.2.2, since earlier versions had
> bugs.
>
> Joshua.
>
This appears to be experimental.

How would an approach like this compare to a product such as Squid (in 
terms of use).  Obviously Squid is very much more specialized and 
requires resources to scale properly.


Thanks.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Caching large amounts of small images... the best way?

Posted by Joshua Slive <jo...@slive.ca>.
On 6/26/06, Forrest Aldrich <fo...@forrie.com> wrote:
> We are developing a new infrastructure that will serve up images
> directly from a database.
>
> In front of this process, we would like to place a cache of the most
> frequently accessed images.  This would serve to reduce the load on the
> database image server.
>
> The images are small (under 200k).
>
> My question is what is the most effective way to do this (without a
> commercial cache solution like akamai).
>
> Some thoughts:  some apache proxying tricks, squid, or a lightweight
> daemon that's dedicated to caching.
>
> Along those thought lines are the underlying filesystem, etc.
>
> Any pointers would be appreciated, thank you.

Apache's mod_cache + mod_disk_cache was designed for jobs exactly like
this.  Make sure you use version 2.2.2, since earlier versions had
bugs.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org