DreamHost + Catalyst tips (was Re: [Catalyst] Web hosting?)

Ashley Pond V apv at sedition.com
Sun Jan 6 00:56:40 GMT 2008


I'm running… 6(?) fastcgi Cat apps on Dreamhost. These are some pointers
(I'll put them in the wiki later if I can).

  * Name your app "dispatch.fcgi"
    Their long-process killing script respects that name much better.

  * You have to enable fastcgi in the panel for that domain. It's not  
on by default.

  * If you do have more than one of /anything/ dynamic, create a  
separate user to run it. Their process allotments work by user, not  
by account. So two Cat apps on one user will probably cause them to  
get killed often. If each has their own user, much better accord.

  * You can do things like perl -cw ~/domain.xyz/dispatch.fcgi
    to see (some) errors that will otherwise get sucked up for three  
minutes waiting for the fastcgi process to end.

  * Set up your own local/lib and install all your own modules. I  
like DreamHost but now and then they are pretty admin challenged and  
have long out of date, or /broken/, versions of modules in the  
regular @INC.

  * Do a touch ~/domain.xyz/dispatch.fcgi to reset your app. killall  
dispatch.fcgi for last resorts.

  * 90% of the problems I've had were related to DB traffic external  
to my stuff (just guessing: some mutt using 18 PHP scripts hogging  
all the connections). If you start a mysql shell and do a simple  
query, sometimes that's enough to unlock hanging connections.

  * The default values for some of the Session modules are BAD!!!  
They create a new, large, session value in the /tmp dir for every  
single visitor and can quickly lock up a box for you and everyone on  
it. Running the install tests alone can leave a couple of gigabytes  
of trash in /tmp. Yes, I did this. No, I didn't file a bug report  
yet. I am BAD!!! :(  Make sure to specify your own session file paths  
and it's best to do something like ~/etc/sessions… instead of /tmp  
which has hard wired disk limits.

-Ashley

On Jan 5, 2008, at 4:11 PM, Jay Varner wrote:
> Just to throw in, I love Dreamhost but I was never able to get my
> Catalyst app to deploy with them on FastCGI. I've moved on to A Small
> Orange and had my app up and running within hours of having my account
> set up. There were some Modules I had trouble installing from CPAN,
> but A Small Orange would install the the mods for me so fast I didn't
> get to take a break.
>
> On Jan 5, 2008 6:16 PM,  <catalyst-request at lists.scsys.co.uk> wrote:
>> Send Catalyst mailing list submissions to
>>         catalyst at lists.scsys.co.uk
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> or, via email, send a message with subject or body 'help' to
>>         catalyst-request at lists.scsys.co.uk
>>
>> You can reach the person managing the list at
>>         catalyst-owner at lists.scsys.co.uk
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Catalyst digest..."
>>
>>
>> Today's Topics:
>>
>>    1. Re: ResultSet renderer? (Zbigniew Lukasiak)
>>    2. Re: Re: "Rails is a Ghetto" (Daniel McBrearty)
>>    3. What can C::P::Cache cache? (Joe Landman)
>>    4. Re: What can C::P::Cache cache? (Joe Landman)
>>    5. Re: Web hosting? (Martin Ellison)
>>    6. strange error when running a Catalyst app (Octavian Rasnita)
>>    7. utf8 / pg double encoding problem (Daniel McBrearty)
>>    8. CPAN install without test? [ot] (Martin Ellison)
>>
>>
>> --------------------------------------------------------------------- 
>> -
>>
>> Message: 1
>> Date: Sat, 5 Jan 2008 16:21:18 +0100
>> From: "Zbigniew Lukasiak" <zzbbyy at gmail.com>
>> Subject: Re: [Catalyst] ResultSet renderer?
>> To: "The elegant MVC web framework" <catalyst at lists.scsys.co.uk>
>> Message-ID:
>>         <d36a60910801050721s7a5551d2jaddb89f2a750525b at mail.gmail.com>
>> Content-Type: text/plain; charset=UTF-8
>>
>> On Jan 4, 2008 11:20 PM, Bruce J Keeler <bruce at drangle.com> wrote:
>>> Greetings, Catalystos!
>>>
>>> I'm looking to find or create a canned solution for rendering
>>> DBIx::Class::ResultSets as paged, sortable HTML tables.  All of the
>>> examples I've seen do this manually, foreaching through the  
>>> resultset,
>>> spitting out <tr>s and <td>s and so on.  Seems like the sort of  
>>> wheel
>>> that shouldn't need to be reinvented.
>>
>> You might have a look at Catalyst::Example::InstantCRUD.  It is a bit
>> dated now - but I am working on a new versions of it (based on
>> HTML::FormFu instead of HTML::Widget).
>>
>> Cheers,
>> Zbigniew
>> http://perlalchemy.blogspot.com
>>
>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Sat, 5 Jan 2008 20:17:17 +0100
>> From: "Daniel McBrearty" <danielmcbrearty at gmail.com>
>> Subject: Re: [Catalyst] Re: "Rails is a Ghetto"
>> To: "The elegant MVC web framework" <catalyst at lists.scsys.co.uk>
>> Message-ID:
>>         <9cf113670801051117s54d029etf80e196fa2502e28 at mail.gmail.com>
>> Content-Type: text/plain; charset=UTF-8
>>
>> wow!
>>
>> that's some rant. couldn't read it all the way, but half was  
>> enough ...
>>
>>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Sat, 05 Jan 2008 16:18:22 -0500
>> From: Joe Landman <landman at scalableinformatics.com>
>> Subject: [Catalyst] What can C::P::Cache cache?
>> To: The elegant MVC web framework <catalyst at lists.scsys.co.uk>
>> Message-ID: <477FF41E.2030304 at scalableinformatics.com>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Sounds like a strange question, but I want to know if I can put a
>> complex data structure like a hash in there.  Do I need to  
>> serialize it
>> first?
>>
>> Alternatively, if it only handles scalars, that is also useful to  
>> know.
>>
>> Thanks.
>>
>>
>> --
>> Joe Landman
>> landman at scalableinformatics.com
>>
>>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Sat, 05 Jan 2008 16:33:29 -0500
>> From: Joe Landman <landman at scalableinformatics.com>
>> Subject: Re: [Catalyst] What can C::P::Cache cache?
>> To: The elegant MVC web framework <catalyst at lists.scsys.co.uk>
>> Message-ID: <477FF7A9.1030501 at scalableinformatics.com>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Joe Landman wrote:
>>> Sounds like a strange question, but I want to know if I can put a
>>> complex data structure like a hash in there.  Do I need to  
>>> serialize it
>>> first?
>>>
>>> Alternatively, if it only handles scalars, that is also useful to  
>>> know.
>>>
>>> Thanks.
>>
>> Well ... never mind.  I figured it out for my self.  Short  
>> version, the
>> following appears to work nicely:
>>
>>      my $serialized_menu = $c->cache->get('menu');
>>      if ($serialized_menu)
>>        {
>>         @menu   = @{$serialized_menu};
>>         $c->log->debug('Root::_get_navbar menu retrieved from  
>> cache');
>>        }
>>        else
>>        {
>>         $c->log->debug('Root::_get_navbar rebuilding menu');
>>
>>         # rebuild menu
>>         $c->cache->set('menu',\@menu);
>>        }
>>
>> For some reason the manual's
>>
>>         unless ( ... ) {
>>
>>         } ...
>>
>> construct did not work for this case.
>>
>> --
>>
>> Joe Landman
>> landman at scalableinformatics.com
>>
>>
>>
>> ------------------------------
>>
>> Message: 5
>> Date: Sun, 6 Jan 2008 05:41:56 +0800
>> From: "Martin Ellison" <m.e at acm.org>
>> Subject: Re: [Catalyst] Web hosting?
>> To: "The elegant MVC web framework" <catalyst at lists.scsys.co.uk>
>> Message-ID:
>>         <7093a26c0801051341t48827f68x901e4abf8b328e3b at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> SSd2ZSBub3cgc29ydGVkIHRoaXMgb3V0IHdpdGggRHJlYW1Ib3N0IGFuZCB3ZSBub3cga 
>> GF2ZSBh
>> biBhY2NvdW50LgoKT24gMDQvMDEvMjAwOCwgTWFydGluIEVsbGlzb24gPG0uZUBhY20ub 
>> 3JnPiB3
>> cm90ZToKPgo 
>> +IFRoZSByZWZ1c2FsIGVtYWlsIHdhcyAob24gZmFjZSkgZnJvbSBhIGh1bWFuLCBh
>> bmQgZGlkIG5vdCBzdGF0ZSBhbnkKPiByZWFzb24uIEkndmUgcmVwbGllZCBhc2tpbmcgZ 
>> m9yIGFu
>> IGV4cGxhbmF0aW9uLgo 
>> +Cj4gT24gMDQvMDEvMjAwOCwgSm9uIFNjaHV0eiA8IGpvbitjYXRhbHlz
>> dEB5b3VyYW1pZ28uY29tPiB3cm90ZToKPiA 
>> +Cj4gPiBPbiBGcmksIDIwMDgtMDEtMDQgYXQgMDk6
>> MjggKzA4MDAsIE1hcnRpbiBFbGxpc29uIHdyb3RlOgo 
>> +ID4gPiBEcmVhbWhvc3QgaGF2ZSByZWZ1
>> c2VkIHRvIGFjY2VwdCBvdXIgc2l0ZSBvbiB0aG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c2l0ZTogaHR0cDovL2Rldi5jYXRhbHlzdC5wZXJsLm9yZy8KP 
>> iA+Cj4K
>> Pgo+Cj4gLS0KPiBSZWdhcmRzLAo+IE1hcnRpbgo 
>> +IChtLmVAYWNtLm9yZykKPiBJVDogaHR0cDov
>> L21ldGhvZHN1cHBvcnQuY29tIFBlcnNvbmFsOiBodHRwOi8vdGhlcmVpc25vZW5kLm9yZ 
>> wo+CgoK
>> Ci0tIApSZWdhcmRzLApNYXJ0aW4KKG0uZUBhY20ub3JnKQpJVDogaHR0cDovL21ldGhvZ 
>> HN1cHBv
>> cnQuY29tIFBlcnNvbmFsOiBodHRwOi8vdGhlcmVpc25vZW5kLm9yZwotLS0tLS0tLS0tL 
>> S0tLSBu
>> ZXh0IHBhcnQgLS0tLS0tLS0tLS0tLS0KQW4gSFRNTCBhdHRhY2htZW50IHdhcyBzY3J1Y 
>> mJlZC4u
>> LgpVUkw6IGh0dHA6Ly9saXN0cy5zY3N5cy5jby51ay9waXBlcm1haWwvY2F0YWx5c3QvY 
>> XR0YWNo
>> bWVudHMvMjAwODAxMDYvZTUzZmEyYWQvYXR0YWNobWVudC0wMDAxLmh0bQo=
>>
>> ------------------------------
>>
>> Message: 6
>> Date: Sun, 6 Jan 2008 00:10:00 +0200
>> From: "Octavian Rasnita" <orasnita at gmail.com>
>> Subject: [Catalyst] strange error when running a Catalyst app
>> To: "The elegant MVC web framework" <catalyst at lists.scsys.co.uk>
>> Message-ID: <003001c84fe7$bafd9600$c2a2b451 at teddy>
>> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
>>         reply-type=original
>>
>> Hi,
>>
>> I have a Catalyst app that used to work, and now I don't know why  
>> it doesn't
>> want to do that anymore.
>>
>> I've created a new app as a test:
>>
>> E:\web> catalyst MyTest
>> ...
>> created "MyTest\script/mytest_cgi.pl"
>> created "MyTest\script/mytest_fastcgi.pl"
>> created "MyTest\script/mytest_server.pl"
>> created "MyTest\script/mytest_test.pl"
>> created "MyTest\script/mytest_create.pl"
>>
>> E:\web> perl MyTest\script\mytest_test.pl
>> search_paths: Can't open E:\usr\site\lib\Config\Any\E:\INI.pm:  
>> Invalid
>> argument
>> at E:/usr/site/lib/Module/Pluggable/Object.pm line 162.
>> Compilation failed in require at E:/usr/site/lib/Catalyst/Test.pm  
>> line 90.
>> BEGIN failed--compilation aborted at MyTest\script\mytest_test.pl  
>> line 9.
>> E:\web>
>>
>> It gave a similar error in the existing application when I run the
>> startup.pl file.
>>
>> Have you seen this type of error before?
>>
>> Thank you.
>>
>> Octavian
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 7
>> Date: Sat, 5 Jan 2008 23:54:59 +0100
>> From: "Daniel McBrearty" <danielmcbrearty at gmail.com>
>> Subject: [Catalyst] utf8 / pg double encoding problem
>> To: "The elegant MVC web framework" <catalyst at lists.scsys.co.uk>,
>>         dbix-class at lists.rawmode.org
>> Message-ID:
>>         <9cf113670801051454l310af5d6v88b31dd3c644940f at mail.gmail.com>
>> Content-Type: text/plain; charset=UTF-8
>>
>> well I'm damned, I thought I had this stuff working squeaky clean.  
>> But
>> I was wrong. I actually had two bugs cancelling each other out -
>> usually.
>>
>> Anyway, cut to the chase. The problem (the second bug that didn't  
>> show
>> until I cleared the first one) is a form submit that stores in the
>> database but ends up being double encoded when you get it back.
>>
>> I am *certain* that UTF8 is getting sent over the wire to catalyst.
>>
>> Here is some test data:
>>
>> the data being submitted is this, with the two ways of  
>> representing it
>>
>> abçöeü
>> unicode = 61 62 e7 f6 65 fc
>> utf8 = 61 62 (c3 a7) (c3 b6) 65 (c3 bc)
>>
>> I have C::Plugin::Unicode. The database is a postgres 8.2 utf8  
>> database.
>>
>> Here is a snip of the controller code:
>>
>> <snip>
>> sub sitetext_update : Chained('translator') Args(0){
>>   my ( $self, $c ) = @_;
>>
>>   my $edit = $c->req->param('edit') || '';
>>   $c->log->debug( $edit );
>>   $c->log->dumper( $edit );
>>   $c->log->debug( utf8::is_utf8( $edit ) ? "it's UTF8!" : "no it  
>> isn't UTF8" );
>>
>> ... ($edit gets written to the db here)
>>
>> }
>> </snip>
>>
>> Here's what we see, debug output:
>>
>> <snip>
>> .------------------------------------- 
>> +--------------------------------------.
>> | Parameter                           |  
>> Value                                |
>> +------------------------------------- 
>> +--------------------------------------+
>> | edit                                |  
>> abçöeü                      |
>> '------------------------------------- 
>> +--------------------------------------'
>> [debug] abçöeü
>> [debug] $VAR1 = "ab\x{c3}\x{a7}\x{c3}\x{b6}e\x{c3}\x{bc}";
>> [debug] it's UTF8!
>> </snip>
>>
>> here is what happens in the pg logfile:
>>
>> 2008-01-05 23:21:45 CET LOG:  execute dbdpg_11: UPDATE
>> sitetext_translated SET content = $1, timestamp = $2 WHERE (
>> language_id = $3 AND sitetext_id = $4 )
>> 2008-01-05 23:21:45 CET DETAIL:  parameters: $1 = 'abçöeü', $2 =
>> '2008-01-05 22:21:45', $3 = '22', $4 = 'ca'
>>
>> and yes, it is double encoded when we retrieve the data.
>>
>> Why? We have  good utf8 string coming in. It is flagged as such (odd
>> that the usual debug output doesn't display this right  
>> though ...). PG
>> expects UTF8 from the client. So why?
>>
>> I use utf8columns on the database. I understand that this just tells
>> perl "this is utf8, you can flag it as such" when it gets data from
>> that column? so should not be an issue, right?
>>
>> thanks if you can explain this. I really hope that an hour from now I
>> will be saying "DOH" and slapping ice cream into my forehead.
>>
>> ------------------------------
>>
>> Message: 8
>> Date: Sun, 6 Jan 2008 07:16:38 +0800
>> From: "Martin Ellison" <m.e at acm.org>
>> Subject: [Catalyst] CPAN install without test? [ot]
>> To: "The elegant MVC web framework" <catalyst at lists.scsys.co.uk>
>> Message-ID:
>>         <7093a26c0801051516p589b003nac860be23646a8e at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> RG9lcyBhbnlvbmUga25vdyBob3cgdG8gZ2V0IENQQU4gdG8gaW5zdGFsbCBhIG1vZHVsZ 
>> SB3aXRo
>> b3V0IGRvaW5nIHRoZSB0ZXN0CnN0ZXBzIGF0IGFsbD8gRm9yY2UgaW5zdGFsbCBzdGlsb 
>> CBkb2Vz
>> IHRoZSB0ZXN0IHN0ZXBzOyBJIGp1c3Qgd2FudCB0byBnbyB0bwp0aGUgYWN0dWFsIG1ha 
>> 2UgaW5z
>> dGFsbC4KClNsaWdodGx5IG9mZiB0b3BpYywgYnV0IGlmIGFueW9uZSBrbm93cyBob3cgd 
>> G8gaW5z
>> dGFsbCBtb2R1bGVzLCBpdCBtdXN0IGJlCkNhdGFseXN0IGRldmVsb3BlcnMuLi4gICAod 
>> GhlIG1v
>> ZHVsZSBpbiBxdWVzdGlvbiBpcyBEQkl4OjpDbGFzczsgZm9yIHNvbWUKcmVhc29uIGl0I 
>> GlzIGZh
>> aWxpbmcgdGhlIHBvcHVsYXRlIHRlc3QpLgoKLS0gClJlZ2FyZHMsCk1hcnRpbgoobS5lQ 
>> GFjbS5v
>> cmcpCklUOiBodHRwOi8vbWV0aG9kc3VwcG9ydC5jb20gUGVyc29uYWw6IGh0dHA6Ly90a 
>> GVyZWlz
>> bm9lbmQub3JnCi0tLS0tLS0tLS0tLS0tIG5leHQgcGFydCAtLS0tLS0tLS0tLS0tLQpBb 
>> iBIVE1M
>> IGF0dGFjaG1lbnQgd2FzIHNjcnViYmVkLi4uClVSTDogaHR0cDovL2xpc3RzLnNjc3lzL 
>> mNvLnVr
>> L3BpcGVybWFpbC9jYXRhbHlzdC9hdHRhY2htZW50cy8yMDA4MDEwNi9lMjNlNTQ1Yy9hd 
>> HRhY2ht
>> ZW50Lmh0bQo=
>>
>> ------------------------------
>>
>> _______________________________________________
>> Catalyst mailing list
>> Catalyst at lists.scsys.co.uk
>> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>>
>>
>> End of Catalyst Digest, Vol 35, Issue 11
>> ****************************************
>>
>
> _______________________________________________
> 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 at lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>



More information about the Catalyst mailing list