Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently I have 4 EC2 instances in amazon cloud behind a load balancer and this number will grow up to 20-30. I am looking for the best way to manage source code on all of these instances. There is a http server + php running on all instances.

What I need is a way to update the source code on all of the instances simultaneously. After some research I think I've found a solution - create a NFS server and export the directory with source code to all instances. Every instance will mount this exported directory and use it as document root for apache http server.

Is this approach correct or do you suggest anything else? Is NFS capable of sharing the source code to all EC2 nodes simultaneously?

share|improve this question
up vote 7 down vote accepted

NFS can certainly be used for this, but by doing it this way, you're setting yourself up a farily significant single point of failure. If the NFS server goes down, you're screwed. Additionally, disk IO performance will suffer when using NFS due the extra hop over the network that is required with NFS.

Instead, I'd recommend looking into a deployment tool like Fabric or Capistrano. Either of these can get code pushed out to your servers very quickly. If you're worried about some of the servers being "out of step" temporarily during deployment, then you ought to have your LB pull that server out of rotation before new code is deployed, then re-added to the rotation after successful deployment.

Addendum: "Simultaneous deployment" is a pipe dream. Just forget about that. It's difficult enough with a few servers, let alone tens or hundreds.

share|improve this answer
Thank you ErikA, I had some doubts about using NFS, I am going to try Fabric, looks good ; ) – Michal Jajcaj May 30 '12 at 9:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.