[Catalyst] [ANNOUNCE] CALL FOR TESTING Catalyst-Runtime 5.80014_01

2009-11-23 Thread Tomas Doran
Hot on the heels of Catalyst-Runtime 5.80014, I'd like to announce a development release, Catalyst 5.80014_01. This release has a potentially behavior changing fix for the CGI and FastCGI engines to do with outputting UTF-8. This fixes a serious bug with outputting utf-8 pages using Catalys

Re: [Catalyst] How to reduce the memory footprint?

2009-11-23 Thread Rodrigo
On Mon, Nov 23, 2009 at 10:45 PM, J. Shirley wrote: > > I wouldn't trust the output of top/ps to determine how much memory is used. > > -J > > I do. Not for individual processes, though. But for the totals top is perfectly fine for me. I don't have many other processes running on the box. If I

Re: [Catalyst] How to reduce the memory footprint?

2009-11-23 Thread Dave Rolsky
On Mon, 23 Nov 2009, Julien Sobrier wrote: I run 5 instances of FastCGI. Each instance was taking about 90MB of memory. I tried to reduce the memory fooprint by reducing the number of libraries I used. The memory usage is now 120MB per instance! The memory increase is probably due to other chang

Re: [Catalyst] Re: Unicode trouble with Catalyst::Engine::FastCGI

2009-11-23 Thread Tomas Doran
On 23 Nov 2009, at 21:15, Aristotle Pagaltzis wrote: * Bernhard Graf [2009-11-23 20:00]: Aristotle Pagaltzis schrieb: While this fixes the problem, it is still unclear, why the utf8 flag is set for the whole buffer. It shouldn’t matter. But it does. yes, because ::FastCGI is broken. :-

Re: [Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread Tomas Doran
On 23 Nov 2009, at 18:24, Marc SCHAEFER wrote: On Mon, Nov 23, 2009 at 05:43:25PM +0100, Aristotle Pagaltzis wrote: I had an IRC convo with Tomas Doran last night and explained the problem to him. He knocked out some tests for the broken Thank you for your time! It's nice to see the respo

Re: [Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread Marc SCHAEFER
On Mon, Nov 23, 2009 at 05:43:25PM +0100, Aristotle Pagaltzis wrote: > If you use the `html` filter instead of `html_entity`, it will > escape only the five characters that have to be. Thank you. It works like a charm. > I had an IRC convo with Tomas Doran last night and explained the > problem t

Re: [Catalyst] How to reduce the memory footprint?

2009-11-23 Thread J. Shirley
On Mon, Nov 23, 2009 at 1:25 PM, Julien Sobrier wrote: > Right, nprocs=5 > > I thought 100M RES/300M VIRT meanst 100M per process, and 300M shard among > perl processes. > > I don't have many other processes running on the box. If I turn off > catalyst, I use less than 250MB or memory. With Catal

Re: [Catalyst] How to reduce the memory footprint?

2009-11-23 Thread Peter Karman
Julien Sobrier wrote on 11/23/2009 03:25 PM: > Right, nprocs=5 > > I thought 100M RES/300M VIRT meanst 100M per process, and 300M shard > among perl processes. > > I don't have many other processes running on the box. If I turn off > catalyst, I use less than 250MB or memory. With Catalyst, I'm o

Re: [Catalyst] How to reduce the memory footprint?

2009-11-23 Thread Julien Sobrier
Right, nprocs=5 I thought 100M RES/300M VIRT meanst 100M per process, and 300M shard among perl processes. I don't have many other processes running on the box. If I turn off catalyst, I use less than 250MB or memory. With Catalyst, I'm over 800MB with some occasional swapping. On Mon, Nov 23,

[Catalyst] Re: Unicode trouble with Catalyst::Engine::FastCGI

2009-11-23 Thread Aristotle Pagaltzis
Hi Bernhard, * Bernhard Graf [2009-11-23 20:00]: > Aristotle Pagaltzis schrieb: > >>> While this fixes the problem, it is still unclear, why the >>> utf8 flag is set for the whole buffer. >> >> It shouldn’t matter. > > But it does. yes, because ::FastCGI is broken. :-) Is what I’m saying. >>>

[Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread Aristotle Pagaltzis
* Bill Moseley [2009-11-23 20:10]: > I'd argue that when it's time to set the length it should die > if utf8 flag is still set. I’m of two minds about this… it may well be that a string is correctly encoded but has gotten upgraded, and such a string will produce the right output anyhow. I don’t k

Re: [Catalyst] How to reduce the memory footprint?

2009-11-23 Thread Tomas Doran
On 23 Nov 2009, at 18:18, Julien Sobrier wrote: Hello, I have quite a small Catalyst application that runs with FastCGI + FCGI::ProcManager::MaxRequests I run 5 instances of FastCGI. Each instance was taking about 90MB of memory. I tried to reduce the memory fooprint by reducing the numb

Re: [Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread Bill Moseley
On Mon, Nov 23, 2009 at 10:14 AM, Aristotle Pagaltzis wrote: > > > > Encode the string to the destination encoding (not just character > set), so that the string represents an encoded octet stream, and > then look at the plain old character length of that string. That > will always give you the ri

Re: [Catalyst] Re: Unicode trouble with Catalyst::Engine::FastCGI

2009-11-23 Thread Bernhard Graf
Aristotle Pagaltzis schrieb: >> While this fixes the problem, it is still unclear, why the utf8 >> flag is set for the whole buffer. > > It shouldn’t matter. But it does. >> So Ladies and Gentleman, may I present you the culprit? It is >> YAML::XS! Everything read by YAML::XS >> >> perl -MYAML:

[Catalyst] Re: Unicode trouble with Catalyst::Engine::FastCGI

2009-11-23 Thread Aristotle Pagaltzis
* Bernhard Graf [2009-11-23 19:10]: > Meanwhile I realized, that the final output buffer (header > + body) actually /has/ the UTF-8 flag set. So it seems, that > Jonathan's idea (above link) also matches my case. Everything > seems fine again, when I insert this line > > utf8::downgrade($buffer)

[Catalyst] How to reduce the memory footprint?

2009-11-23 Thread Julien Sobrier
Hello, I have quite a small Catalyst application that runs with FastCGI + FCGI::ProcManager::MaxRequests I run 5 instances of FastCGI. Each instance was taking about 90MB of memory. I tried to reduce the memory fooprint by reducing the number of libraries I used. The memory usage is now 120MB per

[Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread Aristotle Pagaltzis
* Carl Johnstone [2009-11-23 18:50]: > Aristotle Pagaltzis wrote: > > Please plese don’t make statements like “not in this case” > > without knowing what the thing you are talking about does, > > i.e. in this case bytes::length, does. There are enough > > misconceptions about Unicode in Perl alrea

Re: [Catalyst] Unicode trouble with Catalyst::Engine::FastCGI

2009-11-23 Thread Bernhard Graf
Good news everyone! I found the gist of the matter and some places that should be fixed. > Googling around I found > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg00051.html , > but I couldn't verify Jonathan's assumption in my case - even before the > buffer is written into the FastCG

Re: [Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread J. Shirley
On Mon, Nov 23, 2009 at 8:34 AM, Aristotle Pagaltzis wrote: > > [huge snip] > Aristotle++ This was a fantastic explanation with examples. Even though I *think* I understand the unicode issues in perl, I still can find myself getting confused. These examples just help that. Thanks for this, i

Re: [Catalyst] Avoiding UTF8 in Catalyst

2009-11-23 Thread Peter Edwards
> > The fact is that counting bytes from the Perl Unicode upgraded string is > wrong when using ISO-8859-1. > > Maybe Catalyst dropped any support for non UTF-8 charset. By doing that > it also dropped any support for any charset having a bytesize different > than the Perl Unicode upgraded string i

Re: [Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread Carl Johnstone
Aristotle Pagaltzis wrote: > But there’s no room for “likelies” here: that’s programming by > coincidence. The "likely" was correct. When using UTF-8 whether the length of the string is different in bytes and characters depends entirely on what the contents of the string are. Given a particular

[Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread Aristotle Pagaltzis
* Marc SCHAEFER [2009-11-23 17:20]: > On Mon, Nov 23, 2009 at 07:42:06AM -0800, Bill Moseley wrote: > >Still not following. You are talking about Catalyst::View::TT? > > It appears that the latin1 -> htmlentities conversion is done > by View:TT's htmlentity, e.g.: > >[% FOREACH h IN cols %][

[Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread Aristotle Pagaltzis
* Carl Johnstone [2009-11-23 15:35]: > Aristotle Pagaltzis wrote: > > # everything should be bytes at this point, but just in case > > $response->content_length( bytes::length( $response->body ) ); > > > > I was shocked to discover this! Any code that uses > > bytes::length is automaticall

Re: [Catalyst] Avoiding UTF8 in Catalyst

2009-11-23 Thread Marc SCHAEFER
On Mon, Nov 23, 2009 at 07:42:06AM -0800, Bill Moseley wrote: > Still not following. You are talking about Catalyst::View::TT? It appears that the latin1 -> htmlentities conversion is done by View:TT's htmlentity, e.g.: [% FOREACH h IN cols %][% b.$h | html_entity %][% END %] This is perfe

Re: [Catalyst] Avoiding UTF8 in Catalyst

2009-11-23 Thread Bill Moseley
On Mon, Nov 23, 2009 at 2:01 AM, Marc SCHAEFER wrote: > On Sat, Nov 21, 2009 at 05:16:24PM -0800, Bill Moseley wrote: >> > Apparently all diacritic characters are expanded into HTML entities. >> >> Where does that happen? > > It looks like it's TT::View's htmlentity which does this, not just for >

Re: [Catalyst] Re: Avoiding UTF8 in Catalyst

2009-11-23 Thread Carl Johnstone
Aristotle Pagaltzis wrote: > # everything should be bytes at this point, but just in case > $response->content_length( bytes::length( $response->body ) ); > > I was shocked to discover this! Any code that uses bytes::length > is automatically broken. Not in this case, the HTTP spec says th

Re: [Catalyst] consuming Webservices with Catalyst?

2009-11-23 Thread Joel Bernstein
2009/11/23 Jens Schwarz : > Hi, > > I want to change my Catalyst app so that its data is not written/read to/from > my MySQL-DB but to/from Webservices. > > I have made a simple test (outside of Catalyst) with SOAP::WSDL that works > for "reading" a Webservice. This looks like this: > But actual

[Catalyst] consuming Webservices with Catalyst?

2009-11-23 Thread Jens Schwarz
Hi, I want to change my Catalyst app so that its data is not written/read to/from my MySQL-DB but to/from Webservices. I have made a simple test (outside of Catalyst) with SOAP::WSDL that works for "reading" a Webservice. This looks like this: use MyInterfaces::FooService::FooPortType; my $us

[Catalyst] Unicode trouble with Catalyst::Engine::FastCGI

2009-11-23 Thread Bernhard Graf
After I recently re-installed my Development-Perl (that one, that I use apart from the production Perl installation), all pages that went through Catalyst::Engine::FastCGI got double-utf8-encoded. When using the standalone HTTP server, everything is fine. Both installations used Perl 5.10.1. I di

Re: [Catalyst] call of the dbd disconnect method via catalyst model

2009-11-23 Thread Tomas Doran
christian4catal...@lists.muthpartners.de wrote: Can me someone say, where i can, who i can close the dbd-connection in line 09, so that line 10 reopen the connection. 01 sub foo 02 { 03 my ( $self, $c ) = @_; 04 my $model = $c->model('DB::TABLE') ; 05 my