# Rails app on EC2

**URL:** <https://www.ruby-forum.com/t/rails-app-on-ec2/182550>\
**Category:** Rails\
**Created:** [January 29, 2010, 7:12pm UTC](https://www.ruby-forum.com/t/rails-app-on-ec2/182550 "2010-01-29T19:12:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [January 29, 2010, 7:12pm UTC](https://www.ruby-forum.com/t/rails-app-on-ec2/182550/1 "2010-01-29T19:12:00Z")

</div>

Hello,

I’m thinking to move my app to ec2, but Im reading that amazon does not  
guarantee that my instance doesn’t die?

So my question how can people use it for rails, and what does they do  
when the amazon ec2 instance dies? Do we have any automatic job to get  
new instance and get the app up and running again with all the gems  
etc.?

Thanks for any comment 🙂

---

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [January 29, 2010, 8:15pm UTC](https://www.ruby-forum.com/t/rails-app-on-ec2/182550/2 "2010-01-29T20:15:53Z")

</div>

On Fri, Jan 29, 2010 at 1:12 PM, Jamal S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> Hello,
> 
> I’m thinking to move my app to ec2, but Im reading that amazon does not  
> guarantee that my instance doesn’t die?
> 
> So my question how can people use it for rails, and what does they do  
> when the amazon ec2 instance dies?

Do we have any automatic job to get

> new instance and get the app up and running again with all the gems  
> etc.?

Amazon EC2 has excellent uptime and I usually go with a minimum of 2  
instances.  
Furthermore, you can set it up so that it automatically spins-up a new  
instance when one dies or sends a notification so that you can perform a  
manually boot. Next, Amazon is very different from your traditional  
hosting  
companies because they charge by the hour for each active instance.  
Thus,  
in order for them to make money, the active instance needs to be  
running.  
Otherwise, they will loose money.

You can find many gems on [gemcutter.org](http://gemcutter.org) for interfacing with Amazon EC2  
as  
well as their other services. For a current listing of AMIs, I would  
recommend directing those questions to Amazon. Lastly, there are  
alternatives for using EC2 like Engine Y. and Rightscale to name a  
few.  
Also, there are other architectures like Google App Engine. Thus, I  
would  
recommend doing your research as well as test driving these different  
systems.

Good luck,

-Conrad

Thanks for any comment 🙂

---

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [January 30, 2010, 9:17am UTC](https://www.ruby-forum.com/t/rails-app-on-ec2/182550/3 "2010-01-30T09:17:08Z")

</div>

On Sat, Jan 30, 2010 at 2:39 AM, Jamal S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> Thanks for your reply 🙂
> 
> Well as I understand when instance dies you could lose your static ip  
> and you can lose all your data on the instance?

Amazon Elastic IP address (i.e. static IP address) is connected to your  
Amazon account and not the instance. Next, you can also set it up so  
that it takes snap-shots of your database as well as your instances.  
This  
you’ll have to do whether you’re using Amazon or a traditional hosting  
service.

> So I also need to find another service to host the database.

> But I understand that all those type of issues can be fixed by using  
> Rightscale or maybe Engine Y…

Yes, Rightscale and Engine makes interfacing to Amazon much easier  
instead of using Amazon directly. However, there’s definitely a cost  
associated to their services in addition to the Amazon cost.

> They handle the notification when instance die and create another one  
> for you with all the data it needs?

Yes, this is possible with Rightscale and I’m sure that Engine Y.  
supports  
similar features.

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [January 30, 2010, 8:39am UTC](https://www.ruby-forum.com/t/rails-app-on-ec2/182550/4 "2010-01-30T08:39:01Z")

</div>

Thanks for your reply 🙂

Well as I understand when instance dies you could lose your static ip  
and you can lose all your data on the instance?

So I also need to find another service to host the database.

But I understand that all those type of issues can be fixed by using  
Rightscale or maybe Engine Y…

They handle the notification when instance die and create another one  
for you with all the data it needs?

Conrad T. wrote:

> On Fri, Jan 29, 2010 at 1:12 PM, Jamal S.  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:
> 
> > Hello,
> > 
> > I’m thinking to move my app to ec2, but Im reading that amazon does not  
> > guarantee that my instance doesn’t die?
> > 
> > So my question how can people use it for rails, and what does they do  
> > when the amazon ec2 instance dies?
> 
> Do we have any automatic job to get
> 
> > new instance and get the app up and running again with all the gems  
> > etc.?
> 
> Amazon EC2 has excellent uptime and I usually go with a minimum of 2  
> instances.  
> Furthermore, you can set it up so that it automatically spins-up a new  
> instance when one dies or sends a notification so that you can perform a  
> manually boot. Next, Amazon is very different from your traditional  
> hosting  
> companies because they charge by the hour for each active instance.  
> Thus,  
> in order for them to make money, the active instance needs to be  
> running.  
> Otherwise, they will loose money.
> 
> You can find many gems on [gemcutter.org](http://gemcutter.org) for interfacing with Amazon EC2  
> as  
> well as their other services. For a current listing of AMIs, I would  
> recommend directing those questions to Amazon. Lastly, there are  
> alternatives for using EC2 like Engine Y. and Rightscale to name a  
> few.  
> Also, there are other architectures like Google App Engine. Thus, I  
> would  
> recommend doing your research as well as test driving these different  
> systems.
> 
> Good luck,
> 
> -Conrad
> 
> Thanks for any comment 🙂

---

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [January 31, 2010, 12:36am UTC](https://www.ruby-forum.com/t/rails-app-on-ec2/182550/5 "2010-01-31T00:36:30Z")

</div>

Quoting Jamal S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hello,
> 
> I’m thinking to move my app to ec2, but Im reading that amazon does not  
> guarantee that my instance doesn’t die?
> 
> So my question how can people use it for rails, and what does they do  
> when the amazon ec2 instance dies? Do we have any automatic job to get  
> new instance and get the app up and running again with all the gems  
> etc.?

My instance on Amazon now has an uptime of 143 days. Use Elastic Block  
Storage (EBS) for persistent data (e.g. databases, application code, and  
configuration data).

Yeah I know I should have down notification and restart/reboot more  
automated,  
but I haven’t needed it yet.

Jeffrey
