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?

asked 8 months ago248 views
1 Answer
2
Accepted Answer

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
EXPERT
answered 8 months ago
profile pictureAWS
EXPERT
iBehr
reviewed 8 months ago
  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions