[Catalyst] Application stallling problem

kakimoto at tpg.com.au kakimoto at tpg.com.au
Sun Apr 12 02:25:12 GMT 2009


Hello, Kieren,

Good morning. Thank you for your help. I have the templates below. 
My apologies if it is too long but I really need some pointers here.

The main file, "home/kakimoto/projects/myApp/root/src/index.tt2" decides
if we show the general static content if the user is not logged in. If
the user is logged in, we display the menu.

My problem happens site wide be it the user is logged in or not.
 For example, clicking on either of the static page links, "Test Drive",
"About us" and so forth (within 10 seconds) causes the myapp_server.pl
screen in my terminal to not do anything (ie it freezes up).


is it true that myapp_server.pl is not good enough to handle requests
that are established within 10 seconds or less? Or even double clicks?

Thank you for your help. Any comment would be appreaciated.





1) /home/kakimoto/projects/myApp/root/src/index.tt2
=================================================

[% IF Catalyst.user_exists %]
    [% PROCESS "menu.tt2" %]
[% ELSE %]
<!--
    User has not logged in. 
    -->

    <!--
   this section displays the general site page  (ie the general contents)
    -->
[% END %]


2) /home/kakimoto/projects/myApp/root/src/sidebar.tt2
============================================================

        <!-- Sidebar code [start] -->
            <a href="/menu" class="sidebar">
                Main 
            </a>
            <br/>
            <a href="/users/profile" class="sidebar">
                Profile
            </a>
            <br/>
            <a href="/users/subscriptions" class="sidebar">
                Subscriptions
            </a>
            <br/>
            <a href="/listings/search" class="sidebar">
                Search Listings
            </a>
            <br/>
            <a href="/users/reporting" class="sidebar">
                Reporting
            </a>
            <br/>
            <a href="/users/export_logs" class="sidebar">
                Export logs
            </a>
        <!-- Sidebar code [end] -->



3) /home/kakimoto/projects/myApp/root/src/agents/create.tt2
============================================================

[%  USE Dumper(Indent=1) -%]

[% META title = 'Sign up' %]
                        <!-- 
                            Load agent form [start]
                        -->

                            <h1> [% page_title %] </h1>

                            [% IF signup_success and message %]
                                <div id="message">
                                    [% message %]
                                </div>
                            [% ELSE %] 
                                [%
                                #  target_action =
Catalyst.uri_for('/sign_up');
                                    PROCESS 'agents/form.tt2';
                                %] 
                            [% END %]
                        <!--    
                            Load agent form [end]
                        -->

4) /home/kakimoto/projects/myApp/root/src/agents/form.tt2
============================================================

[%  USE Dumper(Indent=1) -%]


[% META title = 'Sign up/agent profile' %]

[% element_requires_validation = '<font
id="requires_validation">*</font>' %]

[% IF message %]
                        <div id="message">
                            [% message %]
                        </div>

[% END %]
<pre>
[% #Dumper.dump(errors) %] 
</prE>

[% IF errors %]
                        <br/>
                        <div id="error">
                            <ul>
                            [% FOREACH error IN errors %]
                                <li>[% error %]</li>
                            [% END %]
                            </ul>
                        </div>
                        <hr/>
[% END %]
                            <form method="post" action="[% target_action
%]" id="agent_profile_form" name="agent_profile_form">
                                <table border="0" cellspacing="3">
                                    [% IF sign_up %]
                                    <tr>
                                        <td valign="top">
                                            <h2 >Login Credentials</h2>
                                        [% PROCESS
"agents/login_credentials.tt2" %]
                                        </td>
                                    </tr>
                                    [% END %]

                                    <tr>
                                        <td valign="top">
                                                        <h2>Company</h2>
                                            [% PROCESS
"agents/company_details.tt2" %]
                                        </td>
                                    </tr>

                                    <tr>
                                        <td valign="top">
                                            <table>
                                                <tr>
                                                    <td>
                                                        <h2>Address</h2>
                                                        [%
                                                            billing = 0;
                                                            PROCESS
"agents/address.tt2";
                                                        %]

                                                        <h2>Main
Contact</h2>
                                                        [% PROCESS
'agents/main_contact.tt2' %]
                                                    </td>
                                                    <td valign="top">
                                                        <!-- Billing
Address [start] -->
                                                        <h2 >Billing
Address</h2>
                                                        [% billing = 1 %]
                                                        [% PROCESS
'agents/address.tt2' %]
                                                        <!-- Billing
Address [end] -->
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td
                                           valign="top"
                                        [% IF logos %]
                                            width="*"
                                        [% ELSE %]
                                            width="0"
                                        [% END %]
                                        >
                                            [% PROCESS
"agents/manage_logo.tt2" %]
                                        </td>
                                    </tr>

                                    <!-- TODO: Check on this to make
sure it works -->
                                    [% IF sign_up %]
                                    <tr>
                                        <td
                                            colspan="2"
                                            align="left"
                                        >
                                            [% PROCESS
'agents/terms_and_conditions.tt2' %]
                                        </td>
                                    </td>
                                    [% END %]

                                    <tr>
                                        <td
                                            colspan="2"
                                            align="center"
                                        >
                                            <input type="submit"
name="submit" value="submit"
                                            [% IF sign_up %]
                                                onClick="checkAccepted()"
                                            [% END %]
                                            />
                                            <input type="reset"
name="reset" value="reset" />
                                        </td>
                                    </tr>
                                </table>
                            </form>

5) /home/kakimoto/projects/myApp/root/src/menu.tt2
============================================================


[% META title = 'Menu' %]

[% IF c.check_user_roles('admin') %]
    Admin user logged in.
[% ELSE %]

        <div id="error">
            <ul>
            [% FOREACH error IN errors %]
                <li>[% error %]</li>
            [% END %]
            </ul>
        </div>

        <!-- Main table [start] -->
        [% # PROCESS "listings/search.tt2" %]
            <!-- TODO : Define listings/search.tt2 -->

            <!-- Add new listing [start] -->
        [% #PROCESS "listings/add.tt2" %]
            <!-- Add new listing [end] -->

        <!-- Main table [end] -->
        [% #PROCESS "listings/show_first_10.tt2" %]
            <!-- TODO : Define template above -->

        <table border="0">
            <tr>
                <td id="sidebar">
                    <a href="[% Catalyst.uri_for('/listings/create') %]">
                        <img src="images/menu/c.gif" alt="Create" />
                    </a>
                </td>
                <td>
                    <a href="[% Catalyst.uri_for('/listings/list') %]">
                        <img src="images/menu/r.gif" alt="Inventory
listing" />
                    </a>
                </td>
            </tr>
            <tr>
                <td id="sidebar">
                    <a href="[% Catalyst.uri_for('/listings/update') %]">
                        <img src="images/menu/u.gif" alt="Update" />
                    </a>
                </td>
                <td>
                    <a href="[% Catalyst.uri_for('/listings/delete') %]">
                        <img src="images/menu/d.gif" alt="Delete" />
                    </a>
                </td>
            </tr>
        </table>
[% END %]


6) /home/kakimoto/projects/myApp/root/lib/site/header
=====================================================


                    <!-- BEGIN site/header -->
                            <h1>
                                <a href="/"
title="LoadPropertyNow.com.au"><span>LoadPropertyNow.com.au</span></a>
                                <em>Upload properties the quick &amp;
easy way!</em>
                            </h1>

                            <div id="nav">

                                <!-- topMenu [start] -->
                                <ul id="topMenu">

                    [% IF not Catalyst.user_exists and not
Catalyst.namespace.match('^login$') %]
                                    <li><a href="[%
Catalyst.uri_for('/free_trial') %]" class="freeTrial" title="Try us out
for free!"><span>Try us out for free! Free trial for 30 days or first 50
uploads</span></a></li>
                                    <li><a href="[%
Catalyst.uri_for('/login') %]" class="login"
title="Login"><span>Login</span></a></li>
                                    <li><a href="[%
Catalyst.uri_for('/sign_up') %]" class="signUp" title="Sign Up"
><span>Sign Up</span></a></li>
                    [% ELSE %]
                                    <li><a href="[%
Catalyst.uri_for('/logout') %]" class="login"
title="Logout"><span>Logout</span></a></li>
                    [% END %]
                                </ul>

                                <!-- topMenu [end] -->

                                <!-- menu [start] -->
                                    <div id="menu">
                                        <ul>

                        [% IF not Catalyst.user_exists %]
                                            <li><a href="[%
#Catalyst.uri_for('/sign_up') %]" title="Sign Up"
id="navHome"><span>Sign Up</span></a>|</li>
                        [% ELSE %]
                                            <li><a href="[%
#Catalyst.uri_for('/menu') %]" title="Home"
id="navHome"><span>Home</span></a>|</li>
                        [% END %]
                                            <li><a href="[%
Catalyst.uri_for('/free_trial') %]" title="Test Drive"
id="navFree"><span>Test Drive</span></a>|</li>
                                            <li><a href="[%
Catalyst.uri_for('/about_us') %]" title="About Us"
id="navAbout"><span>About Us</span></a>|</li>
                                            <li><a href="[%
Catalyst.uri_for('/services') %]"  title="Insurance Plans"
id="navServices"><span>Insurance Plans</span></a>|</li>
                                            <li><a href="[%
Catalyst.uri_for('/subscriptions') %]" title="Subscriptions"
id="navSubscriptions"><span>Subscriptions</span></a>|</li>
                                            <li><a href="[%
Catalyst.uri_for('/contact_us') %]" title="Contact Us"
id="navContact"><span>Contact Us</span></a></li>
                                        </ul>
                                    </div>
                            <!-- menu [end] -->
                                </div>
                        <!-- end nav -->

                    <!-- END site/header -->


7) /home/kakimoto/projects/myApp/root/lib/site/footer
============================================================
<!-- BEGIN site/footer -->
    <center>
		<ul>
			<li>&copy; 2009 lgInsurance pty ltd. All rights reserved |</li>
			<li><a href="termsOfUse.html" title="Terms of Use">Terms of Use</a>
|</li>
			<li><a href="privacyPolicy.html" title="Privacy Policy">Privacy
Policy</a></li>
		</ul>
		<ul>

        [% IF not Catalyst.user_exists %]
                            <li><a href="[% #
Catalyst.uri_for('/sign_up') %]" title="Sign Up" id="Home"><span>Sign
Up</span></a>|</li>
        [% ELSE %]
                            <li><a href="[% # Catalyst.uri_for('/menu')
%]" title="Home" id="navHome"><span>Home</span></a>|</li>
        [% END %]
			<li><a href="test_drive.html" title="Test Drive" >Test Drive</a> |</li>
			<li><a href="aboutUs.html" title="About Us">About Us</a> |</li>
			<li><a href="ourInsurancePlans.html"  title="Insurance
Plans">Insurance Plans</a> |</li>
			<li><a href="subscriptions.html"
title="Subscriptions">Subscriptions</a> |</li>
			<li><a href="contactUs.html" title="Contact Us">Contact Us</a></li>
		</ul>
    </center>
<!-- END site/footer -->






8) /home/kakimoto/projects/myApp/root/lib/site/skeleton_wrapper
================================================================


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title>[% template.title %]</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="description" content="Upload your properties the quick and
easy way!" />
	 	<meta name="keywords" content="insurance, now, easy, quick" />
	    <style type="text/css">
	      [% PROCESS ttsite.css %]
	    </style>
        <script language="JavaScript" type="text/javascript" src="[%
Catalyst.uri_for('/js/general.js') %]"></script>

	</head>

	<!-- Skeleton -->
	
	<body id="home">
        <!-- container [start]  -->					
		<div id="container">
			<div id="header">
	            [% PROCESS site/header %]
		    </div>

            <!-- body start -->

            <div id="body">

                [% IF Catalyst.user_exists %]

                <!-- body inner [start] -->
                <div id="body-inner">

                    <!-- Sidebar [start] -->
                    <div id="sidebar">
                           [% PROCESS sidebar.tt2 %]
                    </div>
                    <!-- Sidebar [end] -->

                [% END %]

                    <!-- Content [start] -->
                    <div id="content">
                        <span class="message">[% status_msg %]</span>
                        <span class="error">[% error_msg %]</span>
                                        [% content %]
                     </div>
                    <!-- Content [end] -->

                [% IF Catalyst.user_exists %]

                </div>
                <!-- body inner [end] -->

                [% END %]

            </div>
            <!-- body [end] -->

            <!-- footer [start]  -->					
	        <div id="footer">
	           [% PROCESS site/footer %]
	        </div>
            <!-- footer [end]  -->					

		</div>
        <!-- container [end]  -->					
	</body>
</html>







Quoting Kieren Diment <diment at gmail.com>:

> Show us your template.
> 
> 
> On 10/04/2009, at 11:22 AM, kakimoto at tpg.com.au wrote:
> 
> > hello , everyone :)
> >
> >  good morning. Happy eAster!
> >
> > any more ideas?
> >
> > thank you
> >
> >
> > Quoting kakimoto at tpg.com.au:
> >
> >> Hello, Kieren,
> >>
> >> thank you for your feedback.
> >>
> >> 1) CGI Template Toolkit plugin - not using it
> >>
> >> I do not think that I am using the CGI Template Toolkit plugin.
> >> I have only been using Template Toolkit as prescribed in the
> >> Catalyst
> >> tutorials.
> >>
> >> in my file, /myAppl/lib/myApp/View/HTML.pm, I have the line,
> >>                    "TEMPLATE_EXTENSION => '.tt2'"
> >>
> >>
> >> May I ask on what sort of CGI Template Toolkit plugin are you
> >> referring
> >> to specifically?
> >>
> >>
> >> 2) Currently having my own ubuntu virtual server to deploy my
> >> application.
> >>
> >>
> >> - Any good recommendations?
> >>  - Would using myapp_server.pl cut for an application which has
> say
> >> 50
> >> users logged in at the same time?
> >>
> >> Please pardon my lack of knowledge for I am only a developer and
> >> have
> >> little experience in the systems administation and tuning sector.
> >>
> >> Thank you, all.
> >>
> >>
> >>
> >>
> >>
> >> Quoting Kieren Diment <kieren at diment.org>:
> >>
> >>> Are you using the CGI Template Toolkit plugin thingy?  Don't. 
> This
> >>
> >>>
> >>> will cause your problem as described.  If not you've given us
> >>> insufficient information
> >>>
> >>> Fastcgi is easier to setup on shared hosting, and has some
> >>> advantages.  CATALYST_ENGINE=HTTP::Prefork
> script/myapp_server.pl
> >> is
> >>>
> >>> pretty simple and can be reverse proxied pretty easily.  Install
> >>> C::E::HTTP::Prefork from CPAN and give it a shot...
> >>>
> >>> On 09/04/2009, at 11:14 AM, kakimoto at tpg.com.au wrote:
> >>>
> >>>>
> >>>> hello
> >>>>
> >>>> good morning. The page which I access at first doesn't require
> >> any
> >>>> database request. It's just pretty much a page that's generated
> >> by
> >>>> template toolkit and that's it.
> >>>>
> >>>> On the terminal which I am running the myapp_server.pl script,
> it
> >>
> >>>
> >>>> seems
> >>>> to stall and not do anything when i put in another url path
> into
> >>> the
> >>>> webbrowser and hit enter.
> >>>>
> >>>> Example:
> >>>>
> >>>>
> >>>> 1) URL, www.lginsurance.com/signup is accessed
> >>>> 2) URL, www.lginsurance.com/signup is accessed again by
> >>> highlighting
> >>>> the
> >>>> url on the web browser and hitting "enter"
> >>>> --> notice that on the terminal screen, the last line is "
> HTML-
> >>
> >>>>> process
> >>>> " along with the time taken and stalls there
> >>>>
> >>>> Is this a problem you guys have?
> >>>>
> >>>>
> >>>>
> >>>> for production deployment, do many of you run myapp_server.pl
> or
> >>>> myapp_fastcgi.pl?
> >>>>
> >>>> Any comments please?
> >>>>
> >>>>
> >>>> thank you
> >>>>
> >>>>
> >>>> K. akimoto
> >>>>
> >>>>
> >>>>
> >>
> >> _______________________________________________
> >> List: Catalyst at lists.scsys.co.uk
> >> Listinfo:
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> >> Searchable archive:
> >> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> >> Dev site: http://dev.catalyst.perl.org/
> >>
> >>
> >>
> >
> >
> >
> >
> > _______________________________________________
> > List: Catalyst at lists.scsys.co.uk
> > Listinfo:
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> > Dev site: http://dev.catalyst.perl.org/
> 
> 
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
> 
> 
> 






More information about the Catalyst mailing list