# Rails/mongrel cluster - keeping media in sync across nodes w

**URL:** <https://www.ruby-forum.com/t/rails-mongrel-cluster-keeping-media-in-sync-across-nodes-w/106015>\
**Category:** Rails\
**Created:** [June 5, 2007, 5:41pm UTC](https://www.ruby-forum.com/t/rails-mongrel-cluster-keeping-media-in-sync-across-nodes-w/106015 "2007-06-05T17:41:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [June 5, 2007, 5:41pm UTC](https://www.ruby-forum.com/t/rails-mongrel-cluster-keeping-media-in-sync-across-nodes-w/106015/1 "2007-06-05T17:41:53Z")

</div>

Hi all,

I figured I would see what other people would do and get some ideas on  
what route I want to take.  
Let me first give you a brief summary of my network and application.

I have a Cisco PIX FW and a Cisco 11501 CSS/LB, there are 5 network  
nodes behind them. Three are webservers running apache/mongrel and 2  
are mysql servers ( master/slave replication )

The three webservers have limited disk space.

I need a way to keep my data in sync across all nodes. A user would  
upload artwork and other media after logging in, so since the data is  
private I can’t create a VIP in the LB like [http://mydomain.com/images](http://mydomain.com/images)  
and route it to a specific node.

So essientially, I am trying to figure out the best way to keep my  
media uploads in sync across all nodes. Right now I am using a mounted  
NFS mount to a master server on each client, but I am afraid of the  
bottleneck.

I can’t use a master upload server and Rsync hence the disk space issue.

I am open to any suggestions that you guys have here, I don’t want to  
have my media uploads “split-brained”. Any thoughts on this would be  
appreciated.

Regards,  
– Mike

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [June 5, 2007, 6:05pm UTC](https://www.ruby-forum.com/t/rails-mongrel-cluster-keeping-media-in-sync-across-nodes-w/106015/2 "2007-06-05T18:05:57Z")

</div>

We use Amazon S3 for storage, which works well across several  
servers. It’s also instantaneous if you’re on EC2 (but it’s still  
limited beta).

Duane J.  
(canadaduane)

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [June 5, 2007, 6:37pm UTC](https://www.ruby-forum.com/t/rails-mongrel-cluster-keeping-media-in-sync-across-nodes-w/106015/3 "2007-06-05T18:37:04Z")

</div>

You only have 3 options: database, shared file system, replication.  
If you are not able to increase the disk space on the web servers then  
replication is out. If you are afraid of a bottleneck then shared  
files are out. And storing large files in a database is not any  
better than shared files. So I guess nothing works.

Really, the answer is to look at the requirements. How big are the  
files, how many hits, etc. In most cases replicated files is the best  
solution because you only take a hit on upload, not access. But, that  
requires you add disk. How much will more disk cost? Not much. If  
you have low enough volume then do not worry about NFS or database  
blobs being the bottleneck. If you have enough volume then move the  
performance hit to the upload side, not the access side.

Michael
