I can’t understand a very simple thing about amazon EC2 instances: suppose I have a simple C++ web server program listening to a port at all times (and serving small burst requests when they come).. how would on demand pricing work?
In theory the application will be running 24/7 since the OS needs to be up and so does the port it listens to. Will I be billed 24/7 for running it?
Is there a “minimum CPU” to bill you and consider your instance “doing something useful”?
Advertisement
Answer
EC2 is a virtual Windows or Linux server. You don’t pay for the programs you are running, you pay for the server they are running on. You are billed for every hour that your server instance is running. The CPU usage and the programs you have running on the EC2 server are irrelevant from a billing perspective. If your server needs to be up and running and listening 24/7 then you will pay for 24 hours of usage every day.
Note: CPU usage is relevant if you are using a T2 family instance, as those cost less due to the CPU usage restrictions they impose.