How to Set up a General Purpose Server on AWS
Several comparisons have to be done for server selections. EC2 is built on top of AWS Nitro System (No need to know the details).
There are other products and services, especially cloud related:
- SNS, SES, and SQS
- Time series database Timestream, NoSQL database Dynamo, and SQL database Aurora
- Beanstalk and EKS
Aliyun should have similar products and services.
EC2 Instance
There are 3 types of servers, A1 for ARM based, T3 for variable workload, and M5 for guaranteed performance.
We are going to run Python on the server, so ARM option is opt out since many Python libs require separate compilation on ARM. We need to access file systems a lot, so T3 is opt out since it doesn’t guarantee network performance. So M5 is the choice. M5a is AMD based, M5n has network boost (not needed).
m5.large has 2 vCPUs, 8GB mem. It’s just half of the next, m5.xlarge:
Since we are going to run services, it would be better to reserve an instance:
Monthly cost is $83.58.
3-year plan saves 1/3 of the cost:
or monthly $53.81.
The smaller m5.large is about half of the price of m5.xlarge:
Permanent File Storage
Besides local file systems(which can’t survive reboots), there are 3 options in AWS: S3, EBS, and EFS.
EBS is for database storage or like. It can be accessed by only one EC2. 10 cents per GB-month
EFS is NFS like, can be accessed by many EC2. 30 cents per GB-month
EFS IA (infrequent access) is 2.5 cents per GB-month, that’s a lot cheaper.
S3 is eventually consistent, can be accessed from anywhere. It’s the cheapest, 2.3 cents per GB-month + network.
S3 has access control, encryption, versioning. SQL works only for CSV or JSON formats.
The higher the cost, the better the performance.
SQL Database
AWS RDS
T instances are burstable and M is reserved
Price differences are
Monthly is 46.69 for 3 year term.
Monthly is 50.1 for 3 year term
Space cost is $0.115 per GB, so say, 20GB is 2.30 per month