It's a _little_ possible to generate a huge bill, but the biggest risks here are:
1. Leaving instances running when they're not being used
and
2. Deviation from default behavior that results in accumulation of storage volumes you don't want or need (low likelihood but something to watch for initially).
For 1:
If you leave the instance running you'll keep getting charged the hourly rate. Not really unexpected, but you have to notice it yourself or set an alarm.
There are a few tricks to reduce likelihood of this happening and to limit charges if it does happen anyway:
a. Prevention: Make your own little auto-stop script for the instance like rundiffusion has. Maybe make it into the launch sequence too, so you run a script, it launches the instance, then starts a timer. If the timer counts down all the way with you jiggling it, it stops the instance.
b. Mitigation: Create an alarm on the instance with the action to 'Stop' the instance when the alarm is triggered. Set the trigger for the alarm to be something like 'Max CPU usage has been less than 4% for a consecutive hour'.
c. Mitigation: Use AWS' Instance scheduler to automatically stop the instance
d. Mitigation: Billing budgets with associated action to stop instances -- kind of like the alarms but triggered based on costs
For 2:
It's probably a non-issue. You'll likely not have a problem because you'll start and stop the same instance most of the time instead of creating and deleting new instances. In which case, gp3 SSD storage is $0.08/gb over a month, charges on a 200gb storage volume you keep around all the time and use is only like $16 for the month. There are benefits so it's likely worthwhile.
BUT, be careful if you create and terminate lots of instances instead of stopping and starting the same instance. There's a small possibility of accumulating extra storage volumes you don't need, without realizing it.
By DEFAULT that's not a problem. AWS will delete the attached storage volumes for an instance after you Terminate (not stop) the instance. The problem comes from changing the default behavior.
That change can be configured in the AMI you use to launch an instance (by whoever created the AMI), or by you when launching an instance. The storage volumes are not deleted automatically then you have to do it manually to stop them from continuing to generate charges. Which you might not notice right away..
Keep that in mind, but that scenario requires a fairly unlikely chain of requirements to get to the point of bill bloat:
- If you use a pre-built AMI from marketplace (such as one with stablediffusion preinstalled) which is configured to KEEP storage volumes upon termination instead of using AWS default of deleting them,
- and if you do a 'Create' and 'Terminate' instead of 'Start/Stop' so you're using a LOT of instances instead of a few,
- and if you don't notice the setting during launch,
- and if you don't see all the extra volumes sitting around...
1. Leaving instances running when they're not being used
and
2. Deviation from default behavior that results in accumulation of storage volumes you don't want or need (low likelihood but something to watch for initially).
For 1:
If you leave the instance running you'll keep getting charged the hourly rate. Not really unexpected, but you have to notice it yourself or set an alarm.
There are a few tricks to reduce likelihood of this happening and to limit charges if it does happen anyway:
a. Prevention: Make your own little auto-stop script for the instance like rundiffusion has. Maybe make it into the launch sequence too, so you run a script, it launches the instance, then starts a timer. If the timer counts down all the way with you jiggling it, it stops the instance.
b. Mitigation: Create an alarm on the instance with the action to 'Stop' the instance when the alarm is triggered. Set the trigger for the alarm to be something like 'Max CPU usage has been less than 4% for a consecutive hour'.
c. Mitigation: Use AWS' Instance scheduler to automatically stop the instance
d. Mitigation: Billing budgets with associated action to stop instances -- kind of like the alarms but triggered based on costs
For 2:
It's probably a non-issue. You'll likely not have a problem because you'll start and stop the same instance most of the time instead of creating and deleting new instances. In which case, gp3 SSD storage is $0.08/gb over a month, charges on a 200gb storage volume you keep around all the time and use is only like $16 for the month. There are benefits so it's likely worthwhile.
BUT, be careful if you create and terminate lots of instances instead of stopping and starting the same instance. There's a small possibility of accumulating extra storage volumes you don't need, without realizing it.
By DEFAULT that's not a problem. AWS will delete the attached storage volumes for an instance after you Terminate (not stop) the instance. The problem comes from changing the default behavior.
That change can be configured in the AMI you use to launch an instance (by whoever created the AMI), or by you when launching an instance. The storage volumes are not deleted automatically then you have to do it manually to stop them from continuing to generate charges. Which you might not notice right away..
Keep that in mind, but that scenario requires a fairly unlikely chain of requirements to get to the point of bill bloat:
- If you use a pre-built AMI from marketplace (such as one with stablediffusion preinstalled) which is configured to KEEP storage volumes upon termination instead of using AWS default of deleting them,
- and if you do a 'Create' and 'Terminate' instead of 'Start/Stop' so you're using a LOT of instances instead of a few,
- and if you don't notice the setting during launch,
- and if you don't see all the extra volumes sitting around...