Agente Puppet usando 100% de CPU, em um único nó por uma hora

5

O Puppet parece atrelar a CPU quando tento fazer um implantar recursiva de um diretório em uma pasta que já possui um número substancial de arquivos.

O provedor usado pelo recurso do usuário em meus sistemas não parece implementar os arquivos em / etc / skel em um diretório recém-provisionado. Então, pareceu-me que eu poderia usar essa implantação recursiva para preencher o diretório dessa maneira.

  # password is in the vault
  user { "myuser":
    ensure => 'present', 
    password => 'guessmypassword',
    home => '/home/myuser',
    shell => '/bin/bash',
  }

  file { '/home/myuser':
    ensure => directory,
    owner => 'myuser',
    group => 'myuser',
    mode => 0755,
    require => User['myuser'],
  }

  file { '/home/myuser/.ssh':
    ensure => directory,
    owner => 'myuser',
    group => 'myuser',
    mode => 0700,
    require => User['myuser'],
  }

  file { 'myuser_skeleton':
     path => '/home/myuser',
     source => '/etc/skel',
     owner => 'myuser',
     group => 'myuser',
     recurse => true,
     replace => false,
  }

Onde o problema parece aparecer é que o usuário, em um dos sistemas, tinha uma cópia de trabalho svn de um projeto com cerca de 5.000 arquivos. Uma marionete nesse sistema parece estar a 100% por 40 minutos.

Eu corri marionete sob strace, durante o bloqueio parece continuar chamando gettimeofday () mais de 4000 vezes para alguns arquivos, então ele se move para o próximo e repete.

munmap(0xb6ffc000, 4096)                = 0
lstat64("/home/myuser/ptlib/include/ptlib/Nucleus++/ptlib/.svn/tmp/props", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/home/myuser", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
lstat64("/home/myuser/ptlib/src/ptlib/common/.svn/prop-base/sfile.cxx.svn-base", {st_mode=S_IFREG|0444, st_size=109, ...}) = 0
stat64("/usr/local/lib/site_ruby/1.8/digest/md5.rb", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/site_ruby/1.8/digest/md5.so", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/site_ruby/1.8/i486-linux/digest/md5.rb", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/site_ruby/1.8/i486-linux/digest/md5.so", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/site_ruby/1.8/i386-linux/digest/md5.rb", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/site_ruby/1.8/i386-linux/digest/md5.so", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/site_ruby/digest/md5.rb", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/site_ruby/digest/md5.so", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/vendor_ruby/1.8/digest/md5.rb", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/vendor_ruby/1.8/digest/md5.so", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/vendor_ruby/1.8/i486-linux/digest/md5.rb", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/vendor_ruby/1.8/i486-linux/digest/md5.so", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/vendor_ruby/digest/md5.rb", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/vendor_ruby/digest/md5.so", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/1.8/digest/md5.rb", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/1.8/digest/md5.so", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/1.8/i486-linux/digest/md5.rb", 0xbff645f0) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/ruby/1.8/i486-linux/digest/md5.so", {st_mode=S_IFREG|0644, st_size=6848, ...}) = 0
open("/usr/lib/ruby/1.8/i486-linux/digest/md5.so", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=6848, ...}) = 0
close(6)                                = 0
open("/home/myuser/ptlib/src/ptlib/common/.svn/prop-base/sfile.cxx.svn-base", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0444, st_size=109, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ffc000
read(6, "K 17\nCVSRevisionNumber\nV 3\n1.3\nK"..., 4096) = 109
read(6, "", 4096)                       = 0
close(6)                                = 0
munmap(0xb6ffc000, 4096)                = 0
lstat64("/home/myuser/ptlib/plugins/vidinput_bsd/.svn/props", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/home/myuser", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
gettimeofday({1319573116, 304890}, NULL) = 0
gettimeofday({1319573116, 304951}, NULL) = 0
gettimeofday({1319573116, 304993}, NULL) = 0
gettimeofday({1319573116, 305034}, NULL) = 0
... repeats ~4000 times.  
gettimeofday({1319573116, 305075}, NULL) = 0
gettimeofday({1319573116, 305116}, NULL) = 0
gettimeofday({1319573116, 305158}, NULL) = 0
gettimeofday({1319573116, 305199}, NULL) = 0
gettimeofday({1319573116, 305245}, NULL) = 0
brk(0xbbf1000)                          = 0xbbf1000
brk(0xbc12000)                          = 0xbc12000
brk(0xbc33000)                          = 0xbc33000
brk(0xbc55000)                          = 0xbc55000
brk(0xbc76000)                          = 0xbc76000
brk(0xbc98000)                          = 0xbc98000
... repeats 200 times
stat64("/etc/skel", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/etc/skel", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/etc/skel", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/etc/skel", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 6
brk(0xc334000)                          = 0xc334000
lseek(6, 0, SEEK_SET)                   = 0
getdents64(6, /* 5 entries */, 32768)   = 144
getdents64(6, /* 0 entries */, 32768)   = 0
close(6)                                = 0
... and one
    
por Zoredache 25.10.2011 / 23:30

1 resposta

10

Use recurse => remote em vez de recurse => true - isso varrerá apenas os arquivos no lado do servidor em vez do cliente.

remote — Descends recursively into the remote directory but not the local directory. Allows copying of a few files into a directory containing many unmanaged files without scanning all the local files.

de link

    
por 25.10.2011 / 23:40

Tags