[Mongrel] cluster with environment variables

Jason Yates jaywhy at gmail.com
Mon Mar 5 17:10:06 EST 2007

I should have responded earlier to myself.  Just in case others have
similar problems in the future.

The problem wasn't mongrel at all.  However, the issue seemed to be
coming from mongrel, because for whatever reason an error from Rjb
wasn't getting logged

The problem was Java was eating up all the available memory.  Because
each mongrel instance would start its own Java process. The first one
would steal all the available memory. Then the second couldn't even
start because no memory was available.  Hence one mongrel instance
would work the other wouldn't

The JRE does this because it checks for available system memory and
allocates a portion of it.  Which is fine, however in my case I'm
using a virtual server.  So I only had a 256mb portion of the 4gbs
Java thought it had to play with.

Anyways I blogged about it.  If anyone cares.


On 2/23/07, Jason Yates <jaywhy at gmail.com> wrote:
> In production I've setup a mongrel cluster of 2 servers.  Now I'm
> using RJB(ruby java bridge).  So I need certain java environment
> variables set before mongrel starts.
> So I set them:
> export LD_LIBRARY_PATH=/usr/java/jdk1.6.0/jre/lib/i386/:/usr/java/jdk1.6.0/jre/lib/i386/client/:./
> export JAVA_HOME=/usr/java/jdk1.6.0/
> Then I run "mongrel_rails cluster::start".
> Now for whatever reason only the first server in the cluster seems
> have the environment variables set.  Like as if the environment is
> getting blanked out after the first server starts but before the
> second.
> So I on the page using RJB.  I end up with this weird refresh problem.
>  Where it works, then errors, works, error, etc.
> I'm using rails 1.2.1 and mongrel 1.0.1 and cluster 0.2.1.  If that helps.
> --
> Jason Yates
> jaywhy at gmail.com

Jason Yates
jaywhy at gmail.com

More information about the Mongrel-users mailing list