[chef] Re: RE: Re: RE: Re: RE: RE: Re: chef server load testing


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: RE: Re: RE: Re: RE: RE: Re: chef server load testing
  • Date: Fri, 13 Mar 2015 12:52:34 -0700



On Friday, March 13, 2015 at 12:40 PM, Marcus Simonsen wrote:

> It was only an idea, simply to workaround the expense of loading chef/ruby.
> I may be able to load and cache the ruby process from within JMeter, so 
> that each sample (request) can re-use it somehow... Not sure how feasible 
> this is.
>  
> The suggestion of using ec_metal is not available to me as we build out our 
> own Chef servers in house (private cloud).
>  
> -marcus
>  
> ________________________________________
> From: AJ Christensen 
> 
>  
> (mailto: )]
> Sent: 13 March 2015 15:26
> To: 
> 
>  
> (mailto: )
> Subject: [chef] Re: RE: Re: RE: RE: Re: chef server load testing
>  
> The cost of ruby processes/classes is expensive > I know I'll run it
> in JRuby; hehe, I love it - interesting approach.
>  
> I do not know that any work has been done to get Chef running on
> JRuby. It is not likely to work, as mentioned, requiring the fork
> syscall (this will spill over to affecting Ohai as well which relies
> on it); you may be able to patch mixlib::shellout::unix to use Spoon
> or a process_spawn type implementation which will be available to you.
> Similar work would have to be undertaken for ohai. That's probably
> only touching the surface.

I’ve done this for a subset of the Chef codebase needed to use Chef::REST in 
the past. Though since I did that last we added some stuff like the locale 
check in Chef::Config that Marcus ran into.
  
>  
> https://rubygems.org/gems/spoon
> https://github.com/rtomayko/posix-spawn
>  
> I would not recommend this path to someone inexperienced with Ruby,
> Chef and deeply familiar with implementation-specific challenges
> regarding a JRuby application.

AJ is correct here, you’ll have to do some extra work to avoid any calls to 
Mixlib::ShellOut if you want to use JRuby. Hopefully you only need to make a 
few workarounds, but it’ll unfortunately require a little whack-a-mole.
>  
> cheers,
>  
> --aj
>  
> On Sat, Mar 14, 2015 at 8:19 AM, Marcus Simonsen
> <
>  
> (mailto: )>
>  wrote:
> > Many Thanks Daniel.
> > I've been able to do basic create nodes and clients, with the rest api. 
> > And I'm sure with more digging that I can load cookbooks etc...
> > It appears that the cost of starting the ruby process/associated ruby 
> > classes is expensive, so I'm now wondering about the possibility of 
> > running jruby/chef inside of the JMeter JVM.
> > Results aren't promising:
> > ./jruby my_sample_rest_client.rb
> > =>
> > NotImplementedError: fork is not available on this platform
> > fork at org/jruby/RubyKernel.java:1735
> > fork_subprocess at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/mixlib-shellout-2.0.1/lib/mixlib/shellout/unix.rb:284
> > run_command at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/mixlib-shellout-2.0.1/lib/mixlib/shellout/unix.rb:52
> > run_command at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/mixlib-shellout-2.0.1/lib/mixlib/shellout.rb:248
> > shell_out_command at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/chef-12.1.1/lib/chef/mixin/shell_out.rb:97
> > shell_out_with_systems_locale at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/chef-12.1.1/lib/chef/mixin/shell_out.rb:61
> > shell_out_with_systems_locale! at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/chef-12.1.1/lib/chef/mixin/shell_out.rb:65
> > guess_internal_locale at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/chef-12.1.1/lib/chef/config.rb:673
> > (root) at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/chef-12.1.1/lib/chef/config.rb:702
> > (root) at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
> > require at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54
> > require at org/jruby/RubyKernel.java:954
> > (root) at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/chef-12.1.1/lib/chef.rb:24
> > (root) at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
> > require at org/jruby/RubyKernel.java:954
> > require at 
> > /opt/jruby-9.0.0.0.pre1/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:128
> > <=
> > Unless you know how to suppress fork?
>  

Like I hinted at before, you need to look at the code calling the shellout 
command and figure out how to stop it from doing so. In the case of this 
config option, you might be able to set the configuration explicitly in your 
config file to avoid this auto detection code.

--  
Daniel DeLeo  







Archive powered by MHonArc 2.6.16.

§