mod_ruby: Consequences of shared interpreter

H

Hal Fulton

After more than two years, I'm looking at mod_ruby again.

I'm trying to figure out what the consequences are of all the scripts
being run with a single interpreter.

For example, if a script does: require 'foo'
will that remain in effect for subsequent scripts?

What about constants, global variables, changes to open classes?

Yes, I'm re-reading the docs. :) Point out to me anything I might
be missing, please.


Thanks,
Hal
 
P

Paul Vudmaska

Hal said:
After more than two years, I'm looking at mod_ruby again.

I'm trying to figure out what the consequences are of all the scripts
being run with a single interpreter.

It can be a bummer. And hellishly difficult to identify the cause of issues.
For example, if a script does: require 'foo'
will that remain in effect for subsequent scripts?

Yes. In development you will want to load 'foo' to restart the file
every time. mod_ruby caches required files.
I ran into the situation where i was loading cgi/session but was getting
a different version from a person who was sharing the virtual host. So
you might want to qualify your path. All of them. So instead of require
'cgi' require '/path/to/current/ruby/cgi'
What about constants, global variables, changes to open classes?
I've not run into any problems with that - but i'm doing the above.
Yes, I'm re-reading the docs. :) Point out to me anything I might
be missing, please.


Thanks,
Hal
I'm setting up an account on a host that provides a virtual machine for
each host(or a number of them), which hopefully, will negate some/all of
these things.

hub.org

Give me a bit to flesh this out some tho, i've not been overly happy
with the service(they have not set up mod ruby before, it seems) but
i'll let you know.


:paul
 
C

Charles Comstock

Paul said:
It can be a bummer. And hellishly difficult to identify the cause of
issues.

Why is it doesn't clear what is in memory? I mean you could just
totally clobber the vtable and it wouldn't matter, it's not like garbage
collection where some stuff has to live. It would seem to me there is a
way to run through a script and keep the interpreter running without
littering your namespace with all sorts of crap from the previous run
through.

Charles Comstock
 
A

Ara.T.Howard

Yes, I'm re-reading the docs. :) Point out to me anything I might be
missing, please.

http://www.fastcgi.com/
http://raa.ruby-lang.org/list.rhtml?name=fcgi

;-)

-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL :: http://www.ngdc.noaa.gov/stp/
| TRY :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done
===============================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,826
Members
47,371
Latest member
Brkaa

Latest Threads

Top