Puppet getting "Cannot allocate memory - fork(2)" error. Running without puppetmaster

1,737 views
Skip to first unread message

Shay Lavi

unread,
Dec 23, 2013, 3:48:31 AM12/23/13
to puppet...@googlegroups.com
Hi,
I'm running puppet on Centos VM server without puppet agent (and no puppetmaster) just by using puppet apply.
Lately i'm getting error while try to run puppet: "Cannot allocate memory - fork(2)"
By looking at the server memory consumption I can see the the ruby is using a lot of memory until no more memory is available.
I tried to overcome this by:
1) Increasing memory
2) Reinstall puppet

These solutions didn't last long and the error returned.
Any idea how to fix this?

I'm using puppet 3.3.2 and ruby 1.9.2

thanks,
Shay.

This e-mail, as well as any attached document, may contain material which is confidential and privileged and may include trademark, copyright and other intellectual property rights that are proprietary to Kenshoo Ltd,  its subsidiaries or affiliates ("Kenshoo"). This e-mail and its attachments may be read, copied and used only by the addressee for the purpose(s) for which it was disclosed herein. If you have received it in error, please destroy the message and any attachment, and contact us immediately. If you are not the intended recipient, be aware that any review, reliance, disclosure, copying, distribution or use of the contents of this message without Kenshoo's express permission is strictly prohibited.

jcbollinger

unread,
Jan 2, 2014, 11:00:53 AM1/2/14
to puppet...@googlegroups.com


On Monday, December 23, 2013 2:48:31 AM UTC-6, Shay Lavi wrote:
Hi,
I'm running puppet on Centos VM server without puppet agent (and no puppetmaster) just by using puppet apply.
Lately i'm getting error while try to run puppet: "Cannot allocate memory - fork(2)"
By looking at the server memory consumption I can see the the ruby is using a lot of memory until no more memory is available.
I tried to overcome this by:
1) Increasing memory
2) Reinstall puppet

These solutions didn't last long and the error returned.
Any idea how to fix this?

I'm using puppet 3.3.2 and ruby 1.9.2



You could try running the agent periodically via a scheduler (such as cron) instead of running it in daemon mode.  You would want to pass at least the --no-daemonize flag to the agent in that context.  That should help if the problem involves Puppet / Ruby accumulating unneeded garbage from run to run.

You may also want to look at what you are trying to manage.  Does it include recursive File resources spanning large directory trees?  Does it include very large Files?  Does it include extremely large total numbers of resources?  Such things could inflate Puppet's memory use, and there are alternatives to many of them.


John

Reply all
Reply to author
Forward
0 new messages