Reputation: 11
this is my really first question here on stack overflow, sorry in advance if it's not 100% clear. Btw, for the first time today I had a fairly serious problem due to codedeploy, when I tried to deploy my app with codeship everything seemed ok in the pipeline until in "Waiting for the result of the deployment" stage the deployement broke, so i watched in codedeploy that the distro failed indicating in the * afterInstall * script the following error:
Script at specified location: ./scripts/afterInstallScript.sh failed with error Errno :: ENOMEM with message Cannot allocate memory - / opt / codedeploy-agent / deployment-root / b577fbd3-eb6e-431e-8246-db19c4f164a0 / d-4DV4KGIH5 / deployment-archive /./ scripts / afterInstallScript.sh
The app did not respond and gave error 503 (db and ssh responded correctly thankfully ...). Examining the memory occupied by the processes in the EC2 instance I saw that the command ** codedeploy-agent: InstanceAgent :: Plugin ** occupied ** 60% ** of memory available! I restarted the agent, the memory occupied now was 3%, but once I made a new deployment it returned to 38/40%, this time it didnt fail the build and the app returned 200 but this sudden increase from 3 to 40 worries me enough for the future release , I wouldnt want to restart the agent every time and pray that everything goes smoothly during deployment.
Looking around I saw this thread on github: https://github.com/aws/aws-codedeploy-agent/issues/32 explaining it's a known issue but this doesnt explain why the codedeploy agent occupy that amount of memory even after been restarted ,
Did someone experienced this issue or knows what's going on and how to fix it? Thanks
Upvotes: 1
Views: 1393
Reputation: 3387
It's been a while since it was asked, but for others facing similar issues:
We faced the same issue, codedeploy-agent used to consume up to 50% of memory, until we updated it to the latest version available at the moment i.e. 1.3.1.
You may get latest issues and their fixes related to codedeploy-agent on their official site.
Upvotes: 0
Reputation: 8890
This is unfortunately a long running and open issue:
https://github.com/aws/aws-codedeploy-agent/issues/32#issuecomment-521728945
This high memory usage is because rubyzip is used by the agent. There are some suggestions in this thread for optimisation.
Upvotes: 2