AWS EC2 Instance RDP stop working intermittently

1k views Asked by At

I create a new AWS account with free tier features in Sydney Region, below are my configurations:

  1. Single EC2 Windows t2.micro with Elastic IP associated, Default VPC settings
  2. RDS MSSQL Express
  3. EC2 Security Group allows RDP connection from my IP address
  4. 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:

  1. Disassociate and Reassociate that Elastic IP address to EC2 instance
  2. 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.

2

There are 2 answers

0
AudioBubble On BEST ANSWER

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.

1
Mahdi On

Regarding the issue, since it does not happen all the time, and considering that your instance has only 600 megabytes of RAM (if I recall correctly) and extremely limited processing resources, it is not that surprising that the service does not get started. I suggest you change your instance type to at least t2.micro since according to the AWS documentation "it has much better performance".

You should also consider that T instances (specially the smaller ones) are not supposed to be used in production environment. They are more suitable for test and development.