# Need help setting up a caching thumbnail server

**URL:** <https://www.ruby-forum.com/t/need-help-setting-up-a-caching-thumbnail-server/186914>\
**Category:** NGINX\
**Created:** [April 14, 2010, 8:59am UTC](https://www.ruby-forum.com/t/need-help-setting-up-a-caching-thumbnail-server/186914 "2010-04-14T08:59:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesAB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/85e7bf/32.png) [@JamesAB](https://www.ruby-forum.com/u/JamesAB)\
**Post date:** [April 14, 2010, 8:59am UTC](https://www.ruby-forum.com/t/need-help-setting-up-a-caching-thumbnail-server/186914/1 "2010-04-14T08:59:21Z")

</div>

I’ve got a site with a lot of images and we are currently using apache  
to serve the static thumbnails. We have over 1.7 million thumbnails  
using over 30GB of disk space. So the average thumbnail is around 18kb.

I’d like to setup a new dedicated server with 8GB RAM just running nginx  
to serve the static thumbnails.

What will be the best way to approach the nginx configuration to take  
advantage of the RAM for caching the most frequently accessed thumbnail  
images and reducing disk I/O?

Thanks for your help,  
James

Posted at Nginx Forum:

> **[Need help setting up a caching thumbnail server](https://forum.nginx.org/read.php?2,74778,74778#msg-74778)**
>
> I've got a site with a lot of images and we are currently using apache to serve the static thumbnails. We have over 1.7 million thumbnails using over 30GB of disk space. So the average thumbnail is around 18kb. I'd like to setup a new dedicated...

---

<div class="post-metadata">

**Author:** ![JamesAB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/85e7bf/32.png) [@JamesAB](https://www.ruby-forum.com/u/JamesAB)\
**Post date:** [April 14, 2010, 3:08pm UTC](https://www.ruby-forum.com/t/need-help-setting-up-a-caching-thumbnail-server/186914/2 "2010-04-14T15:08:42Z")

</div>

On Wed, Apr 14, 2010 at 1:58 AM, JamesAB [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’ve got a site with a lot of images and we are currently using apache to serve the static thumbnails. We have over 1.7 million thumbnails using over 30GB of disk space. So the average thumbnail is around 18kb.
> 
> I’d like to setup a new dedicated server with 8GB RAM just running nginx to serve the static thumbnails.
> 
> What will be the best way to approach the nginx configuration to take advantage of the RAM for caching the most frequently accessed thumbnail images and reducing disk I/O?

Unless there are some other requirements unmentioned, you don’t need  
to do anything special. The file-system cache (on Linux or whatever  
OS) should keep the directory data and most frequently hit images in  
RAM. This would even if you are running apache. You need to look at  
the access ratios for images, though. If access to the images is  
pretty uniform, cache won’t help much unless it is the size of your  
image store (32 GB RAM is pretty cheap.)

With only 30 GB of images, though, I would seriously consider using  
solid state disk for your image server. That way, even with a cache  
miss, you’re going to get sub-millisecond response times from the  
“disk” subsystem. Flash-based SSDs are way less expensive than RAM,  
and would move the bottleneck from disk to your network just as easily  
as RAM cache. If this is read-mostly, even some of the  
“non-enterprise” SSDs might work well for you, and they are much  
cheaper. An 80 GB Intel X25-Ms is about $200 now. Be wary of the  
really inexpensive off-brands, though, the controllers and performance  
stink.

We’re using the Intel X-25Ms on a few systems, and routinely see  
thousands of read IOPS from one drive. Even a 15K magnetic disk can  
only do about 180 IOPS. With a lot of writes, you may need to look at  
the X-25E versions, which are a lot more expensive but have better  
write performance and endurance.

–  
RPM
