speedycgi/pperl equivalent? 
Author Message
 speedycgi/pperl equivalent?

Is there an equivalent of SpeedyCGI or PPerl for Ruby?

  http://www.*-*-*.com/ (a.k.a. PersistentPerl)
  http://www.*-*-*.com/

They work by changing the #!/usr/bin/perl line to #!/usr/bin/speedy or
#!/usr/bin/pperl. The replacement version embeds the Perl interpreter.
The first time it's run, it loads the interpreter, compiles the script,
and daemonizes itself after establishing a Unix socket (or TCP listening
socket). Then the second time the binary is run it will detect that the
daemon already exists and then just run the already-compiled script in
the daemon process, communicating through the socket.

So in effect it is like FastCGI, but without the web/CGI-like protocol
stuff. To use PPerl/SpeedyCGI, just replace the shebang line.

--
dave



Sun, 07 Aug 2005 03:31:33 GMT  
 speedycgi/pperl equivalent?
It sounds kind of neat, like a more automagic fastcgi.  I don't think that
Ruby has anything like this currently.  Your options are fastcgi, modruby,
or webrick pretty much if you want to benefit from a persistent
interpreter.  As far as pre-"compilation" of scripts, Ruby doesn't have
anything like that afaik, aside from something like bRuby, but I don't
know how fast that is or if anyone is using it for this purpose (dumping
the AST so it can be reloaded), like .pyc files in Python.

Are you interested in porting it?

--Gabriel

Quote:

> Is there an equivalent of SpeedyCGI or PPerl for Ruby?

>   http://daemoninc.com/SpeedyCGI/ (a.k.a. PersistentPerl)
>   http://search.cpan.org/dist/PPerl/PPerl.pm

> They work by changing the #!/usr/bin/perl line to #!/usr/bin/speedy or
> #!/usr/bin/pperl. The replacement version embeds the Perl interpreter.
> The first time it's run, it loads the interpreter, compiles the script,
> and daemonizes itself after establishing a Unix socket (or TCP listening
> socket). Then the second time the binary is run it will detect that the
> daemon already exists and then just run the already-compiled script in
> the daemon process, communicating through the socket.

> So in effect it is like FastCGI, but without the web/CGI-like protocol
> stuff. To use PPerl/SpeedyCGI, just replace the shebang line.

> --
> dave



Sun, 07 Aug 2005 04:19:46 GMT  
 speedycgi/pperl equivalent?

Quote:

> Is there an equivalent of SpeedyCGI or PPerl for Ruby?

>  http://daemoninc.com/SpeedyCGI/ (a.k.a. PersistentPerl)
>  http://search.cpan.org/dist/PPerl/PPerl.pm

> They work by changing the #!/usr/bin/perl line to #!/usr/bin/speedy or
> #!/usr/bin/pperl. The replacement version embeds the Perl interpreter.
> The first time it's run, it loads the interpreter, compiles the script,
> and daemonizes itself after establishing a Unix socket (or TCP listening
> socket). Then the second time the binary is run it will detect that the
> daemon already exists and then just run the already-compiled script in
> the daemon process, communicating through the socket.

> So in effect it is like FastCGI, but without the web/CGI-like protocol
> stuff. To use PPerl/SpeedyCGI, just replace the shebang line.

Sounds similar to DRb

--

All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04

  application_pgp-signature_part
< 1K Download


Sun, 07 Aug 2005 05:56:13 GMT  
 speedycgi/pperl equivalent?

Quote:

> Is there an equivalent of SpeedyCGI or PPerl for Ruby?

>   http://daemoninc.com/SpeedyCGI/ (a.k.a. PersistentPerl)
>   http://search.cpan.org/dist/PPerl/PPerl.pm

Interesting. If the embedded interpreter restarts the CGI script for each
invocation, does that mean it loses global variables, so you couldn't keep a
persistent connection to a database for example? Or is that state carried
forward between invocations? (In which case why not just use mod_perl?)

Regards,

Brian.



Sun, 07 Aug 2005 23:07:38 GMT  
 speedycgi/pperl equivalent?

Quote:

> Interesting. If the embedded interpreter restarts the CGI script for each
> invocation, does that mean it loses global variables

[oops, found the FAQ!]

   How much of perl's state is kept when speedy starts another request?
   Do globals keep their values? Are destructors run after the request?

          Globals keep their values. Nothing is destroyed after the
          request. STDIN/STDOUT/STDERR are closed -- other files are not.

Not sure of the advantages over mod_perl though; you end up with a separate
pool of perl processes, in addition to Apache's pool of httpd servers. I
suppose if you use the C wrapper to handle CGI requests it means you don't
have to modify your web server (but then if you use mod_speedycgi then you
lose that benefit!)

Regards,

Brian.



Mon, 08 Aug 2005 00:27:06 GMT  
 speedycgi/pperl equivalent?

Quote:
> Not sure of the advantages over mod_perl though; ...

I think one is that you can use this for arbitrary scripts, run from
the command line.  

(Or does mod_perl do this?  I thought it was just for CGI processes.)

=====
--

Yahoo IM: michael_s_campbell

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com



Mon, 08 Aug 2005 00:45:04 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. undocumented: ....\ equivalent to ..\..\.. equivalent to ...\.. and so on

2. APL-equivalent to C. in J

3. Help - need Dolphin equivalent of VW method

4. Dolphin equivalent of VW thisContext

5. Smalltalk equivalent to servlets?

6. Smalltalk equivalent to Java-classes?

7. ST equivalent of lambda functions?

8. Newbie: Dialog class equivalents in ST Express

9. what is the J equivalent to APL n,/ ?

10. what is the J equivalent to APL n,/ ?

11. APL-equivalent to C. in J

12. awk-equivalent to e.g. cut -f5-

 

 
Powered by phpBB® Forum Software