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

support for setting spawn limit via puppet #727

Closed
cabecada opened this issue Jul 10, 2017 · 4 comments
Closed

support for setting spawn limit via puppet #727

cabecada opened this issue Jul 10, 2017 · 4 comments
Assignees

Comments

@cabecada
Copy link

we have hit the bottleneck of too many checks (JIT) from a single server leading to issues addressed by sensu/sensu#1265. i know there are other workarounds to deal with this, but since this is public(?) config, i guess it should be configurable via puppet.

but it seems this is not yet configurable via puppet.
any plans to include this configurable option ?

@ghoneycutt
Copy link
Collaborator

Thanks @cabecada for reporting this!

@agoddard @cwjohnston I cannot find any documentation for this option on our site. Could you point me in the right direction?

Which file should this go in?

@cwjohnston
Copy link
Contributor

You're right there's no documentation for this setting presently. sensu/sensu-docs#451 is tracking that need. Because this modifies the concurrency of both sensu-server pipe handler execution and sensu-client check execution (when running on same system), I recommend using /etc/sensu/conf.d/spawn.json

@cabecada
Copy link
Author

This is what i tried but i guess this has to go via providers and types?
though hardcoded, but it can be parameterized.

class profiles::sensu::spawn {

  $config = {
    "sensu" => {
      "spawn" => {
        "limit" => 20
      }
    }
  }

  file { "/etc/sensu/conf.d/spawn.json":
    mode    => '0644',
    owner   => 'sensu',
    group   => 'sensu',
    require => Package['sensu'],
    content => inline_template(
      '<%= require "json"; (JSON.pretty_generate @config) + $/ %>'
    ),
    notify  => Class['sensu::client::service']
  }
}

Notice: /Stage[main]/Profiles::Sensu::Spawn/File[/etc/sensu/conf.d/spawn.json]/ensure: defined content as '{md5}8ee91eababa124edfe36cc58e637ed32'
Debug: /Stage[main]/Profiles::Sensu::Spawn/File[/etc/sensu/conf.d/spawn.json]: The container Class[Profiles::Sensu::Spawn] will propagate my refresh event
Info: /Stage[main]/Profiles::Sensu::Spawn/File[/etc/sensu/conf.d/spawn.json]: Scheduling refresh of Class[Sensu::Client::Service]

and the sensu-client.log
{"timestamp":"2017-07-10T10:11:57.986676+0000","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/spawn.json"}
{"timestamp":"2017-07-10T10:11:57.986712+0000","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/spawn.json","changes":{"sensu":{"spawn":{"limit":[12,20]}}}}


@jeffmccune jeffmccune self-assigned this Jul 13, 2017
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 13, 2017
Without this patch the Sensu spawn limit setting cannot easily be configured by
this module.  This patch addresses the problem by adding a sensu::spawn_limit
class parameter.  If unset, the parameter defaults to the behavior of Sensu
which is to have a limit of 12 in version 0.29.0.

Resolves sensu#727
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 13, 2017
Without this patch the Sensu spawn limit setting cannot easily be configured by
this module.  This patch addresses the problem by adding a sensu::spawn_limit
class parameter.  If unset, the module behavior defers to the default behavior
of Sensu which uses an effective spawn limit of 12 in version 0.29.0.

Resolves sensu#727
ghoneycutt added a commit that referenced this issue Jul 13, 2017
(#727) Add sensu::spawn_limit class parameter
@ghoneycutt
Copy link
Collaborator

Thanks everyone! @jeffmccune 's fix is in v2.24.0

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

No branches or pull requests

4 participants