Home > database >  Are EC2 instances charged when starting/stopping?
Are EC2 instances charged when starting/stopping?

Time:05-05

I am trying to host an application on AWS. I am comparing hosting it on Lambda and on EC2, and was thinking about "sides costs".
Indeed with lambda I am charged for cold starts, and I was wondering if when starting/stopping an EC2 instance you're charged for this time, since my instance will take something between 1 or 2 minutes to start and stop.
Since I plan to start and shut down quite a lot of instances frequently it would represent a non negligible cost for me if I am charged for this period.

CodePudding user response:

You pay when the instance is in RUNNING state. From docs:

If your instance is billed by the second, then you're billed for a minimum of 60 seconds each time a new instance is started—that is, when the instance enters the running state.

This is independent of your application on the instance.

  • Related