-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Hepler Function uitils.attributes from puppet_x context to puppet #702
Comments
FYI: saw the same issue, played a little bit with it and rolled back to icinga-icinga2 3.2.2 for the moment. |
Shit, that wasn't planed. Sorry for that. Do you use environment caching? Did you try to clear the cache? |
At least we have a lot of different environments and it is no easy task to update all environments at once. While fiddling with it our puppetmaster stopped working completly and since I hadn't any time to do some proper diagnostics I just rolled back for the moment. Maybe I can try again on the weekend, but if all environments need to have that change, it is quite of a hassle unfortunately. |
I start to test it, now. |
It does not seem to work with the switch to puppet function api 4.x without restarting the puppet server. see branch fix/702 |
At first I did not restart the server service or cleared the cache, which resulted in the above mentioned error. Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server Error: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- puppet_x/icinga2 I am not quite understanding what you are referring to in fix/702 (sry) |
correct. This is definitely a bug, a missing require. The main problem is the remove of the function attributes from module Puppet::Icinga2 to PuppetX::Icinga. I am working on this branch to solve the problem. |
Shoud be solved. |
If a update to 3.3.0 was done, this patch need a puppetserver restart. Otherwise updating from 3.2.2, no restart is required. |
Thanks for the quick fix :) |
You're welcome. Thx for the report. |
Hmmm, unfortunately I am not very happy with that fix. While there isn't any more errors in the puppet run, it does have an huge impact on the performance here. |
Is the runtime always 8 minutes or only when the catalog is not cached? Since for my setup, the puppetruns remain very fast (1,5 seconds) when loading the cached catalog. |
The runtime (and the high CPU-usage) stays that high with subsequent runs. Sure, our Icingamaster has a lot of resources that needs to be compiled, but it isn't really an issue with the old 3.2.2-version. |
@sircubbi An update from 3.2.2 to 3.3.1 doesn't require a restart or a cache clearing. |
Well, that wasn't clear from above comment, but ok. I did some fresh tests:
So something seems to affect the performance pretty badly. |
Only something about functions was changed in this fix. Functions are evaluated on the Puppetserver, i.e. the catalog compile times would be affected here. |
Yep, it absolutely is. As written: the CPU-usage goes up to 100% on the puppetmaster for several minutes (while the agent on the icinga2-server waits for the catalog). With 3.2.2 it takes the puppetmaster like 30-45 seconds to compile the catalog, while it takes around 8 minutes with 3.3.1). |
@sircubbi I have unsuccessfully tried to recreate this behavior. Do you use many extra icinga puppet objects? |
Well, we actually have quite a few objects that are collected from all our hosts:
|
@sircubbi Do have any performance impacts on the side of the agents? They use the same code / function but without extra icinga puppet objects. |
At least not noticeable, no. All other agents seem to work fine, only the icingamaster itselfs takes really long for the agentrun while waiting on the catalog from the puppetmaster. |
@sircubbi Strange. The objects above are exported resources, aren't they? And from personal interest, why 490 zones and only 292 endpoints? |
Ah, I just realized that some resources are counted double in that query. I guess when looking at our icingamaster only the resources created by that node and all imported resources are important). So I guess a more cleaner picture would be this:
So I guess an agent-run on the icinga-master has to consider slightly more than 2000 different resources. We have around 100 hosts that are collected. Most of the services are realized via apply-rules. However there are still some services which are defined per host and exported to the icingamaster. |
Why this discrepancy between 3.2.2 and 3.3.1 occurs I do not know "yet". But exported resources are very expensive and should be limited to hosts, zones and endpoints in the Icinga environment. |
Well, that is known and we mostly use apply for all of our services. There are some corner cases where it was easier to have a host just export a small set of "special"-services. The biggest part of the service-objects are actually no exported resources, but some virtual services that the icinga-server creates from our netbox-generated hierafile. So far it wasn't a big issue, as the puppetmaster took under a minute to compile the catalog and the icingamaster also well under a minute to apply it. |
@sircubbi Now, I spent several hours and I think, I get something. The new function calls in increases my puppet run from 1:21 up to 1:45. 600 hosts (exported resources) and 2500 services (apply directly on icinga server) |
Too bad, it won't be any faster with an EPP instead of ERB template. |
When looking at the historie that template always contained function-calls, why is it so slow with the new version? |
@sircubbi Can you try branch fix/704-tuning? Should be faster, not so fast like v3.2.2, but faster. |
I can confirm that fix/704-tuning fixes the performance issue for me. Actually I don't see much difference in the runtime compared to v3.2.2, so much better than with v3.3.1. Thanks. |
@sircubbi thx. Release is coming... |
Release 3.3.0 introduces error:
Evaluation Error: Error while evaluating a Function Call, uninitialized constant Puppet::Pops::Loader::RubyFunctionInstantiator::PuppetX (file: /etc/puppetlabs/code/environments/production/modules/icinga2/manifests/config.pp, line: 19, column: 28)
Expected Behavior
Refactoring classes should not introduce errors. Maybe the testsuite didnt pickup on this? I am currently not sure where exactly this breaks, but my first guess would be manifest/config.pp line:19.
If icinga2::attributes($constants) would be used congruent to previous releases it should be attributes($constants)
(from previously: icinga2_attributes($constants)).
I think at least, didnt get to do any testing. But maybe I am overlooking something in my setup, thats causing this. Can someone confirm this behaviour?
Steps to Reproduce (for bugs)
Update icinga-icinga2 version from 3.2.2 to 3.3.0
Your Environment
puppet module list
): icinga-icinga2 3.3.0, icinga-icinga 2.7.1puppet -V
): 6.27.0The text was updated successfully, but these errors were encountered: