Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Catalyst (app_)server.pl hangs a lot

by miguelele (Beadle)
on Nov 03, 2011 at 18:07 UTC ( [id://935733]=perlquestion: print w/replies, xml ) Need Help??

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

Hi, dear monks, i am very frightened:

I use the (app)_server.pl script listening in port 3000 to test my Catalyst app. I get no execution errors, but from time to time (a lot of times) it hangs without previous alert or error message in the terminal.

The connection to the server is alive, so I command-dot in the terminal and the script closes, and I can restart it.

Is the the included server solid enough?, or is just a quick testing thing?

My fear is that something is wrong with my app, but I cant see it!!!!

Replies are listed 'Best First'.
Re: Catalyst (app_)server.pl hangs a lot
by Your Mother (Archbishop) on Nov 03, 2011 at 19:14 UTC

    The dev server is generally just for testing but it’s also pretty robust and some devs have deployed it to production.

    The only times I’ve seen the sort of thing you describe is when doing wonky fork/self-referential code. A potential help would be to add a -k to the command line in case things are just blocking somewhere. You could also start with perl -MCarp::Always script/myapp_server.pl ....

    Barring success with that, and not being a perl -d kinda dev unless backed into a corner, I tend to remove new code to get back to a functioning version and then progressively return things till I discover the fail point. I have hardly had to do this since becoming more serious about writing tests for individual pieces before trying to mix them. Skipping test writing is a false economy and there is a wealth of test appliances for Perl and Catalyst.

      Wowo, I have returned to my computer and the last page I tested has finally rendered!!. Las action took 968.4581s. So the server script does not hangs. It is heavily delayed!!.

      I wonder how I can monitor the action even deeper

        I wonder how I can monitor the action even deeper

        Finding such a huge delay should be easy, just look for one of sleep, DBI...execute, or for(1..1_000_000){ DoSomethingExpensive(); }

        This being a Catalyst app, look in your model

      I tried to run the server with keepalive... and it works fine!! With all the queries and models running.

      I do not understand. Is this the "correct" way?

      While developing I am the only user, and I have even stripped the app down to just one query without success if I turn off keepalive again.

      Finally: the server hangs after five minutes of inactivity when the database is in a remote host.

      A) Recreating the database in the same server that is running Catalyst -> OK

      B) Installing Catalyst in the server server that is running the database -> OK

      I can live with that by now because "B" will be the production environment. But surely I will come back, because using a remote database seems to be a good option to consider.

      Thank you for your interest

Log In?
Username:
Password:

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

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

    No recent polls found