Re: reasons for modperl declines?

Mithun Bhattacharya <[email protected]> Thu, 8 Aug 2024 09:51:07 -0500
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAHTPV9L5NGXO6Ma-9Hqm1yT56M2V3Ab6cY-0LHub9VS5YQPOSw@mail.gmail.com>
--000000000000cf1586061f2d2835
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

So I am a mod_perl user for about 25 years now - pretty much I started with
perl and mod_perl together :)

Looking at the conversation I can see it is diverging into two parts - one
what to do with mod_perl and in general concerns with Perl.

Yes we have alternatives to mod_perl and you should definitely consider
Mojolicious if that suits your requirement but for that you need to
understand what mod_perl is offering.

mod_perl is allowing you to leverage apache as a foundation to handle HTTP
requests while your code does whatever business needs you have to fulfill.

To give an example - this is 1999 the internet has realized you could hack
open SQL Servers on the internet using scripts. Now I am managing a website
for a startup running a production server with 128MB RAM I think. Now
imagine all the script kiddies hammering away at your webserver looking for
SQL Server when you have only apache and mysql :( For the first three days
our server was pretty much dead - it would maybe honor a request every few
minutes. To solve it I add a PerlTransHandler and drop all requests for the
nasty endpoints - guess what we are back online with no impact to the
server any more.

Another example - we learnt you could write Apache configuration in perl -
it blew our mind. Rest assured most people dont know about this capability
so God forbid you are stuck trying to solve something in this you will not
find anything on Google. What we did was templatized the complete Apache
config. We have clean segregation of which Location and LocationMatch urls
need which library. We use a for loop to apply auth on everything and our
configs are very easy to understand for perl programmers and it is very
compact.

Company decided everyone needed SSL - most teams needed to plan it out. We
just included mod_ssl get the certificates and updated our config and we
were done in three days. Need to add custom header on every request - done
in two lines.

We need to use the application in a variety of server configs - no problem
we compute the number of child processes to spawn at run time.

Have a low latency service which needs to respond fast - changed the
logging to report the processing time as Aapche knows.

What we learnt you do mod_perl if you have a plan to leverage apache. If
you have a big fat application where receiving the request is a minor part
of the solution then we split it up and handle the request in mod_perl and
then hand over the hard work to a farm of servers. This way your mod_perl
instance scales based on the volume of requests and the workers scale based
on the amount of work to be done.

Now why is it not popular - primarily because it was so difficult to
setup initially. Most people did not have access to control apache config
and they did not know what could be done. The community did not help
encourage it either. I do not have root access on our servers -who cares. I
have my own relocatable apache, own relocatable perl running on a non
standard port and I dont bother any super user for help.

As for Perl that is a separate conversation and I wont want to diverge from
the subject of this email :)

On Wed, Aug 7, 2024 at 6:07=E2=80=AFPM Jeff Pang <[email protected]> wr=
ote:

> For me I run several apps on mod_perl, including a AI prediction app
> which costs heavy CPU/ram. These apps run for long time and behave just
> fine.
>
> Today it sounds very few people use mod_perl for development/deployment.
> I think the main reasons may include,
>
> 1. perl for web development is somewhat out of date
> 2. mp lacks threads support
> 3. lacks a modern framework (rails like)
>
> And others? what's your thought?
>
> Thanks
>
> --
> regards,
> Jeff Pang
>

--000000000000cf1586061f2d2835
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">So I am a mod_perl user for about 25 years now - pretty mu=
ch I started with perl and mod_perl together :)<div><br></div><div>Looking =
at the conversation I can see it is diverging into two parts - one what to =
do with mod_perl and in general concerns with Perl.</div><div><br></div><di=
v>Yes we have alternatives to mod_perl and you should definitely consider M=
ojolicious if that suits your requirement but for that you need to understa=
nd what mod_perl is offering.</div><div><br></div><div>mod_perl is allowing=
 you to leverage apache as a foundation to handle HTTP requests while your =
code does whatever business needs you have to fulfill.</div><div><br></div>=
<div>To give an example - this is 1999 the internet has realized you could =
hack open SQL Servers on the internet using scripts. Now I am managing a we=
bsite for a startup running a production server with 128MB RAM I think. Now=
 imagine all the script kiddies hammering away at your webserver looking fo=
r SQL Server when you have only apache and mysql :( For the first three day=
s our server was pretty much dead - it would maybe honor a request every fe=
w minutes. To solve it I add a=C2=A0PerlTransHandler and drop all requests =
for the nasty endpoints - guess what we are back online with no impact to t=
he server any more.</div><div><br></div><div>Another example - we learnt yo=
u could write Apache configuration in perl - it blew our mind. Rest assured=
 most people dont=C2=A0know about this capability so God forbid you are stu=
ck trying to solve something in this you will not find anything on Google. =
What we did was templatized the complete Apache config. We have clean segre=
gation of which Location and LocationMatch urls need which library. We use =
a for loop to apply auth on everything and our configs are very easy to und=
erstand for perl programmers and it is very compact.</div><div><br></div><d=
iv>Company decided everyone needed SSL - most teams needed to plan it out. =
We just included mod_ssl get the certificates and updated our config and we=
 were done in three days. Need to add custom header on every request - done=
 in two lines.</div><div><br></div><div>We need to use the application in a=
 variety of server configs - no problem we compute the number of child proc=
esses to spawn at run time.</div><div><br></div><div>Have a low latency ser=
vice which needs to respond fast - changed the logging to report the proces=
sing time as Aapche=C2=A0knows.</div><div><br></div><div>What we learnt you=
 do mod_perl if you have a plan to leverage apache. If you have a big fat a=
pplication where receiving the request is a minor part of the solution then=
 we split it up and handle the request in mod_perl and then hand over the h=
ard work to a farm of servers. This way your mod_perl instance scales based=
 on the volume of requests and the workers scale based on the amount of wor=
k to be done.</div><div><br></div><div>Now why is it not popular - primaril=
y because it was so difficult to setup=C2=A0initially. Most people did not =
have access to control apache config and they did not know what could be do=
ne. The community did not help encourage it either. I do not have root acce=
ss on our servers -who cares. I have my own relocatable apache, own relocat=
able perl running on a non standard port and I dont=C2=A0bother any super u=
ser for help.</div><div><br></div><div>As for Perl that is a separate conve=
rsation and I wont=C2=A0want to diverge from the subject of this email :)</=
div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_at=
tr">On Wed, Aug 7, 2024 at 6:07=E2=80=AFPM Jeff Pang &lt;<a href=3D"mailto:=
[email protected]">[email protected]</a>&gt; wrote:<br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1=
px solid rgb(204,204,204);padding-left:1ex">For me I run several apps on mo=
d_perl, including a AI prediction app <br>
which costs heavy CPU/ram. These apps run for long time and behave just <br=
>
fine.<br>
<br>
Today it sounds very few people use mod_perl for development/deployment. <b=
r>
I think the main reasons may include,<br>
<br>
1. perl for web development is somewhat out of date<br>
2. mp lacks threads support<br>
3. lacks a modern framework (rails like)<br>
<br>
And others? what&#39;s your thought?<br>
<br>
Thanks<br>
<br>
-- <br>
regards,<br>
Jeff Pang<br>
</blockquote></div>

--000000000000cf1586061f2d2835--