【问题标题】:Chef Selenium: rubyzip failure to allocate memory issue on Windows Server 2008Chef Selenium:rubyzip 无法在 Windows Server 2008 上分配内存问题
【发布时间】:2015-05-02 15:16:32
【问题描述】:

在 Windows Server 2008 和 2008R2 上发生以下异常:

================================================================================
  Error executing action `install` on resource 'chef_gem[rubyzip]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" ----
STDOUT:
  STDERR: [FATAL] failed to allocate memory
---- End output of C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" ----
Ran C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" returned 1

这不会发生在 Windows Server 2012 和 2012 R2 上。

【问题讨论】:

    标签: selenium chef-infra selenium-grid


    【解决方案1】:

    来自https://github.com/chef/knife-windows#nodes

    Chef 和 Ohai gem 安装(在引导期间发生)占用的内存超过了 Windows 旧版本(Windows Server 2012 之前)上每个 shell 的默认 150MB WinRM 分配的内存——这可能会减慢引导速度。可选择使用以下命令将内存限制增加到 300MB:

    winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
    

    另请注意:

    Windows 2008R2 及更早版本需要对 MaxTimeoutms 进行额外配置,以避免在引导时出现 WinRM::WinRMHTTPTransportError: Bad HTTP response 错误。至少应该是 300000。

    winrm set winrm/config @{MaxTimeoutms=300000}
    

    【讨论】:

      【解决方案2】:

      调整 winrm 设置并没有解决问题。

      Rubyzip 似乎是分配了太多对象的问题: http://blog.huangzhimin.com/2012/10/02/avoid-using-rubyzip/

      用 powershell 替换 ruby​​zip 实现解决了这个问题: https://stackoverflow.com/a/26843122/4548096

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-03-31
        • 1970-01-01
        • 1970-01-01
        • 2011-08-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-12-14
        相关资源
        最近更新 更多