From: Sean O'Dell Date: 2002-06-06T07:41:50+09:00 Subject: Re: mod_ruby and module space Kent Dahl wrote: > Sean O'Dell wrote: > >>That's the conclusion I came to here, that the first script is in an >>anonymous namespace and the loaded module seems to be in another >>namespace altogether...guess it's time to report that. >> > > The loaded (or required) module falls into the toplevel namespace, where > it should be. (Or requiring any library would get very messy indeed.) > > BTW: A nice thing I hadn't seen anywhere in the mod_ruby documentation; > the lib/apache/ruby-debug.rb variant which outputs exception info to the > client. (It really should have been default in the installation for > mod_ruby_nubies like myself. :-) > > >>I just switched >>to having my scripts executed as CGI programs using command-line ruby. >>mod_ruby has some fundamental things I don't like about it, like not >>being able to completely clean up the interpreter between uses. >> > > Is it really that bad? I mean, the resources that take up space is > mostly compiled code, such as the required files that still lingers in > memory (and makes subsequent calls to the script faster, I would assume, > since the requires would just return at once) and whatever hasn't been > taken by a GC just yet. I wouldn't think that any other junk would float > around. But I'm not intimate with the details of mod_ruby... I'm going to use mod_ruby where I can...but it does freak me out. Luckily, I'm going to be hosting Apache in a chroot'd environment from now on, so scripts run by multiple clients on the same machine won't have to share environments. I'm sure Apache 2.0 with its threading will help make that a non-issue, but under 1.3, virtual hosting with Ruby and Apache would be a security nightmare. What's really sad is, the only thing I could count on to clean up a Ruby script was the complete shutting down of the interpreter between each script. But mod_ruby took that away! :-( >>Between >>that feature and Ruby's garbage collection system, preserving resources >>seems to be a forgotten relic of ancient programming techniques or >>something. I wish there was more focus on making things clean and tight. >> > > I know what you mean, but as for this case, with webservers and > server-side scripts, I think that the resource-eating is fairly > proportional to the speedgains. (Now, as for running Ruby stuff on a > handheld that isn't one of the new $500 monsters, I totally agree :-)) Possibly...throwing memory at the Ruby GC issue isn't so bad, I guess. Sean