Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Help: Mojolicious+FastCGI+IIS

by Corion (Patriarch)
on Feb 10, 2017 at 08:08 UTC ( [id://1181639]=note: print w/replies, xml ) Need Help??


in reply to Help: Mojolicious+FastCGI+IIS

I'm not sure how FastCGI actually works, but I could imagine that IIS launches the Mojolicious FastCGI process only on the first page request.

To check this theory, the performance of 4-5 seconds should be same-ish as the performance of your script running as CGI under IIS. Maybe you can also see in the process monitor whether your Perl script gets launched immediately or only after the page is first requested.

If the startup is the issue, I would consider adding a warmup script that fetches one or more pages via Mojo::UserAgent or whatever to generate a status message and to prime the process and eventual database connections etc.

Replies are listed 'Best First'.
Re^2: Help: Mojolicious+FastCGI+IIS
by sduggal (Novice) on Feb 13, 2017 at 05:19 UTC

    Thanks for your reply.

    I checked that Perl script gets initiated immediately with each new request. But for the first time when start_app is called on my Mojolicious application it is taking 4-5 seconds. I have no idea as to what is taking so long when going through IIS.

    Alternately, I have started to explore, http://www.helicontech.com/zoo/, for IIS based deployment. Will let you know if I come up with anything positive.

      Hi

      Mojolicious application it is taking 4-5 seconds. I have no idea as to what is taking so long when going through IIS.

      This sounds very normal, look

      $ mojo generate lite_app [exist] /foo/foo [write] /foo/foo/myapp.pl [chmod] /foo/foo/myapp.pl 744 $ perl -le"print ~~localtime; system $^X, q[myapp.pl], q[daemon] " Sun Feb 12 21:45:01 2017 [Sun Feb 12 21:45:04 2017] [info] Listening at "http://*:3000" Server available at http://127.0.0.1:3000 Terminating on signal SIGINT(2)

      Sure my machine is old my disk is slow, but 5 seconds for startup sounds rather normal

      Just adding DBI/DBD::SQLite/DBIx::Class/Template/Data::Dumper/Moose bumps it to 6 seconds easy

      $ perl -le"print ~~localtime; system $^X, q[myapp.pl], q[daemon] " Sun Feb 12 21:51:39 2017 [Sun Feb 12 21:51:45 2017] [info] Listening at "http://*:3000" Server available at http://127.0.0.1:3000 Terminating on signal SIGINT(2)

      It gets a little faster if I do it in a loop but only a little

      $ perl -le"for(1..10){ print ~~localtime; system $^X, q[myapp.pl], q[d +aemon]; } " Sun Feb 12 21:53:07 2017 [Sun Feb 12 21:53:11 2017] [info] Listening at "http://*:3000" Server available at http://127.0.0.1:3000 Sun Feb 12 21:53:17 2017 [Sun Feb 12 21:53:21 2017] [info] Listening at "http://*:3000" Server available at http://127.0.0.1:3000 Sun Feb 12 21:53:23 2017 [Sun Feb 12 21:53:27 2017] [info] Listening at "http://*:3000" Server available at http://127.0.0.1:3000 Sun Feb 12 21:53:29 2017 [Sun Feb 12 21:53:33 2017] [info] Listening at "http://*:3000" Server available at http://127.0.0.1:3000

      Its all very normal

      Yes you could have some settings in IIS or ... that might contribute some speed penalty ...

      The only option to not have slowdown, is to not have apps available, until they are preloaded -- the user waits either way

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2024-04-26 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found