I wrote a cookbook which will run some recipe’s on the instance created on AWS. When it is running it is giving me the following error while adding a cron job to the instance.
I have googled it and found that there are some memory issues and verified the memory with top command and it has enough memory but still I am facing the same problem. But, the same recipe is executing successfully some times.
I was wondering if someone could help me in resolving this issue.
Thanks for your response. But the only service that I am running on that instance is chef-client it is failing at creating a cron job with chef resource.
From experience the default linux images also have no swap, so as soon as the system experiences memory pressure things fail.
A quick and easy fix may be to attach a small (1-2G) EBS volume for swap . I’ve used this in the past to make a micro instance do more than the tiny amount of memory would allow.
Thanks for your response could you please share me a small snippet of code on attaching EBS voulmes. I am creating instances with chef provisioning AWS. I have tried attaching it but faced few problems. I would be a great help to me if you could share me the code.
Hi @kallistec@phanikumar Even I faced the same issue after changing the instance typ the issue has been resolved, when I used t3.micro it caused the chef-client to fail due to insufficient memory. To address this, I've changed the instance type to t3a.medium.