jump to navigation

mrocstat – Mongrel pROCess title information stats August 18, 2008

Posted by John Dewey in Command Line, Mongrel, Plugins & Gems, Ruby, WebServers.
add a comment

I wrote a little tool which reports Mongrel’s process title information when using the mongrel_proctitle plugin. There is a gem which reports similar information, however, I like bundling utility scripts as SVN externals with my applications.

You can find the script on github.

multi-port memcache init script August 16, 2008

Posted by John Dewey in Code, Configuration, Memcached.
add a comment

We use memcached quite a bit, and deploy it as a farm of many processes across many systems. I wanted to share a memcached multi-port init script. See the README for usage. Script is based off “The Commando Pattern“, and could use some reworking (especially around the port definition area).

Disable mongrel mod_proxy_balancer workers via Capistrano August 15, 2008

Posted by John Dewey in Capistrano, Configuration, Deployment, Mongrel, Rails, WebServers.
add a comment

I created a Capistrano task for disabling workers inside a given balancer, from Daniel Wharton’s Deploying Rails post.

Here’s the pastie. BTW I really hate linking off to pastie for these things. Any suggestions?

The task disables the worker, and is not specific to Mongrel.

memcache ruby 1.8.5 problems August 14, 2008

Posted by John Dewey in Memcached, Rails, Rake, Ruby, Solaris.
1 comment so far

We have some boxes at Joyent and for one reason or another, they are still on 1.8.5. We memcached an expensive Solr query, but ran into intermittent 500 errors.

Look at the odd stacktrace, with references to rake. Anyways, long story short – an upgrade to 1.8.6 fixed the problem. Yeah Yeah Yeah, I know — bad us — we should have upgraded long ago.

ActionView::TemplateError (wrong number of arguments (1 for 2))
on line #15 of topics/_search_result.html.erb:

View the pastie

Reloading classes in RSpec August 11, 2008

Posted by John Dewey in Code, Example, RSpec, Ruby.
1 comment so far

I had a class where methods could change a class variable’s structure on load. However, RSpec doesn’t reload a class, so testing
these methods is difficult.

One can reload a class inside RSpec by adding a before task:

describe SimplyTabby, "remove_system_information class method" do
  before(:each) do
    Object.send(:remove_const, 'Clazz')
    load 'clazz.rb'
  end

  it "should ..."
	...
  end
end