I create a new AWS account with free tier features in Sydney Region, below are my configurations:
- Single EC2 Windows t2.micro with Elastic IP associated, Default VPC settings
- RDS MSSQL Express
- EC2 Security Group allows RDP connection from my IP address
- Single website in EC2 IIS, with two virtual directories, one web-form application, one WCF applilcation.
RDP is working most of the time. However every a few days, I can't RDP to this EC2 instance on that Elastic IP Address(stuck at Initiating Remote Connection). Nothing has changed in security group policy or windows firewall, not working even when I change security group to allow RDP from any IP address. I can still access the website and virtual directories, but WCF service report a internal 500 error.
Then I have to fix it by:
- Disassociate and Reassociate that Elastic IP address to EC2 instance
- Reboot EC2 instance
When these steps complete I can RDP into EC2, I notice event viewer logs WCF service error as "Memory gates checking failed because the free memory (xxxxx bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element."
I suspect EC2 instance was running low on memory so it refuses RDP connection? It is a new EC2 instance, I haven't installed anything except website files, If I inspect task manager, memory usage is about 85%, no suspicious program running. This RDP issue had happened before I deployed the WCF application.
Has anyone seen this issue? is this a limitation with free tier t2.micro instance? I am worried if I make this into production environment.
The "T" types of instances are all burstable with regards to CPU performance. In addition to running low on memory, your CPU could be starved by the hypervisor of cycles causing additional intermittent application performance issues. Here is the AWS FAQ on instance types:
https://aws.amazon.com/ec2/instance-types/
As noted, T instances, due to their burstable characteristics, should not be used for production.