Is there a maximum shutdown for instances in Amazon EC2? And is that maximum configurable via the EC2-API?

We transfer data at shutdown time from the instance to S3. This works great for small files. But if they get bigger (several GB) we experience that not all data is transferred.

OS: Ubuntu 11.04 (EBS-Backed AMI)

link|improve this question

You don't say what. OS your instance is running. – Iain Jul 28 '11 at 14:31
Also, is it instance-backed or EBS backed? – SmallClanger Jul 28 '11 at 14:35
feedback

2 Answers

When you stop or terminate an EC2 instance, Amazon sends a soft shutdown request to the operating system to let it wrap up in a clean, safe manner. If the system does not indicate it is powering down within a short time (minutes) then Amazon effectively pulls the power plug forcing a hard shutdown.

I am not aware of any commitment from Amazon about how long this soft shutdown grace period is, so I would recommend you not assume or rely on having a specific minimum. Even if Amazon gives you 10 minutes today for one instance, they could easily reduce this to 3 minutes tomorrow when, say, they have a large demand for new instances.

If you need to do important wrap up before an instance shuts down, then send the instance a signal (web request or ssh command), wait for it to complete its task, then initiate the EC2 shutdown.

If you are using, say, spot instances where the instance can be shut down at any point by Amazon, then save your work frequently so that not much of it will be lost if the instance gets terminated suddenly.

link|improve this answer
feedback
up vote 0 down vote accepted

The maximum shutdown time we experienced is around 10 minutes. After that time the machine will be killed by Amazon.

Everything else would be surprising since Amazon bills only the time a instance was running and not the time it is shutting down; so they would loose money if the shutdown takes longer and longer.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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