Instance stops working when I'm working with ansible

0

Hello, I will try to be as lucid and possible. I'm trying to simulate a CI/CD pipeline that integrates Jenkins and ansible. My issue is I've noticed that whenever I try to do this, my instance where I've installed Jenkins and ansible just stops working. The health check still shows 2/2 but

1- my Jenkins page on my browser stops responding 2- The remote SSH connection to my server disconnects too.

Funny thing is , the playbook runs fine on my terminal but, the moment I go on the Jenkins site and try to run the pipeline that invokes the playbook everything stops, SSH connection disconnects and I have to stop and restart the instance. I'm not able to SSH back into the server until I stop and restart it

Could it be a CPU issue? Or could it be because I'm on free tier?

已提问 9 个月前262 查看次数
1 回答
2
已接受的回答

It doesn't have anything to do with free tier but the instance you'd have chosen under free tier eligible instances. As you mentioned, you are using free tier eligible EC2 instance, which can be t2.micro and it comes only with 1VCPU and 1GB of RAM. This can be pretty low for your use case.

I'd suggest you to setup CloudWatch monitoring to observe CPU, memory metrics before launching those two processes.

Once instance freezes, check cloudwatch metric and see where the resources limits are being hit. You might need to consider an instance of higher configuration. You'd typically see this behavior when CPU usage or memory is maxed out.

See Monitoring Instances using Cloudwatch for more details. With this you'd clearly know where is the problem and accordingly you'll need to do the rightsizing of EC2 instance for your use case.

You may not find a free tier eligible instance for your use case.

Hope this helps.

Comment here if you have additional questions, happy to help.

Abhishek

profile pictureAWS
专家
已回答 9 个月前
profile pictureAWS
专家
iBehr
已审核 9 个月前
  • Thank you Abhishek, you were right. I played and set up a SNS + Cloudwatch. The problem was the CPU load, CPU usage hits 100% when I try to run the playbook from Jenkins. Immediately I switched to a t3-medium instance type everything ran smoothly.

    Don't know why I didn't think about this before😅😅....Thank you very much, I really really appreciate your help.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则