exec resource long runtime

70 views
Skip to first unread message

Royee Tager

unread,
Jan 18, 2015, 2:29:56 AM1/18/15
to puppet...@googlegroups.com

Hi, 

If I run the following command manually (time /usr/sbin/rhnreg_ks -v --serverUrl=http://spacewalk.example.com/XMLRPC --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware --nopackages --novirtinfo --norhnsd -v), the runtime is 15 seconds. However, if the command is performed via the exe resource the runtime is ~48 seconds.

Why is the runtime via the exe resource longer?

Is it possible shorten the runtime?

class spacewalk::config inherits spacewalk {

  file { '/etc/yum/pluginconf.d/rhnplugin.conf':

    ensure   => present,

    source   => 'puppet:///modules/spacewalk/rhnplugin.conf',

    owner    => root,

    group    => root,

    mode     => '0644',

    before   => Exec['register-client'],

  }

  exec { 'register-client':

    command => "/usr/sbin/rhnreg_ks -v --serverUrl=http://${::spacewalk::spacewalk_server_fqdn}/XMLRPC --activationkey=${::spacewalk::activation_key} --force --nohardware --nopackages --novirtinfo --norhnsd -v",

    require => Class['spacewalk::install'],

    unless  => '/usr/sbin/spacewalk-channel -l',

  }

}


Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: Starting to evaluate the resource

Debug: Exec[register-client](provider=posix): Executing check '/usr/sbin/spacewalk-channel -l'

Debug: Executing '/usr/sbin/spacewalk-channel -l'

Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/unless: Unable to locate SystemId file. Is this system registered?

Debug: Exec[register-client](provider=posix): Executing '/usr/sbin/rhnreg_ks --serverUrl=http://spacewalk.example.com/XMLRPC --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware --nopackages --novirtinfo --norhnsd'

Debug: Executing '/usr/sbin/rhnreg_ks --serverUrl=http://spacewalk.example.com/XMLRPC --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware --nopackages --novirtinfo --norhnsd'

Notice: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/returns: executed successfully

Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: The container Class[Spacewalk::Config] will propagate my refresh event

Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: Evaluated in 47.20 seconds


Thank you in advance,

Martin Alfke

unread,
Jan 18, 2015, 8:46:38 AM1/18/15
to puppet...@googlegroups.com
The 48 seconds is the complete time the agent needs for the catalog.
Within the catalog you are running two commands:

spacewalk-channel -l and rhnreg.

Please add both execution times when comparing.
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/e7aa4d1b-3086-4705-ab83-65f2acf85714%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Royee Tager

unread,
Jan 18, 2015, 9:54:53 AM1/18/15
to puppet...@googlegroups.com
Hi Martin,

Attached is the output of the commands:

[root@labit-lg02 ~]# time /usr/sbin/spacewalk-channel -l
Unable to locate SystemId file. Is this system registered?

real 0m1.125s
user 0m0.120s
sys 0m0.055s
[root@labit-lg02 ~]#

[root@labit-lg02 ~]# time /usr/sbin/rhnreg_ks --serverUrl=http://spacewalk.example.com/XMLRPC --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware --nopackages --novirtinfo --norhnsd
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

real 0m15.558s
user 0m9.997s
sys 0m0.704s
[root@labit-lg02 ~]#

בתאריך יום ראשון, 18 בינואר 2015 בשעה 15:46:38 UTC+2, מאת Martin Alfke:

Martin Alfke

unread,
Jan 18, 2015, 10:15:14 AM1/18/15
to puppet...@googlegroups.com
Please also keep in mind that puppet is doing more:

require => Class['spacewalk::install'],

There is another class which also gets executed.

The 48 second is not only the command execution time.
Its the whole catalog apply time.
Puppet always checks whether it has do do something prior doing changes.
e.g. check file md5sum, owner and group and permissions.

hth,

Martin
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/4e05168d-407d-44c1-b631-bd0c9960d1a7%40googlegroups.com.

Trevor Vaughan

unread,
Jan 22, 2015, 11:02:01 AM1/22/15
to puppet...@googlegroups.com
Hi Royee,

Try adding --evaltrace to your puppet run to see how long each resource is taking to apply.

Thanks,

Trevor


For more options, visit https://groups.google.com/d/optout.



--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvau...@onyxpoint.com

-- This account not approved for unencrypted proprietary information --
Reply all
Reply to author
Forward
0 new messages