gem vs plugins

2 views
Skip to first unread message

insect

unread,
Jan 6, 2010, 2:54:14 PM1/6/10
to Phusion Passenger Discussions
What is preferable to use gems or plugins if both are available?
I can imagine that gems will be shared between differen instances and
even applications (lieke framework code, smart-lv2 spawner). This
should reduce memory usage.
Does anybody already investigated this field?

Isaac

unread,
Jan 6, 2010, 4:41:47 PM1/6/10
to Phusion Passenger Discussions
I'm curious about this as well. We are hosting an app which is meant
to be run as a separate instance for each site (not multi-tenant), but
do have 20-30 of these sites on a single server (most of them are
running exactly the same version of the code, but it's possible that
some sites are staying on older versions, which is part of why they
are separate). It would be very cool to be able to have the code
shared in memory across all the sites that are the same version of our
code, similar to how the gem rails code is shared. Is the code
sharing based on the path to the files that were loaded in? If we
symlinked to the same code base for different sites would that make
them share the code in memory?

Cheers,

- Isaac

Hongli Lai

unread,
Jan 6, 2010, 5:22:09 PM1/6/10
to phusion-passenger

There is no difference at this time. Plugin code and gems that aren't
already Rails dependencies are considered to be part of the
application code as far as Phusion Passenger is concerned, and so
their memory will be shared between instances of the same application.

There's currently no way to share the memory of other gems between
different apps; we don't have a config option for that.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Hongli Lai

unread,
Jan 6, 2010, 5:24:40 PM1/6/10
to phusion-passenger
On Wed, Jan 6, 2010 at 10:41 PM, Isaac <is...@reuben.com> wrote:
> Is the code
> sharing based on the path to the files that were loaded in?

Yes.

> If we
> symlinked to the same code base for different sites would that make
> them share the code in memory?

That depends on the way Phusion Passenger treats your symlinks. See
http://www.modrails.com/documentation/Users%20guide%20Apache.html#application_detection

Reply all
Reply to author
Forward
0 new messages