'503 Service Unavailable error in AWS ec2 instance without load balancer

I'm pretty new to AWS. I have created an instance of ec2 and separate RDS. I have deploy my code. Sometimes I'm getting 503 error Service Unavailable (The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later) from API. Note1: I'm not using load balancer. Note2: Sometimes I got the my required response (200 status). But most of the time its 503. How I have to fix that error please? Help will be appreciated. Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source