hi all,
does anyone know why we have so many foreman-ruby and postgres proccess?
We have python script which update host parameters via API.
thanks
hi all,
does anyone know why we have so many foreman-ruby and postgres proccess?
We have python script which update host parameters via API.
thanks
Where can I find more informations about foreman-ruby ? is that the interface between foreman and api ?
Due to the architecture of Foreman and postgres, it is completely normal to have many processes of them running. The processes are forked a certain number of times to allow for parallel workloads.
I am not sure what foreman-ruby is, though. What OS are you running on? On RHEL I don’t see any foreman-ruby processes, but I could imagine this is the foreman process name under Debian/Ubuntu or when running from source?
The number of processes both Foreman and postgres spawn can be configured, but since they do have quite some CPU utilization, I assume they are already all working quite a lot and you should not downscale on that end.
If I am not mistaken, it should be the option --foreman-foreman-service-puma-workers
to foreman-installer to adjust the number of foreman processes. For postgres, I don’t know, you should consult postgres documentation for that.
Still, as stated, I would recommend against lowering the number of processes, this will mainly put more load on the remaining processes and might lead to services becoming unresponsive. The installer tries to pick sane defaults for your hardware setup if you do not specify any values.
thank you @areyus
Ok I’ll leave it as you suggest.
I send many requestes to Foreman WEB-API to update host parameters for 300 hosts, and that take to much time and high usage an CPU/RAM. Create/Update/Delete
Is there a way to work better with api ?
That depends on your use-case. You could evaluate if setting the parameters on another level (like hostgroup, OS, or something else) might be suitable.
Otherwise, the only solution I know of would be more hardware power. I am not aware of any less resource/time consuming options for the API. Depending on how your script works, maybe there is some optimization potential there.
You are right I’ll check my script again.
I’ll leave this as last option
thank you alot @areyus
do you know why after restart foreman remove last 2 weeks reports ?
This does not sound like normal behavior Usually, there is a cron job running (from
/etc/cron.d/foreman
, at least on RHEL) that does regular cleanup tasks like deleting reports that are older than one week and empty reports that are older than one day (at least of we are talking Puppet reports, other things might behave differently). I thought there there was a config option somewhere to set that interval, but I can’t find it currently. Maybe your cron is somehow broken and foreman performs those tasks on startup, too? I would suggest raising a new thread for this to get awareness for this problem in particular.