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?

preguntada hace 9 meses262 visualizaciones
1 Respuesta
2
Respuesta aceptada

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
EXPERTO
respondido hace 9 meses
profile pictureAWS
EXPERTO
iBehr
revisado hace 9 meses
  • 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.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas