Re: [Catalyst] I'm loosing the plot here? - Controller behaviour that makes no sense

2012-10-30 Thread Lars Balker
On Tue, Oct 30, 2012 at 6:39 PM, Craig Chant
wrote:

>  Please advise why the following URL
>
>
>
> ‘mydomain:port/login’
>
>
>
> Produces “Matched Members::Controller::Login in Login.”
>
> sub index :Path :Args(0) {
>
> sub loginPage :Path :Args(0) {
>

Because having two empty :Path is not well defined - the latter overwrites
the former (in this case?).

Try with :Path('login') or :Local on the second one (and see
Catalyst::Manual::Intro)
-- 
Lars Balker  Consult::Perl
___
List: Catalyst@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/


Re: [Catalyst] Use of uninitialized value in delete

2012-10-28 Thread Lars Balker
On Fri, Oct 19, 2012 at 7:37 PM, Bill Moseley  wrote:
> In server logs I'm seeing this warnings:
>
> Use of uninitialized value in delete
>
>
> with a line number pointing to this line:
>
> delete $c->stash->{foo};

Is that the literal error-message and code?

% perl -e 'use strict; use warnings; my %foo; my $bar; delete $foo{$bar}'
Use of uninitialized value $bar in delete at -e line 1.
% perl -e 'use strict; use warnings; my %foo; delete $foo{undef()}'
Use of uninitialized value in delete at -e line 1.
% perl -e 'use strict; use warnings; my %foo; sub foo { undef } delete
$foo{foo()}'
Use of uninitialized value in delete at -e line 1.

(perl 5.16.0)

As for stash, it's just a Moose-attribute returning a hashref.
-- 
Lars Balker  Consult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Alternatives to Catalyst ?

2010-04-23 Thread Lars Balker Rasmussen
On Fri, Apr 23, 2010 at 5:51 PM, Kee Hinckley  wrote:
> No argument there. I dearly wish the effort that had gone into Perl6 had gone 
> into [blah blah].

You're subscribing to the fallacy that volunteer time is a resource
you can allocate as you see fit. That's not how it works.

chromatic has written at length about this subject, so I'm not going
to delve further into it.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Building complex layouts

2009-12-30 Thread Lars Balker Rasmussen
On Wed, Dec 30, 2009 at 2:49 PM, Peter Corlett  wrote:
> On 30 Dec 2009, at 10:11, Lars Balker Rasmussen wrote:
> [...]
>>
>> Definitely split sidebars etc. into separate actions.  Then have nginx,
>> varnish or equiv. combine them with SSI/ESI.  This also helps caching across
>> pages.
>
> Does Catalyst's built-in web server support either technology yet? If not,
> you're going to find it harder to debug your site if you use them.

Meh, it'd be a trivial plugin to write, if nobody hasn't already.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Building complex layouts

2009-12-30 Thread Lars Balker Rasmussen
On Wed, Dec 30, 2009 at 8:10 AM, Pavel O. Karoukin  wrote:
> Hello,
> I wonder what is a best practice to build complex layouts (sidebars, forms
> in 'em, list of latest news in sidebar, etc)?
> Right now I see it in chaining several actions and each one adding content
> into stash. Is there any other dry approaches?
> May be there is a way to separate each element of layout into it's own
> action + template and call this from "base" template?

Definitely split sidebars etc. into separate actions.  Then have
nginx, varnish or equiv. combine them with SSI/ESI.  This also helps
caching across pages.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Why load modules two times?

2009-08-04 Thread Lars Balker Rasmussen
On Tue, Aug 4, 2009 at 11:20 AM, Malloy wrote:
> But Apache2 has not ServerType option, how to set standalone?

Standalone server = perl script/myapp_server.pl

Check http://dev.catalystframework.org/wiki/deployment for
alternatives to mod_perl.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Why load modules two times?

2009-08-04 Thread Lars Balker Rasmussen
On Tue, Aug 4, 2009 at 10:07 AM, Malloy wrote:
> I find the modules  were loaded two times?
> [info] myapp powered by Catalyst 5.7014
> [Tue Aug 04 01:05:18 2009] [notice] Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1
> mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations

That's how mod_perl rolls.  I think you'll find that the standalone
server doesn't load the modules twice.

http://perl.apache.org/docs/2.0/user/handlers/server.html

Best way to avoid this: don't use mod_perl.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] so many 'sleep' process in mysql.

2009-04-24 Thread Lars Balker Rasmussen
On Sat, Apr 25, 2009 at 6:20 AM, Malloy  wrote:
> I use 'Catalyst::Model::DBIC::Schema'.
>
> But i find so many 'sleep' process in mysql.
>
> Is it normal? If not, why and how to avoid it?

It's perfectly normal for a process to sleep when it doesn't have anything
to do.  It would be a problem if it didn't!
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] [PATCH] Catalyst::DispatchType::Chained (5.7101, 5.80001)

2009-04-20 Thread Lars Balker Rasmussen
On Mon, Apr 20, 2009 at 10:19 PM, Oleg Kostyuk  wrote:
> 2009/4/20 Lars Balker Rasmussen :
>> On Mon, Apr 20, 2009 at 9:58 PM, Oleg Kostyuk  wrote:
>>
>> May I suggest:
>>
>>           my $t1 = Text::SimpleTable->new( 5, 10 );
>>           my $t2 = Text::SimpleTable->new( [ 5, 'Foo' ], [ 10, 'Bar' ] );
>>           my $t3 = Text::SimpleTable::AutoWidth->new( {
>>               max_width => 40,
>>               captions    => [qw/Foo Bar Baz/],
>>           } );
>>
>> Backwards compatible, easy to test for.
>
> Not sure that understood what you mean here.
> Please, explain little bit more.

Bah, cut'n'paste'n'user error:

>>   my $t3 = Text::SimpleTable->new( {
>>   max_width => 40,
>>   captions=> [qw/Foo Bar Baz/],
>>   } );

I meant, it's easy to extend the Text::SimpleTable API without breaking
backwards compatibility.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] [PATCH] Catalyst::DispatchType::Chained (5.7101, 5.80001)

2009-04-20 Thread Lars Balker Rasmussen
On Mon, Apr 20, 2009 at 9:58 PM, Oleg Kostyuk  wrote:
>> I don't think that was what Matt asked for. Anyways,
>> 1) Why can't your changes be a patch to Text::SimpleTable?
> I think that new module will be better in this case, because someone
> else can be needed unchanged Text::SimpleTable.

May I suggest:

   my $t1 = Text::SimpleTable->new( 5, 10 );
   my $t2 = Text::SimpleTable->new( [ 5, 'Foo' ], [ 10, 'Bar' ] );
   my $t3 = Text::SimpleTable::AutoWidth->new( {
   max_width => 40,
   captions=> [qw/Foo Bar Baz/],
       } );

Backwards compatible, easy to test for.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] stripping path parts and then redispatch?

2009-02-22 Thread Lars Balker Rasmussen
On Sun, Feb 22, 2009 at 11:28 PM, Larry Leszczynski
 wrote:
> I have an existing site, and want to add the page language to the URLs
> so that caching will work correctly, e.g. "/foo/bar" would now look like
> "/en/foo/bar" or "/fr/foo/bar".  (The language is user-selected, not
> from browser prefs, so setting the "Vary: Accept-Language" response
> header won't help.)

Apart from the missing true return value from auto, this works:

http://lists.scsys.co.uk/pipermail/catalyst/2009-February/021072.html
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] The stash and go()

2009-02-16 Thread Lars Balker Rasmussen
On Mon, Feb 16, 2009 at 9:18 AM, Alexander Tamm  wrote:
> I'm experiencing a little bit of weirdness with the stash when using go().
> I'd like to make sure I'm not making false assumptions. Is the called action
> supposed to see the same context and/or stash as the the calling action?

Yes.  Your problem is that auto() needs a return value to say whether
to go forward with an action or not, so just add "return 1;" at the
end of auto(), and all will be fine.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Catalyst::Plugin::Session::Store::CHI

2009-02-09 Thread Lars Balker Rasmussen
On Tue, Feb 10, 2009 at 3:05 AM, Ashley  wrote:
> Actually, replying to myself already; and top posting to boot.
>
> Alternatively: would it be a good idea to make the ::Store automatically
> discover the cache if it's there already? I might try a patch for that but I
> doubt it's as easy as a new store. I'd like it better though.

There's always my slightly flawed Catalyst::Plugin::Session::Store::Cache?

Flawed, since it doesn't update session-expiry on read.  I expect to
solve this for memcached when I get some tuits, maybe CHI supports
something similar to memcached's cas?
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] now() in insert

2009-02-06 Thread Lars Balker Rasmussen
On Fri, Feb 6, 2009 at 5:40 PM, Devin Austin  wrote:
> On Fri, Feb 6, 2009 at 4:45 AM, Christian Lackas  wrote:
>>dt => \'now()'
>
> DateTime also has a ->now method.

Careful now, they may not be identical:

% perl -MDateTime -E 'say DateTime->now'
2009-02-06T16:47:48

postgresql=> select now();
  now
---
 2009-02-06 17:48:00.240287+01

No timezone in DateTime unless you explicitly ask for it.

___
List: Catalyst@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/


Re: [Catalyst] Detach won't detach?

2009-01-26 Thread Lars Balker Rasmussen
On Mon, Jan 26, 2009 at 07:56:53PM +0100, koniczynek wrote:
> sub auto :Private {
>   my ( $self, $c ) = @_;
> 
>   $c->log->debug('action start');
>   if ( ! user_logged_in) {
> $c->redirect( $c->req->base );
>   } else {
> $c->detach( $c->action->{name} );
>   } 
>   $c->log->debug('action end');
> }

auto relies on a return value to tell the dispatcher whether to continue or not.
Doing the normal action is the default, detaching to it is redundant, hence:

sub auto :Private {
  my ( $self, $c ) = @_;

  if ( ! user_logged_in) {
$c->redirect( $c->req->base );
return 0;
  }

  return 1;
}

This example is pretty much exactly the same as in the main Catalyst pod.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] installing catalyst on mac os

2008-12-25 Thread Lars Balker Rasmussen
On Wed, Dec 24, 2008 at 06:51:08AM -0500, Filippo A. Salustri wrote:
> Just FYI, I'm a catalyst beginner, but I wrote my first perl script in 
> 1986.  So you can "use big words" and I'll very likely get it.

Wow.  Larry released 1.000 in december 1987, so you must have worked with
him at NASA.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Any alternatives to generating thumbnails aside from Catalyst::Plugin::Upload::Image::Magick::Thumbnail

2008-12-23 Thread Lars Balker Rasmussen
On Tue, Dec 23, 2008 at 07:49:50PM +1100, kakim...@tpg.com.au wrote:
>   Yes i have heard of Imager. Anyone else used it extensively ?

Extremely heavily for all image-related tasks for years.

And remember the 1st rule of thumbnails:  cache.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] OT: Use the CPAN, Luke? (was: Catalyst install failure due to Mouse.pm on Debian Etch)

2008-11-28 Thread Lars Balker Rasmussen
On Thu, Nov 27, 2008 at 03:55:54AM +0100, Aristotle Pagaltzis wrote:
> Case in point, Mouse is essentially Moose Light. Since Catalyst
> itself is becoming Moose-based, is there *any* reason to use
> Mouse instead? I suppose if it automatically stubs itself into
> a Moose loader where Moose is available, that would be not *too*
> bad, but it???s still a pointlessly added dependency.

While Data::Visitor depends on Mouse, it actually uses Squirrel (which
is in the Mouse dist), which will fall back to the Moose already loaded
by Catalyst.  I assume most Mouse-users are smart enough to do this.

And Data::Visitor isn't just for Catalyst-use, so our problem isn't theirs.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Catalyst and Perl on Google App Engine

2008-06-29 Thread Lars Balker Rasmussen
On Sun, Jun 29, 2008 at 01:47:02PM +0400, Oleg Pronin wrote:
> everything in other languages sucks compared to catalyst & DBIC.

What's your point?  I asume Stephen is talking about running Cat+DBIC on
app-engine (albeit a slightly neutered DBIC, but DBIC nevertheless).

> what is the goal to adapt more powerful system to less powerful?

So, where is your hypothetical system that is more powerful than
app-engine?  Have you ever tried scaling an app beyond a single box?
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Distributed session storage problems/questions

2008-02-20 Thread Lars Balker Rasmussen
On Wed, Feb 20, 2008 at 01:08:08PM -0500, Matt Pitts wrote:
> 1. What is the acceptable way to use memcached for session storage? Is
> it using C::P::Session::Store::Memcached or is it
> C::P::Session::Store::Cache in conjunction with C::P::Cache::Memcached?

Well, either, really, they do much the same thing.  I wrote CPS::Store::Cache
to avoid the silliness of having two connections to memcached per backend, 
using two different Cache:: modules.

So, if you have the cache working, it should be very easy to set up 
sessions.

> 2. Is memcached even a "good" way to store sessions? DBIC seems to be a
> popular option, but I figured memcached's considerable speed would make
> it the preferred choice.

How important are sessions to you?  If dropping a session once in a bluemoon
is acceptable, memcached is perfectly fine.  In fact, the memcached process
is about as stable as the rest of the machine it runs on, which should 
hopefully be very stable. 

> 3. When using memcached to store sessions, is it OK to have more than
> one backend?

YES!  Definitely.  Silly not to.

> At first I didn't think anything about adding another
> backend, but then I thought that the 2 memcached instances wouldn't have
> the same set of data which would cause problems with sessions, unless of
> course the session writes get distributed to all the backends. I've
> looked into the source of C::P::Session::Store::Memcached,
> Cache::Memcached::Managed and Cache::Memcached and cannot tell if the
> writes are spread across all backends. Does anyone know the answer to
> this?

As long as you specify the servers in the same order on all memcached-
clients, they will hash the keys the exact same way, and a set() on
server B will cause a get() on server A to just work(tm).

> 4. Is it just crazy to run a load balanced setup without some type of
> sticky session setup on the proxy? If so, any implementations of this
> using Apache 2.x mod_proxy(_balancer) as the frontend would be greatly
> appreciated.

Sticky sessions are annoying.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Status of Reaction - ready for new projects?

2008-01-01 Thread Lars Balker Rasmussen
On Tue, Jan 01, 2008 at 03:00:57PM -0800, John Napiorkowski wrote:
> I remember reading somewhere about a Winter of Code
> perl project to use Reaction but I can't seem to find
> it, so I might have heard incorrectly.

You haven't.

http://www.shadowcat.co.uk/resources/woc_todo/
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@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/


Re: [Catalyst] Sessions and memcached storage

2007-12-05 Thread Lars Balker Rasmussen
On Tue, Dec 04, 2007 at 05:06:34PM -0800, J. G. Konrad wrote:
> I've been having problems with session storage using memcached with more
> than one memcached instance.  The sessions are expiring before they are
> supposed to.  If there is only  one memcached instance everything works like
> it is supposed to.
> 
> Has anyone else had this problem?
> 
> One of my colleagues did some stress testing and he came with some evidence
> that the internal cache ( buck2sock ) is incorrectly mapping to sockets
> under stress. That is to say the value out of the buck2sock cache is
> different than the value from sock_to_host() which should not be the case.
> That could help explain the problems with multiple memcached instances but
> our lost session also happen when the system is not stressed.

Are you using memcached for normal cache as well?  Wouldn't you see the same 
problem 
here?  If not, try Catalyst::Plugin::Session::Store::Cache (plug, plug) :-)
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] difficulty in assigning an array to a stash

2007-11-11 Thread Lars Balker Rasmussen
On Sun, Nov 11, 2007 at 09:58:04PM +0530, jagdish eashwar wrote:
> Hi,
> I am trying to retrieve into an array a list of values from a column
> in a table using dbic and have it displayed in a drop down list in a
> tt2 template. I am able to do the retrieval part, but the tt2 template
> is displaying only the last value from the array. With further
> experimentation, I found that if I explicitly assign an array to a
> stash ( like '$c->stash->{myoptions} = [qw/1 2 3 4 5 6 7/];' ), I am
> getting all the 7 values in the tt2 template drop down. But if I
> define the array first and then assign it to the stash, ( like 'my
> @options = qw/1 2 3 4 5 6 7/; $c->stash->{myoptions} = @options;) I am
> getting only the last value in the tt2 template. How can I get all the
> values in the array into the stash without having to do it explicitly?

 $c->stash->{myoptions} = [EMAIL PROTECTED];

 perldoc perlreftut
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DProf

2007-11-02 Thread Lars Balker Rasmussen
On Fri, Nov 02, 2007 at 08:59:48PM +0200, Octavian Rasnita wrote:
> I have tried to see which of the modules of my Catalyst application take so 
> much time, because at certain moments the processor is occupied 99.9%, then 
> goes down to 12%, then again at 99.9% and so on.
> 
> I've used the module Apache::DProf in httpd.conf, and the results are 
> below, but I don't know what can I do to solve the problem and to make the 
> application consume less processor time.
> 
> The processor of the machine is an Intel Core 2 Duo at 2.4 GHz, and the 
> computer has 8 GB of RAM, and the application isn't very big. It has just 
> 130 templates and 21 controller modules that have aproximately 400 KB.
> 
> It worked fine until I added Catalyst::Plugin::I18N and I've translated the 
> interface into 3 languages, but I don't know if this is the cause, or how 
> could I solve it in other way if I still want to have the interface in more 
> languages.
> 
> Isn't Catalyst able to handle big applications? Or what could I be doing 
> wrong?

Oh, Catalyst can handle mighty big apps (230 files in lib totalling 800KB -
don't get me started on templates).

But you left out the most important fact:  How much traffic are you seeing?
Apache (and mod_perl) doesn't use much cpu, if there's no traffic.

Fighting cpu usage in webapps really mostly comes down to: Don't do any work
you don't have to, i.e. cache cache cache.

Caching is relevant in several places:

* Have TT compile it's templates.
* Cache results from common database queries.
* Cache semi-static page-snippets (e.g. don't calculate the html for "10 most
  popular articles" every time you draw a page).
* Cache entire pages if possible.

How you break it down is mostly up to your specific application needs.
But cache.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Preventing Catalyst from loading a Controller pm module

2007-10-30 Thread Lars Balker Rasmussen
On Tue, Oct 30, 2007 at 03:19:48PM +0200, Valentin Tumarkin wrote:
> Hi,
> 
> I was wondering if there's a "standard" way for preventing Catalyst from
> loading a Controller module. I would like to keep my base Controller modules
> in the MyApp/Controller directory, but do not want Catalyst treating them as
> http-client accessible modules.
> 
> For example:
> MyApp/Controller/BaseController.pm
> MyApp/Controller/AdvancedBaseControllerClass.pm (uses BaseController)
> MyApp/Controller/ActualController.pm (uses AdvancedBaseController)
> 
> At this time I'm putting my base classes in the MyApp/Base/.. directories,
> but this method just doesn't seem as "clean" to me.

This isn't clean(!) per se, but you could simply do
   sub auto { 0 }
in the virtual bases and 
   sub auto { 1 }
in the real controllers.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/