Yes, you are right. There was a bias ab initio, as the topic arose from another topic regarding a music-sharing service. If you have used Elastic Beanstalk for production purposes, please could you describe your application of Elastic Beanstalk? Thank you.
Except his music streaming service isnāt Magento. If you are looking for answers, any application that follows the patterns defined in the link above is ripe for EB, any other PaaS platform or Docker.
There were a number of wrong assumptions in your original post about it too. You can use any database you want by just referring to it in your code and not asking EB to provision an RDS instance for you. Besides, if you go Docker, pretty much every datastore out there can be containerized. Oh, and Magento too. Plus you can pretty much configure the EB environment in code so there goes that argument too.
Essentially, turning away from a series of instructions to an infrastructure thatās basically code and upgradable via git commits makes life better for everyone, and your agility too.
Thanks for this post. I recently got some AWS credits and Iām spinning up an instance. Is there a guide out there introducing linode/digital ocean users to AWS? Because I know what I want to do but translating it to AWS services is the problem.
Iām not sure there is such a guide, as AWS has a shitload of managed services (including general network and policies set up with VPC and security groups) to chose from depending on your need while linode/digital ocean are the equivalent of EC2 instances (with preconfigured images).
@stigwue: AWS has amazing documentations for all their services. They are so detailed that you will have to be patient to read as they take time to explain every bit. Cheers!
Nice guide Ndianabasi. Itās great to see someone recommending CloudFront, instead of MaxCDN. I have also been using AWS EC2 through Cloudways for hosting my web application with CloudFront and it has been going great. I know many would recommend MaxCDN, but I always prefer CF with AWS, itās a great combination with S3.
Dear @Ndianabasi, Kindly advise:
A friend was telling me that he moved his app away from AWS back to DO because of the bills. His ārentā increased from $300 to over a $1000 for hosting fees within months.
The issue was that his SaaS application is still at beta stage and he was being billed that much.
What do you think he can do especially if he wants to reduce his bills.
Thanks in advance.
Thank you @azazqadir. I came across KeyCDN recently. Their cost is half that of Cloudfront and they support HTTP/2. The main advantage of CloudFront is the easy integration with other AWS services.
Hello @spokentwice.
I am passing through the same situation right now. Iām hosting Furnish.NG on an Ubuntu 14.04 EC2 instance. After my free trial period elapsed in February, my billing jump from about $20 - $24/month Iāve been paying for the past six months to almost $190 for March only. I was lucky that I caught the escalating bill early around the middle of this month else it would have reached about $300 now.
First, I will recommend that anyone using AWS services, take out time to review their Billing & Cost Management Dashboard at least once a week especially when you are still experimenting with some services. It will reveal which services are siphoning your money. In my own case, I carried out a forensic analysis of my billing from the Billing Dashboard and discovered that I was billed for almost everything I thought werenāt billable and most shockingly, I had overprovisioned many services. I will break my situation down in the following paragraphs.
1. RDS
For March 2016, RDS alone was costing me $0.02/hr (approx. $15/month). I was running a db.t2.micro instance. Yes, RDS is a highly-available and managed relational database service, but I realised that with a database of about 40MB, it wasnāt necessary at all. It was also inducing lots of latency. So I moved my database to the localhost and deleted the RDS instance. Until, my database grows up to at least 200MB and incoming traffic demands me having load-balanced applications and dedicated database instances, I will continue to host my database within my EC2 instance. Total cost of RDS = $10.54.
2. Amazon Machine Image (AMI)
I was using an off-the-shelf AMI (āNginx + Memcached + MySQL + HHVM + PHPā sold by Sain3) which costs $0.03/hr or about $22.32/month for a t2.small instance. Having gained lots of experience with stitching various Linux services, there was no reason to be paying $22 monthly anymore. What did I do? I provisioned a free fresh Ubuntu 14.04 (HVM) instance and installed and configured Nginx, Memcached, Percona, HHVM, PHP5-FMP, and Varnish. Now, I can scale horizontally in the future without worry about the multiplying cost of the server software. Total cost server software: $15.67.
3. EC2 Instances
According to my billing report, I had ran a t2.micro Instance for 588 hours at $0.015/hr at a total cost of $8.82. And later on I switched to a t2.small Instance for 347 hours at $0.03/hr at a total cost of $10.41. Meanwhile, within the month, I was running more than one instance concurrently while transferring data from one instance to another. Total cost of EC2 instances for March is $19.23. Having completed all transfers, I am now running a single t2.small instance.
4. Elastic Block Storage (EBS)
EC2 instances make use of EBS for storage. Your instance hard drive is provisioned from EBS, so there is no evading this one at all. This is the part where I goofed the most and got punished so severally. I never knew that EBS storage space was charged separately. I had thought it was included in the cost of EC2 instances so that it was covered by the $0.03/hr for t2.small. At a point this month, I had about 4 instances provisioned (1 running and the other 3 stopped). Little did I know that Amazon was still charging for the EBS storages used by those instances whether running or stopped. The most bizzare part was that I had about 2 of the instances configured with 500GB General-Purpose SSD and 1 configured with 500GB IOPS SSD.
This is a summary of my bill just from EBS alone:
- $0.078 per IOPS-month provisioned - EU (Frankfurt) 552.419 IOPS-Mo = $43.09
- $0.103 per GB-Month of snapshot data stored - EU (Frankfurt) 20.607 GB-Mo = $2.12
- $0.119 per GB-month of General Purpose (SSD) provisioned storage - EU (Frankfurt) 609.395 GB-Mo = $72.52
- $0.149 per GB-month of PIOPS (SSD) provisioned storage - EU (Frankfurt) 18.414 GB-Mo = $2.74
Total: $120.47
My disk requirement was well below 100GB, so why on earth was I configuring 500GB SSDs! The worst part was that I couldnāt easily transfer the data to another instance of a lower disk capacity using snapshots. So basically, Amazon was grinning and telling me that I was stuck using their 500GB SSDs or I could start from scratch. Luckily, this was the period of my prelaunch campaigns, so I could afford some downtime. So I return to ground 0. I compressed all my files and sent them to S3 using AWS CLI; did the same for my all my databases and NGINX configuration files and deleted all my silly EC2 instances, snapshots, AMIs. Thatās how I started from the scratch and this happened last Saturday. I finished the setup on Monday morning.
5. Elastic IP Addresses
Amazon charges for any Elastic IP address not attached to a running instance. In my case, I sometimes, forget to release an Elastic IP address after terminating an instance.
- $0.005 per Additional Elastic IP address attached to a running instance per hour (prorated) 157 Hrs = $0.79
- $0.005 per Elastic IP address not attached to a running instance per hour (prorated) 1,044.800 Hrs = $5.22
You can calculate your monthly bill using the AWS Simply Monthly Calculator.
In summary, @spokentwice:
- He has to regularly review his Billing & Cost Management Dashboard.
- I strongly think your friend had overprovisioned lots of services (but he was worse than me)
- Amazon charges for almost everything. He needs to understand the cost implications of every type of service he provisions,
- He shouldnāt rush to provision higher level of instances. If heās still in beta, he should use the t2.micro types of instances for EC2, RDS, Elasticache, etc. I only upgraded to t2.small because the 1GB RAM of t2.micro was no longer sufficient. EC2 t2.small instance comes with 2GB RAM. However, to help me avoid upgrading to a higher type anytime soon, Iād setup an 8GB swapfile.
- He should host his database locally until there is need for a dedicated EC2 DB instance or RDS
- Amazon makes lot of money from EBS. This is the only part of their service which you cannot easily upgrade or downgrade. Once you are on production mode, itās very difficult to tamper with your server, so most people get stuck on overallocated and expensive EBS storages. He should be careful while configuring the size of his SSD drive during instance creation/launch.
I hope this will be of help to him. Cheers!
Thank you sooooooo much @ndianabasi
How wonderful it will be to understand how tplo run AWS is there anyone here than can help me transfer to AWS, how will that cost?
Hello @Jopec. Iāve been using AWS for over a year and currently have Furnish.NG running on AWS. I can be of help to you. Letās talk privately. Thank you.
This is just very wrong! Why would you want to mount over 600GB of SSD on EBS? I noticed that you have over 1TB of storage⦠Why can you store this data on S3 or get a dedicated server on Hetzner or OVH?
My mistake, I did not read your post well. You are very lucky that you discovered the EBS issue. However as I said earlier on, stick to your day job and mistakes like this will be avoided.
Each day, we learn through our mistakes. Definitely that canāt happen again.
Please can you help me define what my day job is??
Your day job is to sell furniture on your website and not worrying about the infrastructure
Well, for now, Iām stuck with the infrastructure job too (as there is still a lot to be set up) until I have an engineering team
So I am guessing that you have a cofounder that is a Sales Man chasing all those much needed orders?
I am guessing he is the salesman too, lean startup
Iām still searching for someone (or persons) who can add value to the venture. Iām near to achieving this though. Thank you for your concern @Tola
āflesh and blood did not reveal this to you, but My Father who is in heaven.ā