Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

can Perl-CGI run persistently on Windows 2008 with IIS 7.5? how?

by abcperl5 (Initiate)
on Aug 01, 2012 at 23:00 UTC ( [id://984914]=perlquestion: print w/replies, xml ) Need Help??

abcperl5 has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I need to find out if Perl CGI can be made to run persistently on Windows 2008 with IIS 7.5.

By "persistently", I mean that the Perl CGI script is interpreted once, then serves multiple HTTP requests in a row, while preserving in-memory data between requests (i.e., allowing for massive performance gains).

If this can be done, I will gladly pay $500 cash to the first person who can show me how. Showing me will consist of 1.) replying with some explanation of how _you_personally_ have gotten it to work and then 2.) I will give you an RDP login to a W2008 server and you will set it up.

Lots of technologies have promised persistent Perl CGI on Windows -- PerlEx, Perl ISAPI, FastCGI -- but none of them actually work (per my extensive online research & testing). Perhaps my problem is that the true experts who know how to do this aren't the ones writing newbie online tutorials and participating in forums... thus my $500 offer. I would really appreciate it if somebody could illustrate if/how this can be done.

Thanks, abcperl5

Replies are listed 'Best First'.
Re: can Perl-CGI run persistently on Windows 2008 with IIS 7.5? how?
by Anonymous Monk on Aug 01, 2012 at 23:56 UTC
Re: can Perl-CGI run persistently on Windows 2008 with IIS 7.5? how?
by flexvault (Monsignor) on Aug 02, 2012 at 17:18 UTC

    abcperl5,

      <Disclaimer> Haven't done this on Windows!</Disclaimer>

    But I have done this on *nix!

    Years ago I would use 'mod-perl', but Perl and mod-perl are moving apart (IMHO). So on one of my recent gigs, I used a persistent Perl parent/forked process ( ~25,000 lines ).

    The web server called a small cgi mod-perl script ( ~200 lines ) that sent the request to the persistent process using sockets, wait for the response, and then sent that response to the webserver. The performance was fantastic. With prototyping, eventually we got 8-10 requests per second per core. The input was 200-400 bytes, but the output could be 30K-200K bytes of HTML text.

    Good Luck!

    "Well done is better than well said." - Benjamin Franklin

      The web server called a small cgi mod-perl script ( ~200 lines ) that sent the request to the persistent process using sockets, wait for the response, and then sent that response to the webserver.

      How does that differ from fastcgi? (That's a real question not an admonishment. I don't do webstuff :)


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

        Hello BrowserUk,

          How does that differ from fastcgi?
        Since you know that I support a lot of different *nix type systems, I found it easier to define the HTTP, javascript, etc. differences as well as the different forks per core per server. Even different Linux distributions needed tinkering when using the 'same' web-server.

        I did try fastcgi and pperl(persistent perl) and a few more. In concept they do exactly what I did, but the 'devil is in the detail'. For example, I used pperl on a server that I could 'ssh' to and run persistent scripts, but if I connected the 1st time as 'aixterm' and then later as 'wyse60', all hell broke out. Now maybe an pperl expert would tell me "just ...", but I just couldn't find the information in the documentation.

        At that time in my Perl development, I didn't know about PM!

        Thank you

        "Well done is better than well said." - Benjamin Franklin

        :)(I'm guessing) Its written in pure-perl, and (probably) ad-hoc without an accompanying RFC (like FastCGI/PSGI)

      Thanks flexvault... I had a similar idea while pondering all this.

      Our application has a lot of file uploads, so many requests need to read several MB from STDIN -- which would complicate internal handoff. I was thinking I could have a script like /fast.pl which takes all GET requests and proxies them to a listener, as you describe, and then another script /upload.pl which accepts HTTP file uploads as traditional CGI.

      Anyway, it is reassuring to know that somebody has actually done this and had it work well. We don't have mod_perl but perhaps I could just take the hit of running the 200-line stub as normal CGI, or I could write a persistent C# stub.

        abcperl5,

        I wouldn't worry about not having mod-perl, with a script as small as 100-300 lines your talking milliseconds difference. Your testing will be a lot easier without mod-perl, since you can call the script from the command line. We didn't use mod-perl until we put the product into production.

        In your environment, with a lot of uploads, you wouldn't notice the compile step for Perl on the cgi script. The speed advantage is the persistent application that sits waiting to quickly respond to the cgi requests. From 'login' to 'logout' and all work in between, nothing has to be loaded after startup!

        We pre-forked the children so that they were waiting for work. The first time we tested, it looked like they never got called since our monitoring screen never changed from 'waiting' to 'working'. Checking the logs, it was working, but the time it took in the persistent application was faster than the refresh rate of the monitor.

        Good Luck!

        "Well done is better than well said." - Benjamin Franklin

Re: can Perl-CGI run persistently on Windows 2008 with IIS 7.5? how?
by abcperl5 (Initiate) on Aug 02, 2012 at 16:50 UTC

    Nobody? I'll pay $1000 to anyone who can demonstrate it working.

    linuxkid, our site also has some aspx code that depends upon IIS, so my hope was to get everything running on IIS.

Re: can Perl-CGI run persistently on Windows 2008 with IIS 7.5? how?
by linuxkid (Sexton) on Aug 02, 2012 at 01:27 UTC

    Couldn't you just use a WAMP stack and mod_perl

    --linuxkid


    imrunningoutofideas.co.cc

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://984914]
Approved by bulk88
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-28 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found