呵呵。我也收到了这封邮件。

不过在我的机器上,我感觉mod_perl快很多。

也许是fastcgi没有配置好?



2009/8/20 蒋宇捷 <[email protected]>

>  来自mason-user邮件组前天的一封邮件,刚好也谈到了这个问题,转一下
>
>
>
> Excerpts from Jochem Jofel's message of Tue Aug 18 06:36:42 -0700 2009:
>
> > and I hope to be able to use it for a site that presumably will be a
>
> > high traffic site (thus not very well suited for a (fast)CGI approach)
>
>
>
> FastCGI and mod_perl are indistinguishable from a performance perspective.
>
> Both involve persistent processes answering requests.  It's only vanilla
> CGI that involves starting Perl anew for each request, with all the slowness
> that entails.
>
>
>
> (You can run Mason under fastcgi using its normal CGI handler, though most
> of the documentation assumes you will use mod_perl.)
>
>
>
> hdp.
>
>
>
>
>
> *发件人:* [email protected] [mailto:[email protected]] *代表
> *Mike.G
> *发送时间:* 2009年8月20日 14:47
> *收件人:* [email protected]
> *主题:* Re: 答复: [PerlChina] Re: IiBlog发布了
>
>
>
> 对的。要的就是这种感觉。
>
>
> 另外我也觉得catalyst太复杂了。
> 考虑的东西太多。感觉学习起来曲线很复杂。
>
> 另外有个问题,我怎么发现,run在fastcgi下,反而没有run在mod_perl下的速度快?
>
> 尤其是在mod_perl里挂上Apache::DBI
>
>
>  2009/8/20 蒋宇捷 <[email protected]>
>
> 如果用面向对象的方法来封装的话,例如Dhandler这样写就可以了
>
>
>
>          if ( $r->uri =~ /favicon\.html/i || $r->uri =~ /api\/favicon/i ) {
>
>
>
>                    my $application = new FaviconApplication( 'favmx', $r,
> $m );
>
>                    $application->fetch_favicon;
>
>
>
>          }
>
>          elsif ( $r->uri =~ /vimage\.html/i ) {
>
>
>
>                    my $application = new AuthVCodeApplication( 'favmx', $r,
> $m );
>
>                    $application->generate_vimage;
>
>
>
>          }
>
>          elsif ( $r->uri =~ /api\//i || $r->uri eq '/' ) {
>
>
>
>                    my $application = new AuthFavApplication( 'favmx', $r,
> $m );
>
>                    $application->set_account_memd( $account_memd
> );
>
>                    $application->process;
>
>          }
>
>          elsif ( $r->uri =~ /fav\//i ) {
>
>
>
>                    my $application = new Max1FavApplication( 'favmx', $r,
> $m );
>
>                    $application->process;
>
>
>
>          }
>
>          else {
>
>                    $m->redirect( '/api/fav' );
>
>          }
>
> Autohandler里没内容了
>
>
>
> <%flags>
>
>     inherit => '/dhandler'
>
> </%flags>
>
>
>
> 应用程序完全封装成Application类了,在里面分成各个function进行业务逻辑处理和页面跳转。
>
>
>
> 例如
>
>                    $self->log_error( $request->param('error') );
>
>                    $self->mason->abort( 200 );
>
> Or
>
>                    if ( !$self->is_authorized ) {
>
>                             return $self->mason->comp(
> $AuthFavApplication::UNAUTHORIZED_PAGE, 'application' => $self );
>
>                    }
>
>                    else {
>
>                             return $self->mason->comp(
> $AuthFavApplication::AUTHORIZED_PAGE, 'application' => $self );
>
>                    }
>
> *发件人:* [email protected] [mailto:[email protected]] *代表
> *Mike.G
> *发送时间:* 2009年8月20日 11:29
> *收件人:* [email protected]
> *主题:* [PerlChina] Re: IiBlog发布了
>
>
>
> 好的。我一直想这个问题。
> 如果完全是基于mason来弄,就像是基于页面的开发模式。
> 也就是说一个请求动作要在整个页面里完成的。
> 好像需要把所有的请求放入这个页面里面。我不太喜欢这种。
>
> 不知道能不能这样。
> 比如说定义个db_handle
> 在这个里面结果所有的请求。
> 比如说目录:
> /app/dbhandlers
>
> 然后在这个文件里接管所有请求,
> 请求玩了之后,
> 再forward其他的显示页面。
>
> 自己只是这么想。
> 没有自己写。
>
> *^-^*
>
> 2009/8/20 Beckheng Lam <[email protected]>
>
> 我也是在不停的修改呢。多交流交流哈。
>
> Mike.G wrote:
>
> 哦。我很粗的看了一眼。
> 好像看到你的代码里面夹杂了数据库的查询语句来着。
>
> 我也一直想用mason,但是一直没找到一个自己喜欢的代码模式。
>
>   2009/8/19 Beckheng Lam <[email protected]>
>
>  Mike, 是用Mason写的。你说的混合在HTML是指很多内容输入合并在HTML里面吗?
>
> Mike.G wrote:
>
> 咦,是用Mason写的?
>
> 不过好多代码都好像完全的混合在html里了啊。
>
>   2009/8/19 Beckheng Lam <[email protected]>
>
>  基于HTML::Mason的 IiBlog,包含 文章发布、图片集、投票、留言管理。
>
>
>
> 链接地址:http://code.google.com/p/iiblog/
>
> 欢迎大家提出意见。
>
>
>
>
>
>
>
>
>
>
>
>
>
>  --
>
> Perl乐事 -- http://www.perlersh.org
>
> 我的博客 -- http://www.perlersh.org/blog.html
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。
 要在此论坛发帖,请发电子邮件到 [email protected]
 要退订此论坛,请发邮件至 [email protected]
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

回复