2
votes

I would like to run a Perl web application on Windows (assume 2008 R2 x64) with reasonable speed / capacity.

Currently my app is based on Mojolicious, using Strawberry Perl and running as CGI through Apache 2.2-win32. With about 20000 lines of code, the creation of the perl process takes a lot of time, almost a second or two while the actually processing is just a blink of a second. I would imagine it to be running much faster and be able to serve much more req/sec if the app is configured in a Fast CGI or persistent style.

If I am on Linux, I would probably have sticked with the PSGI/Plack/Starman and Nginx reverse proxying. Unfortunately, Starman/Starlet does not support Win32.

Morbo/Twiggy does not meet my need because the webapp does block (DB calls) and for some request it does take a while to finish.

So I am looking at Fast CGI solution right now. Unfortunately Apache and mod_fcgid does not work with Perl (Stackoverflow). And I am yet be able to found or work out a compatible binary with mod_fastcgi with 2.4. Something I didn't try yet is mod_fastcgi + Apache 2.2, but I wish I could stay on Apache 2.4.

I am also thinking if I could run my own FCGI process manager (the thing that manage preforking), together with Mojo::Server::FastCGI, and use mod_proxy_fcgi to do reverse proxy instead. Perl module FCGI::ProcManager also does not support Win32. Could there be any other process manager, prehaps in C#? (Preferably in C# for further hacking)

Let me sum up the question -

  • What's the best way to run Perl web app on Windows at a speed much faster than CGI, but not in non-blocking style.
  • and prehaps that lead to a question of - how to make mod_fcgid works with Perl? Or is there any fcgi process manager out there?
2
mod_perl has been preferable to CGI for over a decade.slim
Windows doesn't have a fork call, so real preforked is impossible on Windows.ikegami
mod_perl may save the cost of creating the perl process, but might not save the cost of re-compiling my codes again. And I am expecting the code to grow.HelloSam
There might not be fork(), but definitely have some alternatives that does similar thing. I agree that might not be easy to code in Perl though.HelloSam
On the other hand, I wonder why no one made a pure perl PSGI Server with threads instead of fork? I might go ahead and write one, but is there any pitfall I might have not foreseen?HelloSam

2 Answers

2
votes

you could use Mojolicious + mod_psgi + apache.

There are pre-compiled binaries here, although for Apache 2.2:

http://strawberryperl.com/package/kmx/mod_psgi/

-- Mike

1
votes

You could use the threaded Plack server Thrall.