https://www.puppet.com/community logo
Join Slack
Powered by
# voxpupuli
  • c

    csharpsteen

    08/03/2023, 2:46 PM
    That does sound like a resource that is adding a lot of new generated resources to the catalog. Files with
    recurse => true
    are the usual suspect.
  • b

    bastelfreak

    08/03/2023, 2:47 PM
    https://gist.github.com/bastelfreak/43232c379e5a9b905eaf6248b026961e as an example
  • b

    bastelfreak

    08/03/2023, 2:48 PM
    I diffed the catalog, the only diff I could see was was the ordering of profiles:b/profilesc/profiles:d. amount of resources stayed the same
  • b

    bastelfreak

    08/03/2023, 2:49 PM
    mhm autogenerated resoures would be generated on the fly by the provider/type and won't be present in the catalog?
  • c

    csharpsteen

    08/03/2023, 2:51 PM
    Pretty much. The resource present in the catalog returned by Puppet Server "expands" to generate additional resources when the agent prepares the catalog for evaulation.
    recurse => true
    is the prototypical example as it generates a new resource for each file present a directory tree on the agent. The
    resources
    resource is another common source.
  • b

    bastelfreak

    08/03/2023, 2:52 PM
    I think the enterprise modules also generate a lot of resources
  • b

    bastelfreak

    08/03/2023, 2:53 PM
    it would help a bit when I could get more debug output about what puppet is doing
  • c

    csharpsteen

    08/03/2023, 2:53 PM
    As for the chaining arrow, I'm not sure what's going on there. What should be happening is just one additional relationship between the end whit of
    profile::b
    and the begin whit of
    profile::c
    and one additional relationship between the end whit of
    profile::c
    and the begin whit of
    profile::d
    .
  • b

    bastelfreak

    08/03/2023, 2:53 PM
    it always freezes at a different resource, but always with
    Adding autorequire relationship
  • b

    bastelfreak

    08/03/2023, 2:53 PM
    yes that's what I saw in the diff
  • c

    csharpsteen

    08/03/2023, 2:54 PM
    It's also quite likely this is an area where there isn't any additional debug output.
  • b

    bastelfreak

    08/03/2023, 2:54 PM
    yeah 😞
  • c

    csharpsteen

    08/03/2023, 2:55 PM
    Puppet probably drops into a loop that doesn't have any additional logging statements inside of it and ends up exhausting memory inside that loop.
  • b

    bastelfreak

    08/03/2023, 2:57 PM
    My naive thought was that it processes everything in the catalog and one of those elements triggers an expansion. but It doesn't log the elements that will be processed but only those that are processed
  • b

    bastelfreak

    08/03/2023, 2:57 PM
    so basically it feels like it's logging after the loop, not before
  • b

    bastelfreak

    08/03/2023, 2:58 PM
    but I didn't find the correct place in the soruce code where I could patch around
  • c

    csharpsteen

    08/03/2023, 4:03 PM
    Just had a thought:
    strace
    could be useful. There might be a pattern in what the Puppet process is looking at via syscalls leading up to the OOM.
  • b

    bastelfreak

    08/03/2023, 4:10 PM
    finding the correct thing in strace is always... challenging :D
  • c

    csharpsteen

    08/03/2023, 4:13 PM
    Sometimes. If this was a
    recurse => true
    issue, then there should be something like a ton of
    stat()
    calls going to the same directory tree leading into the OOM.
  • c

    csharpsteen

    08/03/2023, 4:14 PM
    If that sort of repeating pattern isn't there, then that's evidence of something purely inside application memory --- like the chaining arrow somehow producing an explosion of resource relationships that consume memory.
  • b

    bastelfreak

    08/03/2023, 4:19 PM
    I assume it's the latter, I just nodd to prove that
  • s

    smortex

    08/03/2023, 4:25 PM
    o/ Some flamegragh might help to see the call stack where most CPU time is used: https://www.brendangregg.com/flamegraphs.html I never tried it with Ruby, but I think I saw ways to do it.
  • c

    csharpsteen

    08/03/2023, 4:27 PM
    rbspy
    can do that, I haven't tried to use it with
    puppet-agent
    though: https://rbspy.github.io/
  • b

    bastelfreak

    08/03/2023, 4:38 PM
    @smortex @csharpsteen even wrote about it!
    👍 1
  • b

    bastelfreak

    08/03/2023, 4:39 PM
    https://portal.perforce.com/s/article/360041682173
  • b

    bastelfreak

    08/03/2023, 4:39 PM
    reads it again
  • b

    bastelfreak

    08/03/2023, 4:39 PM
    totally forgot about it
  • c

    csharpsteen

    08/03/2023, 4:39 PM
    That's using flame graphs at a different layer.
  • c

    csharpsteen

    08/03/2023, 4:41 PM
    Specifically, taking the
    PROFILE
    logs produced by Puppet Server when compiling catalogs and transforming them into something that
    flamegraph.pl
    can draw a picture of. So, you'd still need something like
    rbspy
    to look at Ruby operations.
  • b

    bastelfreak

    08/03/2023, 4:42 PM
    ah thats only for catalog requests on the agent side
1...570571572...648Latest