Foreman 2.2.2 - Edit "Puppet Classes" and "Smart Class Parameters" extrem slow

To keep it short and simple :innocent: : Bug #31990: Foreman 2.2.2 - Edit “Puppet Classes” and “Smart Class Parameters” extrem slow - Foreman

1 Like

Here you go:

would be great if you can report the impact this change has on your environment.

1 Like

Sure, I tested again aaannnd the fix seems to work :partying_face: :slight_smile: :slight_smile: Now it takes 6-8s to load the page (previously without the fix 50+s). Thats a great performance boost. Thank you.

But one more thing, your patch is for the latest code of foreman (i think v2.3.X/2.4.X), right? I tested with 2.2.2 and did not found some of your diff’s in our copy of the source code, e.g. webpack/assets/javascripts/foreman_tools.js -> L137:139

1 Like

The patch is against the current development branch. Looking at the 2.2 branch, this is before highlightTabErrors was moved to webpack, so the only change you need in application.js is changing:

to:

$('body').popover({selector: 'a[rel="popover"]'});

for a little extra optimization.
The most significant change is inside the activateTooltips function which I assume patched cleanly.

Would be good if you could comment on the PR with the data from your system :slight_smile:

Of course, I can do that (PR == Fixes #31990 - Optimize tooltip and popover initialization by tbrisker · Pull Request #8364 · theforeman/foreman · GitHub, right?). What kind of data do you want to “see”? Request time after the fix, environment size (number of host, puppetclasses, …)?

1 Like

just some of the numbers from this post so it’s easy for the reviewer to understand the impact - number of overrides on the page and time before/after would be great.
Also if you can confirm that the tooltips and popovers still display properly it would be great :slight_smile: i tested it on my machine but always best to get another confirmation.

Done, hopefully it’s enough :slight_smile: On my test system tooltips and popovers are still displayed properly (in my eyes).

1 Like

@tbrisker , this morning i started to rebuild our foreman package with your fix and deployed it on our integration system.
In this environment we recognized that the edit page of hosts now throw the error “Oops, we’re sorry but something went wrong comparison of Array with Array failed”.
I’m not yet sure, whether this error comes from the fix or from the build dependencies

This could not be caused by the fix since it only touches JS code for displaying tooltips, and that error message is coming from the server. there should be a full stacktrace in production.log (though you might need to change your logging level to debug to see it).

I was just about to collect the data. Here we go foreman_array_with_array.log (24.8 KB)

For some reason the classification is failing to properly sort the overrides for the host. is this on every host or just a specific one? could it be related to some change you made to the overrides in one of the previous attempts to speed up the puppet class forms? is the ENC output for the host correct or is it also erroring?

Sorry, it seems everything to be fine. I couldn’t wait to get the fix in our integration / production environment so i missed to set the right redis cache // config. :confused:

1 Like