I would like to know how Amazon EC2 charge for EBS and the bandwidth for Windows and I want to know the how many Tomcat web servers and MySQL servers can be placed in one EC2 server.
Pricing references:
Amazon EC2 Pricing
Amazon EBS Pricing
Amazon EBS (Elastic Block Store) is priced according to the size of the volume and the type of volume. See the above pricing links for more details. Note that the amount is charged based on provisioned storage, which means the full disk size is charged rather than just the proportion of the volume that is used.
There is no specific charge for bandwidth for Amazon EC2 instances, however traffic that is leaving a region and going to the Internet (from any service, including EC2) is charged for Data Transfer. For details, see the Data Transfer OUT From Amazon EC2 To Internet section of the Amazon EC2 Pricing page.
Also there is a restriction on the network bandwidth assigned to any Amazon EC2 instance. Basically, larger instances have more bandwidth. See the Networking Performance column on the Instance Types Matrix. While no specific bandwidths are given, relative measures are provided (eg "Low to Moderate", "High"). Some large instance types (eg m4.10xlarge) have 10 Gigabit bandwidth between instances (but not necessarily out to the Internet).
The number of Tomcat web servers and MySQL servers that can be placed in one EC2 server is totally dependent upon your particular situation and the Instance Type chosen. For example, a heavily-used application and database will require more resources. Experimentation and performance testing would assist in making this decision.
Also, if you wish to run MySQL, you might consider using Amazon RDS (Relational Database Service) to provision a fully-managed database instead of installing and maintaining one on your own EC2 instance.
Related
It might be a noob question but couldn't find anything solid on the web so here I go.
I know that both EBS (Elastic Block Store) and EFS (Elastic File System) communicate with EC2 over the network (data transmission). To make an EFS work with EC2, I read that traffic on the NFS port must be allowed by the inbound security group (attached to EC2 instance).
But, I don't think any such configuration is required for EBS. So, why we don't need any configuration for EBS and yet it works?
Amazon EBS volumes attach to Amazon EC2 instances as devices via a separate network connection to the host computer. It does not attach via a VPC, so Security Groups are not available.
Amazon EBS volumes are bandwidth restrictions on Amazon EBS volumes, which vary by Volume Type. See: Amazon EBS volume types - Amazon Elastic Compute Cloud
Older Amazon EC2 instance types could increase bandwidth to EBS volumes by using Amazon EBS Optimization that uses "an optimized configuration stack and provides additional, dedicated capacity for Amazon EBS I/O". Modern EC2 instances have this enabled by default.
In contrast, Amazon EFS is attached to instances via a VPC, so Security Group rules apply.
I looked at the pricing pages for both EC2 and Lightsail but could not find anything.
I am more concerned about data bills on EC2 side as EC2 data is much more expensive.
I can relocate servers to be in the same region if that helps reduce cost.
Data between Regions is definitely charged at full Data Transfer prices.
Data within the same Region but in different AZs would be charged at 1c/GB (possibly 2c/GB since it might be charged from both ends).
The lowest-cost option would be to establish VPC Peering between Lightsail and your VPC, and having the resources in the same AZ. This should (?) eliminate any Data Transfer charge.
This might be helpful: Understanding Data Transfer in AWS - The Duckbill Group
I'm working on an eCommerce website (developed and set up by other develpers) that have the web server on a m4.2xlarge instance and the database on a t2.micro (EC2 and EBS instances).
The usual traffic is about 5,000 unique visitors/day but we are expecting a huge increment in the nex future because of some advertising on big newspapers and I would like to understand if I need to scale up the web server instance or the DB instance or both.
It is not clear to me if the two instances are sharing the same RAM and CPU or if they are completely separated.
Thank you !
Both the systems will have different CPU and RAM.
You should choose RDS instead of a normal EC2 instance for Database.
You can take a backup from older instance and load into your RDS instances. This will also help you maintaining high availability as well.
Let me preface this by saying that I am primarily a programmer, though I have a pretty good working knowledge of Linux and "standard" LAMP installations. I have been tasked with setting up a persistent LAMP environment in Amazon Web Services (AWS), which is a good deal more involved than what I'm used to in this regard.
Although AWS is very well documented, I have yet to find a clear, definitive "Best Practices" overview for setting up a persistent LAMP environment. I followed the official Amazon tutorial ( http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html ) to set up a LAMP server on our EC2 instance, but found out later that these instances are "temporary" and that I need an EBS to make anything persist. Interestingly, EBS (Elastic Block Storage) does not appear in my Management Console , though they offer pricing out on the public side ( https://aws.amazon.com/ebs/pricing/ ). Is it still called EBS?
Of course, that begs the question - what happens to the programs I installed (Apache, MySQL) along with their respective config files? Surely Amazon doesn't expect us to reconfigure our server from scratch every time it boots up?
What I have now
1x EC2 instance running Amazon Linux. I installed and configured Apache and MySQL following the "Install LAMP" tutorial posted by Amazon.
1x Route 53 Hosted Zones (for DNS routing)
1x Elastic IP attached to the EC2 server
Additionally, there appears to be one unencrypted 8GB volume attached to /dev/xvda, although I didn't set it up and nobody has access but myself - it seems to have been generated when I requisitioned the EC2 - no idea if it is persistent or not.
What I think I need
So, here is what I'm thinking I need to do. Please tell me if I'm way off - is there a more sane alternative?
1x EC2 instance running Amazon Linux and Apache
1x RDS for MySQL
1x Route 53 Hosted Zone
1x Elastic IP attached to the EC2 server
1x (EBS? S3? EFS?) for storing htdocs
1x Snapshot of the EC2 to save server configuration
Does that sound right? Is there a better way to do this? Thanks so much for any advice. Amazon docs seem to be very good at giving granular information, but not as great at addressing overall strategy concerns.
Web Application
It is recommended to have 2 EC2 instances under an Elastic Load Balancer with these 2 instances being in separate availability zones for high availability. Going further is better to monitor these instances for CPU and bandwidth - CloudWatch - and once you see they are above some threshold you could automatically add more instances to the ELB, this is the auto scaling. Of course like you said you will need the AMI (snapshot) with the server software to be ready to be launched. You also need to take down servers when the load is small - again automatically with the metrics, but you should never go down under 2 machines. And don't forget to update these images when you upgrade the software.
Route 53
Because you would use an ELB you don't need Elastic IPs anymore, your web servers could only have private IPs. And on the Route 53 you need to point your website to the name of the ELB - here are more details about it
Database
For the database part go for the RDS for MySQL including Multi-AZ deployment, so you will have the master and one stand by replica in different availability zones.
EBS (disks)
For the EBS part you will ned to use that and they come in 3 flavours: magnetic(slowest), General Purpose SSD (faster) and Provisioned IOPS (fastest). These are the disks you mount on your machines, web servers and databases. For the database you should go with Provisioned, it is much harder to change them later, while for the web server we use General Purpose. In the AWS Console you find them under EC2, section Elastic Block Store.
The 8G disk that appeared is the default when you create a Linux machine and it is a General Purpose SSD which is good enough for a web server, but I think you should go with a bigger one, 50G at least.
I'm using aws to run php app and it works good.
But I have a question: Does Any one knows if accessing to RDS from ec2 in the same region can trigger bandwith charge ?
Thanks.
If both the RDS and EC2 servers are in the same availability zone then there is no data transfer charge. If they are in different availability zones then there is the standard data transfer charge on the EC2 instance, but no transfer charge on the RDS instance. In addition, there is no charge for RDS data replication between availability zones.
This information used to be on this page, but now I can't find it. You can see some of this information in the RDS FAQ page. There is also a discussion thread on the official RDS forum here.