Skip to content
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

Improve performance of zabbix_host #558

Closed
baurmatt opened this issue Nov 1, 2018 · 0 comments · Fixed by #559
Closed

Improve performance of zabbix_host #558

baurmatt opened this issue Nov 1, 2018 · 0 comments · Fixed by #559

Comments

@baurmatt
Copy link
Contributor

baurmatt commented Nov 1, 2018

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: Puppet 5.5.6
  • Ruby: Ruby 2.4.3
  • Distribution: Ubuntu 16.04
  • Module version: Current master

How to reproduce (e.g Puppet code you use)

(The hosts are already created in Zabbix)

$range = range(0, 3000)

$range.each |$i| {
  zabbix_host { "test${i}":
    templates    => ['Template OS Linux'],
    ipaddress    => '127.0.0.1',
    port         => 10050,
    use_ip       => true,
    group        => 'testhosts',
    group_create => true,
    zabbix_url   => 'zabbix-host.example.de',
    zabbix_user  => 'Admin',
    zabbix_pass  => 'zabbix',
  }
}
root@mbaur-zabbix:~# puppet apply test.pp
Notice: Compiled catalog for mbaur-zabbix.restvlan6.syseleven in environment production in 2.20 seconds
Notice: Applied catalog in 126.52 seconds

What are you seeing

The performance of zabbix_host is really poor. The problems seems to be, that Puppet does, for the a single host as definied above, 7 API calls. If there would be an additional template the API call count goes up to 13 and increases even further for more templates.

What behaviour did you expect instead

Puppet does 2 API calls:

  • login
  • get host with templates

Output log

Any additional information you'd like to impart

baurmatt added a commit to syseleven/puppet-zabbix that referenced this issue Nov 2, 2018
Before this commit, every template added to a host genarated addtional 5
API calls. This isn't needed as we can get all required information by
only one API call.

Fixes voxpupuli#558.
baurmatt added a commit to syseleven/puppet-zabbix that referenced this issue Nov 2, 2018
Before this commit, every template added to a host genarated addtional 5
API calls. This isn't needed as we can get all required information by
only one API call.

Fixes voxpupuli#558.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant