To increase the memory I have used t2.micro.
Actually at that time visitors were coming because we were running a campaign but that was not huge number of visitors it would be around 1K or below that so in that scenario I have to fix this and this is the only thing which got fixed the issue at that time.
I was not able to logged into the system at that time so I have to do this, but now I have to know exact reason which caused that issue.
If needed any more details please let me know.
Note:- I tried to restart the instance but that didn’t worked out too.