Project

General

Profile

Actions

Bug #10449

closed

Validation hooks should execute cf-promises by exec

Added by Janos Mattyasovszky over 7 years ago. Updated over 7 years ago.

Status:
Released
Priority:
N/A
Category:
-
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Fix check:
Regression:

Description

When currently validation is enabled, things can get pretty heavy if you have a looot of nodes (currently testing with just above 2000) - same method as ncharles, but using "real life inventories".

The problem is, that the current script /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check does run the cf-promises by starting a child process, but does nothing afterwards, so basically the exit code of the cf-promises is the exit code of the script.

Using exec before the cf-promises would reduce the number of processes (would also be better for nofiles limits) by a great deal:

root     30032  0.0  0.0  19740  1624 ?        S    22:25   0:00  \_ /bin/sh /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check
root     30057 30.4  0.0  46944 16856 ?        R    22:25   0:04  |   \_ /var/rudder/cfengine-community/bin/cf-promises -f /var/rudder/share/f8ee1cd2
root     30282  0.0  0.0  19740  1624 ?        S    22:25   0:00  \_ /bin/sh /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check
root     30290 24.6  0.0  47228 17028 ?        R    22:25   0:03  |   \_ /var/rudder/cfengine-community/bin/cf-promises -f /var/rudder/share/f4cd6516
root     30328  0.0  0.0  19740  1624 ?        S    22:25   0:00  \_ /bin/sh /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check
root     30367 26.1  0.0  47232 17036 ?        R    22:25   0:03  |   \_ /var/rudder/cfengine-community/bin/cf-promises -f /var/rudder/share/ffe280d0
root     31809  0.0  0.0  19740  1624 ?        S    22:25   0:00  \_ /bin/sh /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check
root     31830 18.2  0.0  47228 17032 ?        R    22:25   0:02  |   \_ /var/rudder/cfengine-community/bin/cf-promises -f /var/rudder/share/2025c11d
root      1572  0.0  0.0  19740  1624 ?        S    22:25   0:00  \_ /bin/sh /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check
root      1599 20.9  0.0  46944 16868 ?        R    22:25   0:02  |   \_ /var/rudder/cfengine-community/bin/cf-promises -f /var/rudder/share/0ba2e544
root      1969  0.0  0.0  19740  1628 ?        S    22:25   0:00  \_ /bin/sh /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check
root      1980 20.9  0.0  47240 17036 ?        R    22:25   0:02  |   \_ /var/rudder/cfengine-community/bin/cf-promises -f /var/rudder/share/c9b4ff24
root      4161  0.0  0.0  19740  1624 ?        S    22:25   0:00  \_ /bin/sh /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check
root      4185 17.6  0.0  47236 17032 ?        R    22:25   0:01  |   \_ /var/rudder/cfengine-community/bin/cf-promises -f /var/rudder/share/50c350ba
root      4844  0.0  0.0  19740  1624 ?        S    22:25   0:00  \_ /bin/sh /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check
root      4874 18.5  0.0  46940 16856 ?        R    22:25   0:01  |   \_ /var/rudder/cfengine-community/bin/cf-promises -f /var/rudder/share/ef68c3ec
root      5340  0.0  0.0  19740  1624 ?        S    22:25   0:00  \_ /bin/sh /opt/rudder/etc/hooks.d/policy-generation-node-ready/10-cf-promise-check
root      5356 16.0  0.0  46944 16860 ?        S    22:25   0:01  |   \_ /var/rudder/cfengine-community/bin/cf-promises -f /var/rudder/share/6d486886

=> Half of the running processes for each validation could be saved from the process table.

Actions

Also available in: Atom PDF