Segment7 - The Blog

Onward Hoe!

Posted by Eric Hodel Sat, 28 Oct 2006 05:15:57 GMT

I used Hoe to release the paginator files… and I have to say that’s the easiest, least painful release I’ve ever done. As Ryan said at the conference, it makes it easy to release often—and that is spectacular!

As a self-described Rake nerd, I find Hoe to be truly compelling from a technical standpoint—but its possible effect on the community is even more exciting. Quicker, smaller releases are better for everyone, and with the addition of sow to the library, getting up and running is easier than ever.

My thanks to Ryan Davis and Ara Howard (not to mention the bevy of other contributers) for making something like this available to the community.

—Onward Hoe! via Codefluency – Home

Posted in Ruby, Seattle.rb, Software | no comments | 20 trackbacks

Hoe Down

Posted by Eric Hodel Tue, 24 Oct 2006 16:04:46 GMT

Hoe Down!

Updates daily, or something. Incidentally, after we got the awesome part of the idea for the Hoe Down page a bunch of Brooks and Dunn fans joined us on the Portland MAX.

Posted in Seattle.rb, Ruby | 1 comment | 31 trackbacks

[ANN] RingyDingy 1.1.0 Released

Posted by Eric Hodel Tue, 24 Oct 2006 15:59:57 GMT

RingyDingy version 1.1.0 has been released!

seattlerb.rubyforge.org/RingyDingy

RingyDingy automatically re-registers your DRb service with a RingServer should communication with the RingServer stop.

Changes:

  • Added ring_server executable (Rinda::RingServer wrapper)
    • Daemon mode
    • Rinda::RingServer service listingph
    • Remote verbose mode enable-disable
  • Switched to Hoe

Posted in Conference, Software, Seattle.rb, DRb | no comments | 71 trackbacks

Controlling Rails Process Size

Posted by Eric Hodel Wed, 13 Sep 2006 07:44:00 GMT

Now that Ruby 1.8.5 is out setting process limits is easier than ever before! We used to use a small shell script run from cron to kill processes that got too big for their britches. Unfortunately this was difficult to do both well and simply (we chose simply).

Now, in Ruby 1.8.5, we have Process::setrlimit:

$ ri Process::setrlimit
----------------------------------------------------- Process::setrlimit
     Process.setrlimit(resource, cur_limit, max_limit)        => nil
     Process.setrlimit(resource, cur_limit)                   => nil
------------------------------------------------------------------------
     Sets the resource limit of the process. cur_limit means current 
     (soft) limit and max_limit means maximum (hard) limit.

     If max_limit is not given, cur_limit is used.

     resource indicates the kind of resource to limit. The list of 
     resources are OS dependent. Ruby may support following resources.

Process::RLIMIT_COREcore size (bytes) (SUSv3)
[...]
Process::RLIMIT_RSSresident memory size (bytes) (4.2BSD, GNU/Linux)

There's a bunch more in there, but those were the two I was most interested in using. I really don't want cores, and I don't want my application processes to grow too big, but I want cron jobs to get as big as they need to get.

At the top of config/environment.rb above everything else I have:

Process.setrlimit Process::RLIMIT_RSS, 1024*1024*150, Process::RLIM_INFINITY

And to eliminate core dumps, in config/environments/production.rb I have:

Process.setrlimit Process::RLIMIT_CORE, 0, Process::RLIM_INFINITY

Keeping the hard limit at infinity allows me to increase the limit at a later date, for example when running cron jobs. To give cron jobs different limits I've added a config/environments/cron.rb that slurps the production values then overrides as necessary:

eval File.read("#{RAILS_ROOT}/config/environments/production.rb")

CachedModel.use_local_cache = false

# Cron jobs can use a much memory as they want.
Process.setrlimit Process::RLIMIT_RSS, Process::RLIM_INFINITY

(That eval is in there because of that's the same hack that Rails::Initializer uses to expose config in environm

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.