Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

How do you use mod_perl for your web application?

 

 

First page Previous page 1 2 Next page Last page  View All ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


fred at redhotpenguin

Jun 15, 2011, 9:01 PM

Post #1 of 50 (2647 views)
Permalink
How do you use mod_perl for your web application?

I'm interested in hearing about what application frameworks (Catalyst,
CGI::App, Mojolicious) are used here with mod_perl. Given the number
of emerging Perl based webservers on CPAN (in addition to Nginx,
lighty, etc), it seems like there are many more Perl web application
and webservers out there now than there were five years ago.

I'll start. I have a couple of Apache::Dispatch based applications I
wrote. I also work on an Apache::ASP large codebase, and a couple of
different Catalyst based systems. All are running on mod_perl 2.0.4
in production (the ops haven't upgraded to 2.0.5 yet).

If I were to migrate, I would probably try out something like
Mojolicious on Plack on mod_perl2. Performance of mod_perl2 has never
been an issue to date, but I have Perlbal doing connection handling as
a reverse proxy.


david at kineticode

Jun 15, 2011, 10:06 PM

Post #2 of 50 (2609 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Jun 15, 2011, at 9:01 PM, Fred Moyer wrote:

> I'll start. I have a couple of Apache::Dispatch based applications I
> wrote. I also work on an Apache::ASP large codebase, and a couple of
> different Catalyst based systems. All are running on mod_perl 2.0.4
> in production (the ops haven't upgraded to 2.0.5 yet).

I use Apache 2 as a reverse proxy for a bunch of Starman-powered Plack apps. And I have a Bricolage install on mod_perl2.

> If I were to migrate, I would probably try out something like
> Mojolicious on Plack on mod_perl2. Performance of mod_perl2 has never
> been an issue to date, but I have Perlbal doing connection handling as
> a reverse proxy.

PGXN, which runs on Starman, will be moving to a PostgreSQL community server. I think they use Varnish for reverse proxying.

Best,

David


mpeters at plusthree

Jun 16, 2011, 7:15 AM

Post #3 of 50 (2599 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On 06/16/2011 12:01 AM, Fred Moyer wrote:

> I'll start. I have a couple of Apache::Dispatch based applications I
> wrote. I also work on an Apache::ASP large codebase, and a couple of
> different Catalyst based systems. All are running on mod_perl 2.0.4
> in production (the ops haven't upgraded to 2.0.5 yet).

We use CGI::Application on mod_perl 1.31 (I know, I know) with Apache 2
as a reverse proxy.

> If I were to migrate, I would probably try out something like
> Mojolicious on Plack on mod_perl2. Performance of mod_perl2 has never
> been an issue to date, but I have Perlbal doing connection handling as
> a reverse proxy.

We're looking at migrating to PSGI. We actually plan to do a full
evaluation of backends (mod_perl2 vs Starman) and proxies (varnish,
lighttpd, nginx, apache2, perlbal) with SSL thrown in the mix too (some
proxies don't do SSL so we'll look at doing proxy + pound)

--
Michael Peters
Plus Three, LP


casus at casus

Jun 16, 2011, 8:58 AM

Post #4 of 50 (2592 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

> I'm interested in hearing about what application frameworks (Catalyst,
> CGI::App, Mojolicious) are used here with mod_perl.

Currently, I use plain mod_perl2 2.0.4 with apache2 for a project about 10k
LOC on the web side and about 32k application's LOC.

I would like to know a better framework to use in a very specific case: web
side and application are separated in different virtual servers. I see no gain
in using Mojolicious in my case.
--
Anton Petrusevich


perrin at elem

Jun 16, 2011, 12:14 PM

Post #5 of 50 (2585 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Thu, Jun 16, 2011 at 12:01 AM, Fred Moyer <fred [at] redhotpenguin> wrote:
> I'm interested in hearing about what application frameworks (Catalyst,
> CGI::App, Mojolicious) are used here with mod_perl.

Mason 1.x on mod_perl 1.x and apache 1.x, baby!

- Perrin


david at kineticode

Jun 16, 2011, 1:07 PM

Post #6 of 50 (2588 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Jun 16, 2011, at 12:14 PM, Perrin Harkins wrote:

> On Thu, Jun 16, 2011 at 12:01 AM, Fred Moyer <fred [at] redhotpenguin> wrote:
>> I'm interested in hearing about what application frameworks (Catalyst,
>> CGI::App, Mojolicious) are used here with mod_perl.
>
> Mason 1.x on mod_perl 1.x and apache 1.x, baby!

Whatever old man!

David


perrin at elem

Jun 16, 2011, 1:13 PM

Post #7 of 50 (2591 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Thu, Jun 16, 2011 at 4:07 PM, David E. Wheeler <david [at] kineticode> wrote:
> Whatever old man!

I know, it's just a reality of working on applications that have been
around for years. These tools are so reliable that they tend to stick
around. If I started something new I would probably use Plack, since
I've enjoyed using similar stuff in Python.

- Perrin


fred at redhotpenguin

Jun 16, 2011, 1:18 PM

Post #8 of 50 (2588 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Thu, Jun 16, 2011 at 1:13 PM, Perrin Harkins <perrin [at] elem> wrote:
> On Thu, Jun 16, 2011 at 4:07 PM, David E. Wheeler <david [at] kineticode> wrote:
>> Whatever old man!
>
> I know, it's just a reality of working on applications that have been
> around for years.  These tools are so reliable that they tend to stick
> around.  If I started something new I would probably use Plack, since
> I've enjoyed using similar stuff in Python.

Maybe I'm not completely grokking how people are starting new projects
using Plack, but it seems like the way to go is to not use Plack
itself to write the code, but to use one of the many web frameworks
(Mason2, Catalyst, Mojolicious) and then use Plack to specify what
webserver is used. Plack is just middleware.

There is a Mason handler for Plack, so it almost seems like you could
migrate your existing application to the Plack middleware stack while
changing little in your Mason codebase.

I see the role of mod_perl2 going forward as not something that
applications are written on, but something that webserver middleware
interfaces with.


magnus at alum

Jun 16, 2011, 1:19 PM

Post #9 of 50 (2576 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

I had 8-9 apps running as custom mp2 modules (not really in any
framework.) I did a few things in Catalyst, but it never really lit
my candle. Perlbal for reverse proxy. I used Postgres a lot, but
eventually realized that sqlite3 was good enough for what I was doing
most of the time.

Of late, I've been wanting to go to PSGI or node.js, but I haven't
taken the plunge yet. Many of my mod_perl apps relied on client-side
PKI and SSL renegotiation, which I don't think can be done in PSGI,
(or at least not well) and mod_perl really shines by having hooks for
all phases of request handling.



On Thu, Jun 16, 2011 at 12:01 AM, Fred Moyer <fred [at] redhotpenguin> wrote:
> I'm interested in hearing about what application frameworks (Catalyst,
> CGI::App, Mojolicious) are used here with mod_perl.  Given the number
> of emerging Perl based webservers on CPAN (in addition to Nginx,
> lighty, etc), it seems like there are many more Perl web application
> and webservers out there now than there were five years ago.
>
> I'll start.  I have a couple of Apache::Dispatch based applications I
> wrote.  I also work on an Apache::ASP large codebase, and a couple of
> different Catalyst based systems.  All are running on mod_perl 2.0.4
> in production (the ops haven't upgraded to 2.0.5 yet).
>
> If I were to migrate, I would probably try out something like
> Mojolicious on Plack on mod_perl2.  Performance of mod_perl2 has never
> been an issue to date, but I have Perlbal doing connection handling as
> a reverse proxy.
>


fred at redhotpenguin

Jun 16, 2011, 1:24 PM

Post #10 of 50 (2588 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Thu, Jun 16, 2011 at 1:19 PM, Daniel Risacher <magnus [at] alum> wrote:
> Of late, I've been wanting to go to PSGI or node.js, but I haven't
> taken the plunge yet.  Many of my mod_perl apps relied on client-side
> PKI and SSL renegotiation, which I don't think can be done in PSGI,
> (or at least not well) and mod_perl really shines by having hooks for
> all phases of request handling.

Having support for these request phases is definitely something that
middleware authors should keep in mind when looking to support
mod_perl2 well. I don't think Plack does this right now.


mpeters at plusthree

Jun 16, 2011, 1:26 PM

Post #11 of 50 (2615 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On 06/16/2011 04:18 PM, Fred Moyer wrote:

> Maybe I'm not completely grokking how people are starting new projects
> using Plack, but it seems like the way to go is to not use Plack
> itself to write the code, but to use one of the many web frameworks
> (Mason2, Catalyst, Mojolicious) and then use Plack to specify what
> webserver is used. Plack is just middleware.

Yes, but lots of people are using Plack to refer to the Plack family of
stuff. Mainly the PSGI spec, the middleware and possibly one of the new
Plack/PSGI oriented servers (like Starman).

> I see the role of mod_perl2 going forward as not something that
> applications are written on, but something that webserver middleware
> interfaces with.

Yeah, that's what I see too. I'd like to see the performance of Starman
vs mod_perl for normal applications (that don't need to do anything
fancy with Apache). If it's anywhere close to mod_perl than I suspect
lots of people would use it instead since it's much easier to setup and
also much easier to package with your app since it's just a CPAN module.
Would be nice to through FastCGI into that benchmark too.

--
Michael Peters
Plus Three, LP


joe_schaefer at yahoo

Jun 16, 2011, 1:30 PM

Post #12 of 50 (2590 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

----- Original Message ----

> From: Fred Moyer <fred [at] redhotpenguin>
> To: Perrin Harkins <perrin [at] elem>
> Cc: David E. Wheeler <david [at] kineticode>; mod_perl list
><modperl [at] perl>
> Sent: Thu, June 16, 2011 4:18:17 PM
> Subject: Re: How do you use mod_perl for your web application?
>
> On Thu, Jun 16, 2011 at 1:13 PM, Perrin Harkins <perrin [at] elem> wrote:
> > On Thu, Jun 16, 2011 at 4:07 PM, David E. Wheeler <david [at] kineticode>
>wrote:
> >> Whatever old man!
> >
> > I know, it's just a reality of working on applications that have been
> > around for years. These tools are so reliable that they tend to stick
> > around. If I started something new I would probably use Plack, since
> > I've enjoyed using similar stuff in Python.
>
> Maybe I'm not completely grokking how people are starting new projects
> using Plack, but it seems like the way to go is to not use Plack
> itself to write the code, but to use one of the many web frameworks
> (Mason2, Catalyst, Mojolicious) and then use Plack to specify what
> webserver is used. Plack is just middleware.
>
> There is a Mason handler for Plack, so it almost seems like you could
> migrate your existing application to the Plack middleware stack while
> changing little in your Mason codebase.
>
> I see the role of mod_perl2 going forward as not something that
> applications are written on, but something that webserver middleware
> interfaces with.

Sigh. The big win with mod_perl2 is you get to interface with the rest
of the C modules for httpd, often via subrequests. At the ASF we've
been running mod_perl2 as our frontline mailserver for over 5y, and recently
I wrote an ASF-wide CMS with it that's gaining more and more users as
time goes on, in under 5K LOC. Haven't seen the need for app frameworks
because most of my code is mod_perl2 specific- it just won't work in any
other webserver.


js5 at sanger

Jun 16, 2011, 1:48 PM

Post #13 of 50 (2591 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

> ----- Original Message ----
>
>> From: Fred Moyer <fred [at] redhotpenguin>
>> To: Perrin Harkins <perrin [at] elem>
>> Cc: David E. Wheeler <david [at] kineticode>; mod_perl list
>><modperl [at] perl>
>> Sent: Thu, June 16, 2011 4:18:17 PM
>> Subject: Re: How do you use mod_perl for your web application?
>>
>> On Thu, Jun 16, 2011 at 1:13 PM, Perrin Harkins <perrin [at] elem> wrote:
>> > On Thu, Jun 16, 2011 at 4:07 PM, David E. Wheeler <david [at] kineticode>
>>wrote:
>> >> Whatever old man!
>> >
>> > I know, it's just a reality of working on applications that have been
>> > around for years. These tools are so reliable that they tend to stick
>> > around. If I started something new I would probably use Plack, since
>> > I've enjoyed using similar stuff in Python.
>>
>> Maybe I'm not completely grokking how people are starting new projects
>> using Plack, but it seems like the way to go is to not use Plack
>> itself to write the code, but to use one of the many web frameworks
>> (Mason2, Catalyst, Mojolicious) and then use Plack to specify what
>> webserver is used. Plack is just middleware.
>>
>> There is a Mason handler for Plack, so it almost seems like you could
>> migrate your existing application to the Plack middleware stack while
>> changing little in your Mason codebase.
>>
>> I see the role of mod_perl2 going forward as not something that
>> applications are written on, but something that webserver middleware
>> interfaces with.
>
> Sigh. The big win with mod_perl2 is you get to interface with the rest
> of the C modules for httpd, often via subrequests. At the ASF we've
> been running mod_perl2 as our frontline mailserver for over 5y, and recently
> I wrote an ASF-wide CMS with it that's gaining more and more users as
> time goes on, in under 5K LOC. Haven't seen the need for app frameworks
> because most of my code is mod_perl2 specific- it just won't work in any
> other webserver.

Agreed with this ....

I've been looking around at all these discussions the situation I'm in
is probably more complex than writing a single application I manage a
large infastructure for a large scientific institute with a small core
webteam - and upwards of 200 developers. So my approach to development
is probably considerably different to some of the projects here.

Currently we are migrating our website to a new "mod_perl" backed
system. It has many requirements so our framework (Developed in house)
has to be compact, easy, flexible, and easily extensible, but at the
same time give good diagnostics and stop bad code being submitted.

The system is a mixture of:

* mod_perl handlers to perform routing, mapping URL spaces to
perl modules; to handle temporary files; improve error reporting;
handle user identity etc; built in caching, optimisation of images/
js/css;
* mod_perl output filters to handle page decorating;
* javascript/css libraries tied into the system;
* integrated support for AJAX;
* a series of modules which handle Components (parts of pages which
can be included into static HTML/dynamically generated HTML);
and Actions (web pages, JSON/XML documents etc)
* an SVN based sandbox/dev/staging/production system to pubish
code, and check quality tool to force good HTML, Javascript;
* tools to monitor changes, etc
* ability to write applications as either CGI scripts, mod_perl
(using registry) [but both are frowned on], Ruby, PHP, Java,
HTML/JavaScript and
still have the benefits of the decoration and component system
(Ruby, PHP, Java etc just produce raw HTML containing component
instructions)

e.g.
http://www.sanger.ac.uk/resources/databases/tiffin/table.jsp?col=3

Is a JSP wrapped using Perl to look like the rest of the site...

In other projects I combine it with PHP to handle a lot of the
initial set up - parsing cookies for users etc and populating
variables that other applications can use;

It has a few more lines of code than yours - but the core of the
system is quite compact - it's just the fluff and added features
which make it longer... (plus getting the code through perl::critic!)





--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.


perrin at elem

Jun 16, 2011, 1:49 PM

Post #14 of 50 (2593 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Thu, Jun 16, 2011 at 4:18 PM, Fred Moyer <fred [at] redhotpenguin> wrote:
> Maybe I'm not completely grokking how people are starting new projects
> using Plack, but it seems like the way to go is to not use Plack
> itself to write the code, but to use one of the many web frameworks
> (Mason2, Catalyst, Mojolicious) and then use Plack to specify what
> webserver is used.  Plack is just middleware.

I'm just saying Plack looks fun. Maybe I miss the days of writing OO
mod_perl handlers. That was fun.

> There is a Mason handler for Plack, so it almost seems like you could
> migrate your existing application to the Plack middleware stack while
> changing little in your Mason codebase.

It's clear that you haven't seen this Mason codebase ;)

- Perrin


fred at redhotpenguin

Jun 16, 2011, 2:01 PM

Post #15 of 50 (2580 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Thu, Jun 16, 2011 at 1:30 PM, Joe Schaefer <joe_schaefer [at] yahoo> wrote:
> Sigh.  The big win with mod_perl2 is you get to interface with the rest
> of the C modules for httpd, often via subrequests.  At the ASF we've
> been running mod_perl2 as our frontline mailserver for over 5y

This is Apache2::Qpsmtpd right? Nice module.

> , and recently
> I wrote an ASF-wide CMS with it that's gaining more and more users as
> time goes on, in under 5K LOC.  Haven't seen the need for app frameworks
> because most of my code is mod_perl2 specific- it just won't work in any
> other webserver.

I guess I should rephrase what I said earlier; I don't see use of
mod_perl2 for web applications going away. I see the usage pattern
for Perl based web applications that use frameworks like Catalyst et
al becoming one where there is less usage of tightly coupled modules
such as Apache::Session and Apache::DBI.

The ability to interface with the httpd C modules is a big win that I
don't think a lot of users appreciate until their application gets big
enough to cause pain. Output compression is one area I've seen people
struggle with in Perl land, and write elaborate hacks into their
Catalyst application, when they could do the same thing in httpd.conf
with 'Include conf/deflate.conf' and just stuff all the mod_deflate
directives in that file.


fred at redhotpenguin

Jun 16, 2011, 2:09 PM

Post #16 of 50 (2584 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Thu, Jun 16, 2011 at 1:26 PM, Michael Peters <mpeters [at] plusthree> wrote:
> I'd like to see the performance of Starman vs
> mod_perl for normal applications (that don't need to do anything fancy with
> Apache). If it's anywhere close to mod_perl than I suspect lots of people
> would use it instead since it's much easier to setup and also much easier to
> package with your app since it's just a CPAN module. Would be nice to
> through FastCGI into that benchmark too.

I tweeted @miyagawa to see if he had this benchmark, and if memory
serves mod_perl2 was about 75% the speed of Starman in a hello world
benchmark with an unknown mod_perl2 configuration. I believe the
Starman cpan page has benchmarks vs FastCGI. My takeaway from those
benchmarks was that all of the webservers tested were essentially
equally fast since they were within 25-50% of the performance of each
other with a simple benchmark.

I'm not sold on packaging the webserver with the application though.
I've been moving towards using the webserver (in my case
httpd/mod_perl2) that is installed with the platform. One less thing
for me to worry about, in my case the Centos packagers take care of
that problem for me.


joe_schaefer at yahoo

Jun 16, 2011, 2:11 PM

Post #17 of 50 (2583 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

----- Original Message ----
> From: Fred Moyer <fred [at] redhotpenguin>
> To: Joe Schaefer <joe_schaefer [at] yahoo>
> Cc: mod_perl list <modperl [at] perl>
> Sent: Thu, June 16, 2011 5:01:49 PM
> Subject: Re: How do you use mod_perl for your web application?
>
> On Thu, Jun 16, 2011 at 1:30 PM, Joe Schaefer <joe_schaefer [at] yahoo> wrote:
> > Sigh. The big win with mod_perl2 is you get to interface with the rest
> > of the C modules for httpd, often via subrequests. At the ASF we've
> > been running mod_perl2 as our frontline mailserver for over 5y
>
> This is Apache2::Qpsmtpd right? Nice module.
>
> > , and recently
> > I wrote an ASF-wide CMS with it that's gaining more and more users as
> > time goes on, in under 5K LOC. Haven't seen the need for app frameworks
> > because most of my code is mod_perl2 specific- it just won't work in any
> > other webserver.
>
> I guess I should rephrase what I said earlier; I don't see use of
> mod_perl2 for web applications going away. I see the usage pattern
> for Perl based web applications that use frameworks like Catalyst et
> al becoming one where there is less usage of tightly coupled modules
> such as Apache::Session and Apache::DBI.


To me writing to a generic webserver API is not all that exciting.
Python people love it, but they've never had a proper exposure
to httpd in the first place. Yes it means you gain some portability,
but the downside is that you lose an awful lot of power that comes
from the existing open source module ecosystem for httpd. That's not
easily replaced, no matter what others may say.

> The ability to interface with the httpd C modules is a big win that I
> don't think a lot of users appreciate until their application gets big
> enough to cause pain. Output compression is one area I've seen people
> struggle with in Perl land, and write elaborate hacks into their
> Catalyst application, when they could do the same thing in httpd.conf
> with 'Include conf/deflate.conf' and just stuff all the mod_deflate
> directives in that file.
>

Yup. Content negotiation is another area where people come up with lotsa
sloppy hacks. Just run a subrequest with content-negotiation enabled and
be happy- it just works.


greg.george at orica

Jun 16, 2011, 5:59 PM

Post #18 of 50 (2581 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

Hi Fred,

I use mod_perl on a custom built framework written back in 2005
Performance of mod_perl has never been an issue, internal authenication
and network speed are more issues.
This runs on an intranet and services around 5000 users

Regards
Greg George



From: Fred Moyer <fred [at] redhotpenguin>
To: mod_perl list <modperl [at] perl>
Date: 16/06/2011 02:01 PM
Subject: How do you use mod_perl for your web application?



I'm interested in hearing about what application frameworks (Catalyst,
CGI::App, Mojolicious) are used here with mod_perl. Given the number
of emerging Perl based webservers on CPAN (in addition to Nginx,
lighty, etc), it seems like there are many more Perl web application
and webservers out there now than there were five years ago.

I'll start. I have a couple of Apache::Dispatch based applications I
wrote. I also work on an Apache::ASP large codebase, and a couple of
different Catalyst based systems. All are running on mod_perl 2.0.4
in production (the ops haven't upgraded to 2.0.5 yet).

If I were to migrate, I would probably try out something like
Mojolicious on Plack on mod_perl2. Performance of mod_perl2 has never
been an issue to date, but I have Perlbal doing connection handling as
a reverse proxy.

***********************************************************************************************************************************************************************************************
Please consider the environment before printing this e-mail.

This message is intended solely for the individual(s) and entity(s) addressed. It is confidential and may contain legally privileged information. The use, copying or distribution of this
message or any information it contains, by anyone other than the addressee, is prohibited. If you have received this message in error, please notify postmaster [at] orica The mailbox address
from which this message has been sent is for business mail only. Mail sent to it may be subject to security scanning and delivery on non-business messages sent to this address may not occur.
Thank you.
***********************************************************************************************************************************************************************************************


ceeshek at gmail

Jun 16, 2011, 6:58 PM

Post #19 of 50 (2581 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Thu, Jun 16, 2011 at 2:01 PM, Fred Moyer <fred [at] redhotpenguin> wrote:
> I'm interested in hearing about what application frameworks (Catalyst,
> CGI::App, Mojolicious) are used here with mod_perl.

We have a lot of code using CGI::App as well as a mix of in-house
custom frameworks (old legacy stuff that goes back 8 to 10 years).
All our apache/mod_perl servers sit behind three nginx boxes that do
caching, SSL offloading and content compression. 90% of what is
behind the proxies is running apache2/mod_perl2 (stock debian packages
for ease of maintenance), but there is still some apache1.3/mod_perl1
stuff hanging around too.

Some apps run through FastCGI, but the majority are mod_perl content
handlers or Registry scripts.

Cheers,

Cees


vv.lists at wanadoo

Jun 17, 2011, 7:07 AM

Post #20 of 50 (2566 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

Le jeudi 16 juin 2011 à 14:11 -0700, Joe Schaefer a écrit :

>
> To me writing to a generic webserver API is not all that exciting.
> Python people love it, but they've never had a proper exposure
> to httpd in the first place. Yes it means you gain some portability,
> but the downside is that you lose an awful lot of power that comes
> from the existing open source module ecosystem for httpd. That's not
> easily replaced, no matter what others may say.
>

Power indeed.

I wrote an application for case management that uses mod_perl's and
postgresql's specific features, via simple mod_perl handlers (LAMP to me
means Linux/Apache/Mod_Perl/Postgres).

The result is 15 milliseconds response times to generate an html page
with authentication and a hit to the database, on commodity hardware. My
application serves five to six users all day with a 1.6 Ghz processor
(200 dollar machine, 0 license) which peaks at 0.3% usage on busy
weekdays. That leaves me room for growth.

I don't suppose you can get the same numbers using frameworks?

--
Vincent Veyron
http://marica.fr/
Logiciel de gestion des sinistres et des contentieux pour le service juridique


dave.morgan at borealescapes

Jun 17, 2011, 8:26 AM

Post #21 of 50 (2567 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On 15/06/11 10:01 PM, Fred Moyer wrote:
> I'm interested in hearing about what application frameworks (Catalyst,
> CGI::App, Mojolicious) are used here with mod_perl.

We currently support an open source corporate CMS called Metapoint
http://www.metapointcms.com (derived from Metadot, derived from
the original Redhat CMS) which runs on mod_perl 1.3 and mod_perl 2.0.x
without change

It is fully dynamic. supporting MySQL, Postgres, SQLLite and Oracle.
It easily integrates with external systems including VOIP and and
source control applications. It is easily extendible so that any
code can be called through wrappers in perl modules.

We do nothing fancy with mod-perl, everything is done with
Apache::Registry. We use a fair number of Apache modules, including
mod_deflate as Fred mentioned earlier.

In order to leverage other programmers work we have spent a lot
of time looking at web frameworks and have a prototype running
under Catalyst. We will gradually port our code ( and clean up
a lot of crap) to Catalyst and I hope to be running on it
within a year.

Years ago we compiled apache, mod_perl and our other modules from
source but now we rely on the CentOS packages.

I really have no interest in perl webservers per se but I would like
to hear about other frameworks that may meet our needs.
Mojolicious appears to be a little underdeveloped for what we want
but I am willing to be corrected on this.

HTH
Dave

--
Dave Morgan
Operations Manager, BorealEscapes
http://www.borealescapes.ca
dave.morgan [at] borealescapes
403 288 8759


randolf at modperl

Jun 17, 2011, 4:28 PM

Post #22 of 50 (2568 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

> I'm interested in hearing about what application frameworks (Catalyst,
> CGI::App, Mojolicious) are used here with mod_perl. Given the number
> of emerging Perl based webservers on CPAN (in addition to Nginx,
> lighty, etc), it seems like there are many more Perl web application
> and webservers out there now than there were five years ago.
[sNip]

I'm using mod_perl2 for custom internet site development. Where
many people might use static HTML pages, or other programming
languages such as JSP (and others), I have a .pl (Perl source code)
file in its place (e.g., "index.pl" instead of "index.html").

On one of my web sites, I documented the steps that I use to
configure mod_perl2 for this (working sample source code included):

How to install and configure ModPerl 2
http://www.modperl.pl/how-to/

I am hosting hundreds of web sites that I developed with mod_perl2,
and although most of them are small (and static pages could have
worked just fine too), there are a few that have PostgreSQL database
backends (membership management, PayPal integration, full transaction
history browsing, private forums, etc.).

I did use DBIx::Class for a while, but eventually moved back to
straight DBI (and I just finished converting the last site a few days
ago). I think DBIx::Class is a wonderful system, but the problem I
had with it is that new versions were behaving unexpectedly in ways
that would cause my web sites to stop functioning (unless I enabled
various "backward compabitility" options), and then re-generating
classes eventually resulted in the custom classes having to be
updated as well. So, I moved back to DBI which is doing the job very
well for me, and which I find is also more flexible despite being a
little bit less convenient. I suspect that I wouldn't be running
into these issues with a framework system designed to work with
DBIx::Class. A DBIx developer in IRC explained to me once that
DBIx::Class also goes to great lengths to shut off connection caching
from the Apache::DBI module -- after switching back to DBI, the
resulting performance gain has me wondering if this is correct.

At one point I started to create a telnet server for a BBS-type
system (just for fun), but had to put it on the back-burner due to
time-constraints (customizing one of Apache 2 HTTPd's connection
handlers made this possible). Originally I started out using
mod_perl on Novell's NetWare OS, but Novell stopped pre-compiling
mod_perl2 so I switched to NetBSD (which I've been using ever since).

I also started writing a Wiki system from scratch, and plan to
continue with that eventually.

I don't use proxying or virtualization for my web servers (it's all
running bare-metal), just raw mod_perl2. I'm extremely pleased with
the high performance and solid reliability that I get from mod_perl2
on NetBSD servers, and intend to keep using it (and promoting it) for
years to come.

Randolf Richardson - randolf [at] inter-corporate
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com


perrin at elem

Jun 18, 2011, 7:30 AM

Post #23 of 50 (2564 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

On Fri, Jun 17, 2011 at 7:28 PM, Randolf Richardson <randolf [at] modperl> wrote:
> I suspect that I wouldn't be running
> into these issues with a framework system designed to work with
> DBIx::Class.

I don't think mod_perl should have more trouble cooperating with
DBIx::Class than other web environments. However, some of the people
who use DBIx::Class are vocal mod_perl haters, so they may not give
very good advice about how to set it up with mod_perl.

> A DBIx developer in IRC explained to me once that
> DBIx::Class also goes to great lengths to shut off connection caching
> from the Apache::DBI module -- after switching back to DBI, the
> resulting performance gain has me wondering if this is correct.

You'll always get better performance from straight DBI than from ORMs
like DBIx::Class or Rose::DB::Object. They just save you some
repetitive code for simple things.

Sounds like you're having a good time with your mod_perl stuff! Good to hear.

- Perrin


swartz at pobox

Jun 20, 2011, 10:17 AM

Post #24 of 50 (2573 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

We use Mason 1.x inside a custom web framework (which I've recently gotten permission to release open-source), under mod_perl/Apache 2. Working on a transition to Plack and Mason 2, but we've already integrated the superior stack traces and debug console from Plack middleware.

On Jun 15, 2011, at 9:01 PM, Fred Moyer wrote:

> I'm interested in hearing about what application frameworks (Catalyst,
> CGI::App, Mojolicious) are used here with mod_perl. Given the number
> of emerging Perl based webservers on CPAN (in addition to Nginx,
> lighty, etc), it seems like there are many more Perl web application
> and webservers out there now than there were five years ago.
>
> I'll start. I have a couple of Apache::Dispatch based applications I
> wrote. I also work on an Apache::ASP large codebase, and a couple of
> different Catalyst based systems. All are running on mod_perl 2.0.4
> in production (the ops haven't upgraded to 2.0.5 yet).
>
> If I were to migrate, I would probably try out something like
> Mojolicious on Plack on mod_perl2. Performance of mod_perl2 has never
> been an issue to date, but I have Perlbal doing connection handling as
> a reverse proxy.


randolf at modperl

Jun 20, 2011, 8:00 PM

Post #25 of 50 (2544 views)
Permalink
Re: How do you use mod_perl for your web application? [In reply to]

> On Fri, Jun 17, 2011 at 7:28 PM, Randolf Richardson <randolf [at] modperl> wrote:
> > I suspect that I wouldn't be running
> > into these issues with a framework system designed to work with
> > DBIx::Class.
>
> I don't think mod_perl should have more trouble cooperating with

Oh, please don't get me wrong -- I wasn't, for even a minute,
thinking that mod_perl was the culprit. When modules that add
functionality like Java's "try {} catch {}" paradigms work just fine
under mod_perl2, I have very little reason to doubt its capabilities.

> DBIx::Class than other web environments. However, some of the people
> who use DBIx::Class are vocal mod_perl haters, so they may not give
> very good advice about how to set it up with mod_perl.

I was hoping that this wasn't the case. It's really a shame when
someone hates a given technology. I have encountered some people
(not just in the DBIx::Class community) who have told me things like
"you should be using FastCGI instead," or "you're crazy to not run
mod_perl behind a proxy," etc., but I've already committed to using
mod_perl2 for so many things, and for so many years, that I just
write it off as "enthusiasm that's gone a bit too far." I hope that
the fact that I'm out there mentioning mod_perl2 from time-to-time,
and without trying to push it on others, does help a little bit.

One argument that I see come up a lot is "it hasn't been updated in
years" as if regular updates are an important measurement. I think
that a product that works well and is based on quality code certainly
has the potential to see fewer updates, but this does start some
interesting debates about what a lot of unknown people are thinking.

> > A DBIx developer in IRC explained to me once that
> > DBIx::Class also goes to great lengths to shut off connection caching
> > from the Apache::DBI module -- after switching back to DBI, the
> > resulting performance gain has me wondering if this is correct.
>
> You'll always get better performance from straight DBI than from ORMs
> like DBIx::Class or Rose::DB::Object. They just save you some
> repetitive code for simple things.

Yes, but I'm wondering if the caching being shut off in the ORM
might be a major contributing factor as well because the difference
is very noticeable (plus, for certain things I see a lot of extra SQL
queries in the logs when I'm using the ORM), although it also wasn't
performing poorly before switching to DBI (which I think is an
excellent testimonial for mod_perl2's performance).

> Sounds like you're having a good time with your mod_perl stuff! Good to hear.

It's wonderful. I just love how fast it is, and how well it
integrates so closely with Apache HTTPd. I've got a few friends
getting interested in it lately (and one of them has been doing a lot
of PHP development, but wants to find a way to go back to Perl, so I
helped him get it working).

Randolf Richardson - randolf [at] inter-corporate
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com

First page Previous page 1 2 Next page Last page  View All ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.