I have 10 pipelines that run at least twice per hour each and use an EC2 resource to copy data from an external MySQL server to S3.
My preference is to let the pipelines launch their own resources (as opposed to use a long-running instance launched manually), but I don't want 10 EC2 instances running continuously (EC2 instances are billed per hour) just to perform a 1-minute job twice an hour. Is there a way to have the pipelines share a launched instance?
You could have a long running EC2 instance combined with Task runner.
[...] In this pattern, you assume almost complete control over which
resources are used and how they are managed [...].
Also, EC2 instances are not billed per hour: https://aws.amazon.com/blogs/aws/new-per-second-billing-for-ec2-instances-and-ebs-volumes/
Not to be that guy lol but Google offers per minute charges (actually first 10 minutes are billed, then per minute)
Related
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.
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.
I am appearing for AWS CCP tomorrow , I thought Windows EC2 instances are billed per hour but this confused me. Can anyone help me understand the difference between Windows Ec2 instance and Windows based Ec2 instance is the question wrong
Amazon EC2 instances running Windows were historically charged per hour.
However, they are now charged per-second.
As written in your screenshot: "Windows based EC2 instances used to follow pay-per-hour pricing earlier."
See: Understand Amazon EC2 instance-hours billing
Another link would be the official documentation for the on-demand EC2 pricing stating:
Pricing is per instance-hour consumed for each instance, from the
time an instance is launched until it is terminated or stopped. Each
partial instance-hour consumed will be billed per-second for Linux,
Windows, Windows with SQL Enterprise, Windows with SQL Standard, and
Windows with SQL Web Instances, and as a full hour for all other
instance types.
I am new to AWS so please bear with me as my question might not make sense. BUT I had one ec2 instance running a single flask web application for about 3 months and my bills were in the $0-$0.50 range. However, I started to experiment with docker images, and such, I had these docker images running in their own containers on a separate ec2 instance. So for the month of April, I got charged $35 instead of the usual $0.50, so after a call with AWS they said my ec2 instances went over the limit of 750 hrs of time. So my thought process is I have only one ec2 instance running which in turn has multiple docker containers running serving different applications, could this help keep my costs from ballooning? Or would each docker container count towards the 750 hrs of montly time?
If my question did not make sense, please ask questions to my question :P
Hello Abhishek Hotti,
I can understand your frustation, I came on AWS while ago by experimenting like you and I can tell you I was billed my first month with more than 300€ due my "missunderstanding" of the AWS services and the Freetier layer.
I can tell you now, that Amazon ECS uses mainly two different approaches to launch containers:
EC2 Launch Type: which lets you choose your EC2 instances as the computational node.
Fargate Launch Type: which is fully managed by AWS. Your containers run without you managing and configuring individual Amazon EC2 instances. That means that despite you doesn't see the EC2 instances they are in the background and you are billed for that.
AWS Source documentation
The issue here seems to be that you are using two EC2 instances.
According to the free tier layer in AWS:
750 hours per month of Linux, RHEL, or SLES t2.micro or t3.micro
instance dependent on region
Making a fast calculation: each month are 24h * 30 days = 720h. Gf you are using two instances that will be = 1440 hours. That is above of the free tier layer and you are billed in consequence.
If you will be using the Fargate launch type option your bills will contain the use of the Fargate infrastructure that will be located in the background.
I hope this helps
I have an app that starts and stops an RDS instance on-demand. I understand how AWS charges for a stopped RDS instance.
Does AWS charge for startup/shutdown compute time?
The pricing documentation for RDS indicates:
Pricing is ... from the time a DB instance
is launched until it is stopped or deleted.
For RDS, more specifically:
RDS is billed in one-second increments for database instances and
attached storage. Pricing is still listed on a per-hour basis, but
bills are now calculated down to the second and show usage in decimal
form. There is a 10 minute minimum charge when an instance is created,
restored or started.
FYI, for regular EC2 instances:
Each time you start a stopped instance we charge a minimum of one
minute for usage. After one minute, we charge only for the seconds you
use.
The most cost efficient solution would be to use aurora serverless. This way you dont have to start and stop the instance.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html
When you use Aurora Serverless, you pay for only the database resources that you consume, on a per-second basis.
I am using an Amazon EC2 instance with instance type m3.medium and an Amazon RDS database instance.
In my working hours the website goes down because CPU utilization reaches 100%, and at night (not working hours) the CPU utilization is 60%.
So please give me right solution for this site down issue. I am not sure why I am experiencing this problem.
Once I had set a cron job for every minutes, but I was removed it because of slow down issue, but still I have site down issue.
When i try to use "top" command, i had shows below images for cpu usage, in which httpd command consume more cpu usage, so any suggestion for settings to reduce cpu usage with httpd command
Without website use by any user below two images:
http://screencast.com/t/1jV98WqhCLvV
http://screencast.com/t/PbXF5EYI
After website access simultaneously 5 users
http://screencast.com/t/QZgZsiNgdCUl
If you are CPU Utilization is reaching 100% you have two options.
Increase your EC2 Instance Type to large.
Use AutoScaling to launch one more EC2 Instance of same Instance Type.
Looks like you need some scheduled actions as you donot need 100% CPU Utilization during non-working hours.
The best possible option is to use AWS AutoScaling with Scheduled actions.
http://docs.aws.amazon.com/autoscaling/latest/userguide/schedule_time.html
AWS AutoScaling can launch new EC2 instances based on your CPU Utilization (or other metrics like Network Load, Disk read/write etc). This way you can always keep your site alive.
Using the AutoScaling scheduled actions you can specify metrics such that you stop your autoscaled instances during non-working hours and autoscale instances during working hours according to CPU Utilization(or other metrics).
You can even stop your severs if you donot need them at some point of time.
If you are not familiar with AWS AutoScaling you can follow the Documentation which is very precise and easy.
http://docs.aws.amazon.com/autoscaling/latest/userguide/GettingStartedTutorial.html
If the cpu utilization reach 100% bacause of the number of visitors your site have, you must consider to change the instance type, Auto Scaling or AWS CloudFront in order to cache as many http requests as posible (static and dynamic content).
If visitors are not the problem and there are other scheduled tasks on the EC2 isntance, I strongly recomend to decouple these workload via AWS SQS & AWS Elasticbeanstalk - Worker type