Amazon Web Services have a great free tier where you can develop with very little cost. The free tier Linux server is a t2.micro server (1 CPU, low to moderate IO, 1GB memory with 750 hours or CPU usage). The free tier limits are listed here. Before you upgrade can you optimize or cache content to limit usage?
When you are ready to upgrade resources you can use this cost calculator to set your region (I am in the Sydney region) and estimate your new costs.
You can also check out the ec2instances.info website for regional prices.
Current Server Usage
I have an NGINX Server with a NodeJS back powering an API that talks to a local MySQL database and Remote MongoDB Cluster ( on AWS via http://www.mongodb.com/cloud/ ). The MongoDB cluster was going to cost about $120 a month (too high for testing an app before launch). The Free tier AWS instance is running below the 20% usage limit so this costs nothing (on the AWS free tier).
You can monitor your instance usage and credit in the Amazon Management Console, keep an eye on the CPU usage and CPU Credit and CPU Credit Balance. If the CPU usage grows and balance drops you may need to upgrade your server to prevent usage charges.
I prefer the optional htop command in Ubuntu to keep track of memory and processes usage.
Basic information from AWS t1.micro (idle)
Older htop screenshot of a dual CPU VM being stressed.
Future Requirements
I plan on moving a non-cluster MongoDB database onto an upgraded AWS free tier instance and develop and test there and when and if a scalable cluster is needed I can then move the database back to http://www.mongodb.com/cloud/.
First I will need to upgrade my Free tier EC2 instance to be able to install MongoDB 3.2 and power more local processing. Upgrading will also give me more processing power to run local scripts (instead of hosting them in Singapore on Digital Ocean).
How to upgrade a t2.micro to t2.medium
The t2.medium server has 2 CPU’s, 4 GB of memory and Low to Moderate IO.
- Backup your server in AWS (and manual backup).
- Shutdown the server with the command sudo shutdown now
- Login to your AWS Management Console and click Instances (note: Your instance will say it is running but it has shut down (test with SSH and connection will be refused)).
- Click Actions, Image then Create Image
- Name the image (select any volumes you have created) and click Create Image.
- You can follow the progress o the snapshot creation under the Snapshots menu.
- When the volumes have been snapshoted you can stop the instance.
- Now you can change the instance type by right clicking on the stopped instance and selecting Instance Settings then Change Instance Type
- Choose the new desired instance type and click apply (double check your cost estimates)
- Your can now start your instance.
- After a few minutes, you can log in to your server and confirm the cores/memory have increased.
- Note: Your servers CPU credits will be reset and your server will start with lower CPU credits. Depending on your server you will receive credits every hour up to your maximum cap.
- Note: Don’t forget to configure your software to use more RAM or Cores if required.
Misc
Confirm processors via the command line:
My NGINX configuration changes.
Find the open file limit of your system (for NGINX worker_connections maximum)
That’s all for now.
Donate and make this blog better
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]
v1.0 DRAFT Initial Post