Dec 2, 2010

Pain-killing one-liner for monitoring Phusion Passenger

Finally, I found a good article here describing the same problem I've met with Phusion Passenger which the memory usage can't be monitored by monit.

Here's the working command:
kill $(/opt/ruby-enterprise-1.8.7-2010.02/bin/passenger-memory-stats | grep '[56789]..\.. MB.*Rails' | awk '{ print $1 }')
This command means 'find out Rails sub-processes which consumes 500-999MB private memory will be killed.

I run it once per minute on my production server.


It just works.

Aug 11, 2010

Macport automatic upgrade caused some problems

Today while I'm upgrading Macport on my osx86 box, 2 serious errors were encountered.

  1. gcc43 upgrade to gcc44 compiling failed
  2. openssl upgraded from 0.9.8 to 1.0.0 caused libcrypto dependency broken
For me, it doesn't matter that gcc43 failed to upgrade to gcc44, so the macport team will fix it anyway.
The libcrypto dependency problem is a bit painful and I really don't care about what's improved in openssl 1.0.0, so I set it back to 0.9.8, following the instructions of this page.
Commands are simple:

First, list installed packages:
sudo port installed | grep openssl
I got the following returns:
  openssl @0.9.8k_0
  openssl @0.9.8l_0+darwin
  openssl @1.0.0a_0
So I decided to fall back to 0.9.8k_0...
sudo port deactivate openssl
sudo port activate openssl@0.9.8k_0
Done!