You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by William A Rowe Jr <wr...@rowe-clan.net> on 2017/03/09 03:30:27 UTC

Re: Where is the mod_perl development repo?

Explore the idea of wrapping your app as an fcgid endpoint. Httpd has two
options (mod_fcgid managing the pool, and mod_proxy_fcgi with your own
choice of independent pool management.)

This offers the best of both... Larger number of httpd endpoints and less
contention between fcgi processes. It is now the recommended approach to
PHP and other scripting endpoints.

On Feb 19, 2017 06:50, "Tom Browder" <to...@gmail.com> wrote:

On Sun, Feb 19, 2017 at 00:44 Randal L. Schwartz <me...@stonehenge.com>
wrote:

> >>>>> "Tom" == Tom Browder <to...@gmail.com> writes:

...

>
Randall, I do know that, and I love Perl 6!  I also feel comfortable
writing CGI programs, so how can I use both most efficiently with my apache
web server.?

Best regards,

-Tom

P.S. I enjoyed meeting you and shaking hands with you at YAPC::NA::2016.
Thanks for all your contributions to the Perl community!

Re: Where is the mod_perl development repo?

Posted by Vincent Veyron <vv...@wanadoo.fr>.
On Thu, 9 Mar 2017 09:52:27 +0100
André Warnier <aw...@ice-sa.com> wrote:


> If I understand the general idea correctly, it consists of no longer running complicated 
> and memory-hungry things directly in Apache through mod_perl, but to use Apache as a 
> front-end reverse proxy, and proxy such calls to one or more back-end processes having 
> their own persistent perl (or other) interpreter. Is that correct ?
> 

What is your use case? If this is for a high traffic site serving lots of static pages, or your databases are huge and require long running queries, it may be worth it. 

My situation is the opposite, no static content, low traffic, all of it hitting small databases with 5 or six queries on average per page (for CRM type apps).

This is what top looks like on a dedibox serving about 20 users :

top - 16:25:21 up 11 days, 44 min,  1 user,  load average: 0,00, 0,00, 0,00
Tasks: 128 total,   1 running, 127 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0,0 us,  0,1 sy,  0,0 ni, 99,9 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem:   4041248 total,  1112512 used,  2928736 free,   134504 buffers
KiB Swap:  4094972 total,        0 used,  4094972 free.   661944 cached Mem

Tests with ab show 50 requests/second, and I don't see a memory problem that would warrant the overhead of a front-end reverse proxy.

-- 
					Bien à vous, Vincent Veyron 

https://marica.fr/
Gestion des sinistres assurances, des dossiers contentieux et des contrats pour le service juridique

Re: Where is the mod_perl development repo?

Posted by Michael Schout <ms...@gkg.net>.
On 3/9/17 2:52 AM, Andr� Warnier wrote:

> If I understand the general idea correctly, it consists of no longer
> running complicated and memory-hungry things directly in Apache through
> mod_perl, but to use Apache as a front-end reverse proxy, and proxy such
> calls to one or more back-end processes having their own persistent perl
> (or other) interpreter. Is that correct ?

Pretty much.

Except its much more common to see something like nginx acting as the
proxy than Apache due to nginx's lighter footprint and better handling
of large numbers of concurrent connections.

If you are writing a Perl (5) web app these days, you should probably
write it using Plack/PSGI compatible framework (dancer, mojo, catalyst
etc) and run it under something like starman behind nginx (or apache or
any other http proxy that you prefer).

If you do not wish to use a framework, then just write it in plain
Plack/PSGI.

Regards,
Michael Schout

Re: Where is the mod_perl development repo?

Posted by André Warnier <aw...@ice-sa.com>.
Hello.

I am catching this at the end, but the general subject interests me, and I'd like to know 
more. Should I start a new thread ? and what best to name it ?

My situation : I am not a hot-shot programmer nor perl expert, but over time I have 
written quite a few mod_perl-based pieces of code, roughly in 2 categories :
1) one category which interacts quite heavily with the Apache request processing phases 
and with the Request object, such as authentication, various kinds of proxying, wraps 
around DAV to make it do what I want, output filters etc.
2) another category of things which could have been done using CGI and Apache::Registry 
(processing <form> submits etc.), but since I was already doing the first kind above, I've 
done these by creating add-on mod_perl modules instead. (Which do sometimes rely on 
something that has been done by the first category, like $r->pnotes).

But if really "It is now the recommended approach to PHP and other scripting endpoints" 
(including, I suppose, perl), it looks like I would slowly have to change my strategy.

If I understand the general idea correctly, it consists of no longer running complicated 
and memory-hungry things directly in Apache through mod_perl, but to use Apache as a 
front-end reverse proxy, and proxy such calls to one or more back-end processes having 
their own persistent perl (or other) interpreter. Is that correct ?

Intuitively, I would imagine that the approach below fits my second category more than the 
first, right ?
So, for the second type, where could I best start reading ?

(Contrarily to the original poster, I am perfectly happy with Perl 5, and not looking at 
Perl 6 yet. I am also not really a fan of very abstract "frameworks", because of their 
general "all or nothing" approach. Template::Toolkit is about my limit).



On 09.03.2017 04:30, William A Rowe Jr wrote:
> Explore the idea of wrapping your app as an fcgid endpoint. Httpd has two
> options (mod_fcgid managing the pool, and mod_proxy_fcgi with your own
> choice of independent pool management.)
>
> This offers the best of both... Larger number of httpd endpoints and less
> contention between fcgi processes. It is now the recommended approach to
> PHP and other scripting endpoints.
>
> On Feb 19, 2017 06:50, "Tom Browder" <to...@gmail.com> wrote:
>
> On Sun, Feb 19, 2017 at 00:44 Randal L. Schwartz <me...@stonehenge.com>
> wrote:
>
>>>>>>> "Tom" == Tom Browder <to...@gmail.com> writes:
>
> ...
>
>>
> Randall, I do know that, and I love Perl 6!  I also feel comfortable
> writing CGI programs, so how can I use both most efficiently with my apache
> web server.?
>
> Best regards,
>
> -Tom
>
> P.S. I enjoyed meeting you and shaking hands with you at YAPC::NA::2016.
> Thanks for all your contributions to the Perl community!
>