modperl vs fastcgi

2021-02-23 Thread Wesley Peng

Do you anybody have a comparison for modperl vs fastcgi?
For both the performance and convenience of development/deployment.

Thank you.


Re: Moving ExecCGI to mod_perl - performance and custom 'modules' [EXT]

2021-02-07 Thread Wesley Peng
what's DBI sharing? do you mean Apache::DBI?
Does perl has Java similar DB connection pool?

Thanks.

On Mon, Feb 8, 2021, at 4:21 AM, James Smith wrote:
> DBI sharing doesn't really gain you much - and can actually lead you into a 
> whole world of pain. It isn't actually worth turning it on at all.
> 
> We use dedicated DB caching in the cases where we benefit from it as and when 
> you need it (low level caching database)...
> 
> Although milage may vary - our problem was DB servers with 30 or 40 databases 
> on them being connected from a number of approximately 50-100 child apaches, 
> meant we ended up blowing up the connections to the database server really 
> quickly...
> 
> 
> -Original Message-
> From: Vincent Veyron  
> Sent: 07 February 2021 19:06
> To: Steven Haigh 
> Cc: James Smith ; modperl@perl.apache.org
> Subject: Re: Moving ExecCGI to mod_perl - performance and custom 'modules' 
> [EXT]
> 
> On Sun, 07 Feb 2021 23:58:17 +1100
> Steven Haigh  wrote:
> > 
> > I haven't gotten into the preload or DBI sharing yet - as that'll end 
> > up needing a bit of a rewrite of code to take advantage of. I'd be 
> > open to suggestions here from those who have done it in the past to 
> > save me going down some dead ends :D
> 
> I use mod_perl handlers, so not sure how it mixes with PerlRegistry, but you 
> probably want to have a look at connect_cached
> 
> 
> -- 
> 
> Bien à vous, Vincent Veyron 
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__compta.libremen.com=DwIFAw=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo=oH2yp0ge1ecj4oDX0XM7vQ=C0OcuGbNbfxaSa8ASgV3uFXzejn7MpjIUH1aP1RbiyU=GPr8VuKQ3rZCzCPwggyAHdCOojK6ZThmShKk0Jb3maI=
> Logiciel libre de comptabilité générale en partie double
> 
> 
> 
> --
> The Wellcome 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.
> 


Re: Moving ExecCGI to mod_perl - performance and custom'modules'[EXT]

2021-02-07 Thread Wesley Peng
If you can take time to rewrite all codes with modPerl handlers, that will 
improve performance a lot.

On Sun, Feb 7, 2021, at 9:14 PM, Steven Haigh wrote:
> In fact, I just realised that 'ab' test is rather restrictive So here's a 
> bit more of an extended test:
> 
> # ab -k -n 1000 -c 32
> 
> Apache + ExecCGI:
> Requests per second:14.26 [#/sec] (mean)
> Time per request:   2244.181 [ms] (mean)
> Time per request:   70.131 [ms] (mean, across all concurrent requests)
> 
> Apache + mod_perl (ModPerl::PerlRegistry): 
> Requests per second: 132.14 [#/sec] (mean)
> Time per request:   242.175 [ms] (mean)
> Time per request:   7.568 [ms] (mean, across all concurrent requests)
> 
> Interestingly, without Keepalives, the story is much the same:
> 
> # ab -n 1000 -c 32
> 
> Apache + ExecCGI:
> Requests per second:14.15 [#/sec] (mean)
> Time per request:   2260.875 [ms] (mean)
> Time per request:   70.652 [ms] (mean, across all concurrent requests)
> 
> Apache + mod_perl (ModPerl::PerlRegistry): 
> Requests per second:154.48 [#/sec] (mean)
> Time per request:   207.140 [ms] (mean)
> Time per request:   6.473 [ms] (mean, across all concurrent requests)
> 
> Running some benchmarks across various parts of my site made me realise I 
> also had some RewriteRules in the apache config that still had H=cgi-script - 
> changed those to H=perl-script and saw similar improvements:
> 
> ExecCGI - Requests per second:11.84 [#/sec] (mean)
> mod_perl - Requests per second:130.97 [#/sec] (mean)
> 
> That's quite some gains for a days work.
> 
> --
> Steven Haigh  net...@crc.id.au  https://www.crc.id.au
> 
> On Sun, Feb 7, 2021 at 23:58, Steven Haigh  wrote:
>> Interestingly, I did get things working with ModPerl::PerlRegistry.
>> 
>> What I couldn't find *anywhere* is that the data I was loading in Template 
>> Toolkit was included in the file in the __DATA__ area - which causes 
>> mod_perl to fall over!
>> 
>> The only way I managed to find this was the following error in the *system* 
>> /var/log/httpd/error_log (didn't show up in the vhost error_log!):
>> readline() on unopened filehandle DATA at 
>> /usr/lib64/perl5/vendor_perl/Template/Provider.pm line 638.
>> 
>> Took me a LONG time to find a vague post that reading in lines from  
>> kills mod_perl. Not sure why - but I stripped all the templates out and put 
>> them in a file instead and re-wrote that bit of code, and things started 
>> working.
>> 
>> I had to fix a few lib path issues, but after getting my head around that, 
>> most things seem to work as before - however I don't notice much of an 
>> improvement in execution times, I do see this improvement using 'ab -n 100 
>> -c32':
>> 
>> Apache + ExecCGI: Requests per second:13.50 [#/sec] (mean)
>> Apache + mod_perl: Requests per second:59.81 [#/sec] (mean)
>> 
>> This is obviously a good thing.
>> 
>> I haven't gotten into the preload or DBI sharing yet - as that'll end up 
>> needing a bit of a rewrite of code to take advantage of. I'd be open to 
>> suggestions here from those who have done it in the past to save me going 
>> down some dead ends :D
>> 
>> --
>> Steven Haigh  net...@crc.id.au  https://www.crc.id.au
>> 
>> On Sun, Feb 7, 2021 at 12:49, James Smith  wrote:
>>> As welsey said – try Registry, that was the standard way of using mod_perl 
>>> to cache perl in the server  – but your problem might be due to the note in 
>>> PerlRun…
>>> 
>>> https://perl.apache.org/docs/2.0/api/ModPerl/PerlRun.html#Description
>>> META: document that for now we don't chdir() into the script's dir, because 
>>> it affects the whole process under threads. `ModPerl::PerlRunPrefork 
>>> ` should 
>>> be used by those who run only under prefork MPM.
>>> {tbh most people don’t use mod perl under threads anyway as there isn’t 
>>> really a gain from using them}
>>> 
>>> It suggests you use ModPerl/PerlRunPrefork – as this does an additional 
>>> step to cd to the script directory – which might be your issue….

>>>  

>>> *From:* Steven Haigh  
>>> *Sent:* 07 February 2021 01:00
>>> *To:* modperl@perl.apache.org
>>> *Subject:* Moving ExecCGI to mod_perl - performance and custom 'modules' 
>>> [EXT]

>>>  

>>> Hi all,

>>>  

>>> So for many years I've been slack and writing perl scripts to do various 
>>> things - but never needed more than the normal apache +ExecCGI and Template 
>>> Toolkit.

>>>  

>>> One of my sites has become a bit more popular, so I'd like to spend a bit 
>>> of time on performance. Currently, I'm seeing ~300-400ms of what I believe 
>>> to be execution time of the script loading, running, and then blatting its 
>>> output to STDOUT and the browser can go do its thing. 

>>>  

>>> I believe most of the delay would be to do with loading perl, its modules 
>>> etc etc

>>>  

>>> I know that the current trend would be to re-write the entire site in a 
>>> more modern, 

Re: Moving ExecCGI to mod_perl - performance and custom 'modules'

2021-02-06 Thread Wesley Peng
Is the url in your signature the website? It looks a beautiful UI design.
And you can try this method:
https://metacpan.org/pod/ModPerl::Registry

Thanks.

On Sun, Feb 7, 2021, at 8:59 AM, Steven Haigh wrote:
> Hi all,
> 
> So for many years I've been slack and writing perl scripts to do various 
> things - but never needed more than the normal apache +ExecCGI and Template 
> Toolkit.
> 
> One of my sites has become a bit more popular, so I'd like to spend a bit of 
> time on performance. Currently, I'm seeing ~300-400ms of what I believe to be 
> execution time of the script loading, running, and then blatting its output 
> to STDOUT and the browser can go do its thing. 
> 
> I believe most of the delay would be to do with loading perl, its modules etc 
> etc
> 
> I know that the current trend would be to re-write the entire site in a more 
> modern, daemon based solution - and I started down the Mojolicious path - but 
> the amount of re-writing to save 1/3rd of a second seems to be excessive
> 
> Would I be correct in thinking that mod_perl would help in this case?
> 
> I did try a basic test, but I have a 'use functions' in all my scripts that 
> loads a .pm with some global vars and a lot of common subs - and for whatever 
> reason (can't find anything on Google as to why), none of the subs are 
> recognised in the main script when loaded via ModPerl::PerlRun.
> 
> So throwing it out to the list - am I on the right track? wasting my time? or 
> just a simple mistake?
> 
> --
> Steven Haigh  net...@crc.id.au  https://www.crc.id.au


Re: perl's pulsar client

2021-01-26 Thread Wesley Peng
I am looking for a native client library since there is the functions more than 
publish/consume I want.

Thanks.

On Wed, Jan 27, 2021, at 9:19 AM, Mithun Bhattacharya wrote:
> This seems to demonstrate Pulsar with mojo.
> 
> https://www.perlmonks.org/?node_id=11123636
> 
> On Tue, Jan 26, 2021, 7:09 PM Wesley Peng  wrote:
>> __
>> I saw apache pulsar has many clients in other languages such as python's:
>> http://pulsar.apache.org/docs/en/client-libraries-python/
>> 
>> But it lacks a perl client library.
>> Would anyone have the plan to make one?
>> 
>> Thanks.


perl's pulsar client

2021-01-26 Thread Wesley Peng
I saw apache pulsar has many clients in other languages such as python's:
http://pulsar.apache.org/docs/en/client-libraries-python/

But it lacks a perl client library.
Would anyone have the plan to make one?

Thanks.

Re: cache a object in modperl

2020-09-13 Thread Wesley Peng




Mithun Bhattacharya wrote:
Does IANA have an easy way of determining whether there is an update 
since a certain date ? I was thinking it might make sense to just run a 
scheduled job to monitor for update and then restart your service or 
refresh your local cache depending upon how you solve it.


Yes I agree with this.
I may monitor IANA's database via their version changes, and run a 
crontab to restart my apache server during the non-active user time 
(i.e, 3:00 AM).


Or do you have better solution?
Thanks.


Re: cache a object in modperl

2020-09-13 Thread Wesley Peng

Hello

Mithun Bhattacharya wrote:
How frequently do you wish to refresh the cache ? if you do in startup 
then your cache refresh is tied to the service restart which might not 
be ideal or feasible.


I saw recent days IANA has updated their database on date of:

2020.09.09
2020.09.13

So I assume they will update the DB file in few days.

Regards.


Re: cache a object in modperl

2020-09-13 Thread Wesley Peng

That's great. Thank you Adam.

Adam Prime wrote:
If the database doesn't change very often, and you don't mind only 
getting updates to your database when you restart apache, and you're 
using prefork mod_perl, then you could use a startup.pl to load your 
database before apache forks, and get a shared copy globally in all your 
apache children.


https://perl.apache.org/docs/1.0/guide/config.html#The_Startup_File

This thread from 13 years ago seems to have a clear-ish example of how 
to use startup.pl to do what i'm talking about.


If you need it to update more frequently than when you restart apache, 
you could potentially use a PerlChildInitHandler to load the data when 
apache creates children.  This will use more memory, as each child will 
have it's own copy, and can also result in situation where children can 
have different versions of the database loaded and be serving requests 
at the same time.  If you want to go this way you might want to also add 
a MaxRequestsPerChild directive to your apache config to make sure that 
you're children die and get refreshed on the regular, if you don't 
already have one.


Adam


On 9/13/2020 10:51 PM, Wesley Peng wrote:

Hello

I am not so familiar with modperl.

For work requirement, I need to access IANA TLD database.

So I wrote this perl module:
https://metacpan.org/pod/Net::IANA::TLD

But, for each new() in the module, the database file will be 
downloaded from IANA's website.


I know this is pretty Inefficient.

My question is, can I cache the new'ed object by modperl?

If so, how to do?

Thanks.


cache a object in modperl

2020-09-13 Thread Wesley Peng

Hello

I am not so familiar with modperl.

For work requirement, I need to access IANA TLD database.

So I wrote this perl module:
https://metacpan.org/pod/Net::IANA::TLD

But, for each new() in the module, the database file will be downloaded 
from IANA's website.


I know this is pretty Inefficient.

My question is, can I cache the new'ed object by modperl?

If so, how to do?

Thanks.


Re: Question about deployment of math computing [EXT]

2020-08-05 Thread Wesley Peng

James,

James Smith wrote:

The services which use apache/mod_perl work reliably and return data for these 
- the dancer/starman sometimes fail/hang as there are no backends to serve the 
requests or those backends timeout requests to the nginx/proxy (but still 
continue using resources). The team running the backends fail to notice this - 
because there is no easy to see reporting etc on these boxes.


Thanks for letting me know this.
We have been using starman for restful api service, they are light 
weight http request/response.
But for (machine learning)/(deep learning) serving stuff, we may 
consider to use modperl for more stability.


regards.


Re: Question about deployment of math computing

2020-08-04 Thread Wesley Peng
Thank you David. That makes thing clear. I have made mistake to think 
starman was event driven, who is really preforked.


I think any preforked server could serve our depolyment better.

Regards.


dc...@prosentient.com.au wrote:

Hi Wesley,

I don't know all the ins and outs of Starman. I do know that Starman is a 
preforking web server, which uses Net::Server::PreFork under the hood. You 
configure the number of preforked workers to correspond with your CPU and 
memory limits for that server.

As per the Starman documentation 
(https://metacpan.org/pod/release/MIYAGAWA/Starman-0.4015/lib/Starman.pm), you 
should put a frontend server/reverse proxy (like Nginx) in front of Starman. 
Nginx is often recommended because it's event-driven. The idea being that a few 
Nginx workers (rather than those thousands of Apache processes you mentioned) 
can handle a very large volume of HTTP requests, and then Nginx intelligently 
passes those requests to the backend server (e.g. Starman).

Of course, no matter what, you can still get timeouts if the backend server 
isn't responding fast enough, but typically the backend process is going as 
fast as it can. At that point, your only option is to scale up. You can do that 
by using Nginx as a load balancer and horizontally scaling your Starman 
instances, or you can put more CPUs on that machine, and configure Starman to 
prefork more workers.

Let's say you use Mod_Perl/Apache instead of Starman/Nginx. At the end of the 
day, you still need to think about how many concurrent requests you're needing 
to serve and how many CPUs you have available. If you've configured Apache to 
have too many processes, you're going to overwhelm your server with tasks. You 
need to use reasonable constraints.

But remember that this isn't specific to Perl/Starman/Nginx/Apache/mod_perl. 
These are concepts that translate to any stack regardless of programming 
language and web server. (Of course, languages like Node.js and Golang have 
some very cool features for dealing with blocking I/O, so that you can make the 
most of the resources you have. That being said, Perl has Mojo/Mojolicious, 
which claims to do non-blocking I/O in Perl. I have yet to try it though. I'm 
skeptical, but could give it a try.)

At the end of the day, it depends on the workload that you're trying to cater 
to.

David Cook

-Original Message-
From: Wesley Peng 
Sent: Wednesday, 5 August 2020 1:31 PM
To: dc...@prosentient.com.au; modperl@perl.apache.org
Subject: Re: Question about deployment of math computing

Hi

dc...@prosentient.com.au wrote:

That's interesting. After re-reading your earlier email, I think that I 
misunderstood what you were saying.

Since this is a mod_perl listserv, I imagine that the advice will always be to 
use mod_perl rather than starman?

Personally, I'd say either option would be fine. In my experience, the key 
advantage of mod_perl or starman (say over CGI) is that you can pre-load 
libraries into memory at web server startup time, and that processes are 
persistent (although they do have limited lifetimes of course).

You could use a framework like Catalyst or Mojolicious (note Dancer is another 
framework, but I haven't worked with it) which can support different web 
servers, and then try the different options to see what suits you best.

One thing to note would be that usually people put a reverse proxy in front of 
starman like Apache or Nginx (partially for serving static assets but other 
reasons as well). Your stack could be less complicated if you just went the 
mod_perl/Apache route.

That said, what OS are you planning to use? It's worth checking if mod_perl is 
easily available in your target OS's package repositories. I think Red Hat 
dropped mod_perl starting with RHEL 8, although EPEL 8 now has mod_perl in it. 
Something to think about.


We use ubuntu 16.04 and 18.04.

We do use dancer/starman in product env, but the service only handle light 
weight API requests, for example, a restful api for data validation.

While our math computing is heavy weight service, each request will take a lot 
time to finish, so I think should it be deployed in dancer?

Since the webserver behind dancer is starman by default, starman is event 
driven, it uses very few processes ,and the process can't scale up/down 
automatically.

We deploy starman with 5 processes by default. when 5 requests coming, all 5 
starman processes are so busy to compute them, so the next request will be 
blocked. is it?

But apache mp is working as prefork way, generally it can have as many as 
thousands of processes if the resource is permitted. And the process management 
can scale up/down the children automatically.

So my real question is, for a CPU consuming service, the event driven service 
like starman, has no advantage than preforked service like Apache.

Am I right?

Thanks.



Re: Question about deployment of math computing

2020-08-04 Thread Wesley Peng

Hi

dc...@prosentient.com.au wrote:

That's interesting. After re-reading your earlier email, I think that I 
misunderstood what you were saying.

Since this is a mod_perl listserv, I imagine that the advice will always be to 
use mod_perl rather than starman?

Personally, I'd say either option would be fine. In my experience, the key 
advantage of mod_perl or starman (say over CGI) is that you can pre-load 
libraries into memory at web server startup time, and that processes are 
persistent (although they do have limited lifetimes of course).

You could use a framework like Catalyst or Mojolicious (note Dancer is another 
framework, but I haven't worked with it) which can support different web 
servers, and then try the different options to see what suits you best.

One thing to note would be that usually people put a reverse proxy in front of 
starman like Apache or Nginx (partially for serving static assets but other 
reasons as well). Your stack could be less complicated if you just went the 
mod_perl/Apache route.

That said, what OS are you planning to use? It's worth checking if mod_perl is 
easily available in your target OS's package repositories. I think Red Hat 
dropped mod_perl starting with RHEL 8, although EPEL 8 now has mod_perl in it. 
Something to think about.


We use ubuntu 16.04 and 18.04.

We do use dancer/starman in product env, but the service only handle 
light weight API requests, for example, a restful api for data validation.


While our math computing is heavy weight service, each request will take 
a lot time to finish, so I think should it be deployed in dancer?


Since the webserver behind dancer is starman by default, starman is 
event driven, it uses very few processes ,and the process can't scale 
up/down automatically.


We deploy starman with 5 processes by default. when 5 requests coming, 
all 5 starman processes are so busy to compute them, so the next request 
will be blocked. is it?


But apache mp is working as prefork way, generally it can have as many 
as thousands of processes if the resource is permitted. And the process 
management can scale up/down the children automatically.


So my real question is, for a CPU consuming service, the event driven 
service like starman, has no advantage than preforked service like Apache.


Am I right?

Thanks.


Re: Question about deployment of math computing

2020-08-04 Thread Wesley Peng

Hi

dc...@prosentient.com.au wrote:

If your app isn't human-facing, then I don't see why a little delay would be a 
problem?


Our app is not human facing. The application by other department will 
request the result from our app via HTTP.


The company has huge big-data stack deployed, such as 
Hadoop/Flink/Storm/Spark etc, all these solutions have been existing 
there. The data traffic each day is as huge as xx PB.


But, those stacks have complicated privileges control layer, they are 
most time running as backend service, for example, offline analysis, 
feature engineering, and some real time streaming.


We train the modes in backend, and use the stacks mentioned above.

But, once the mode finished training, they will be pushed to online as 
prediction service and serve as HTTP API, b/c third party apps will only 
like to request the interface via HTTP way.


Thanks.


Re: Question about deployment of math computing

2020-08-04 Thread Wesley Peng

Hi

Mithun Bhattacharya wrote:

Do you really need a webserver which is providing a blocking service ?


yes, this is a prediction server, which would be deployed in PROD 
environment, the client application would request the prediction server 
for results as scores. You can think it as online recommendation systems.


regards.


Question about deployment of math computing

2020-08-04 Thread Wesley Peng

Hi

We do math programming (so called machine learning today) in webserver.
The response would be slow, generally it will take 100ms~500ms to finish 
a request.
For this use case, shall we deploy the code within preforked modperl ,or 
event-driven server like dancer/starman?
(we don't use DB like mysql or other slow IO storage server, all 
arguments were passed to webserver by HTTP POST from client).


Thank you.


Re: suggestions for perl as web development language [EXT]

2020-08-04 Thread Wesley Peng




jbiskofski wrote:

Excelent, stable, FAST, production ready HTTP server: Starman


yes starman is good. we use it for rest-api service, the app code is 
dancer, whose backend server is starman.


if we need more concurrent handlers, a simple front-proxy like nginx 
would be deployed.


regards.


Re: suggestions for perl as web development language [EXT]

2020-08-04 Thread Wesley Peng

Hi

Mark Blackman wrote:

mod_perl’s relative efficiency can be achieved by other well-known means.


for example?

thank you.


Re: suggestions for perl as web development language [EXT]

2020-08-04 Thread Wesley Peng




Joseph He wrote:
My company uses Perl for web development. It handles real time payment 
transactions without any problem. Good software is made by the people 
not by the language.


Maybe I am weak on this point, but how perl handle types more strictly?
for example,

123 + '456'

this is permitted in perl, and this is dangerous. It is not possible in 
other strong types language.


Thanks.


suggestions for perl as web development language

2020-08-03 Thread Wesley Peng

greetings,

My team use all of perl, ruby, python for scripting stuff.
perl is stronger for system admin tasks, and data analysis etc.
But for web development, it seems to be not as popular as others.
It has less selective frameworks, and even we can't get the right people 
to do the webdev job with perl.
Do you think in today we will give up perl/modperl as web development 
language, and choose the alternatives instead?


Thanks & Regards



Re: how to run regex calculation

2020-01-09 Thread Wesley Peng

what does (??{$1*$2}) means?

Thanks.

on 2020/1/9 12:49, Joseph He wrote:

I think $str =~ /(\d+)\s(\d+)\s(??{$1*$2})/   should do it
My Perl version is  v5.26.1



Re: how to run regex calculation

2020-01-09 Thread Wesley Peng

Hallo

on 2020/1/9 16:35, demerphq wrote:

$str=~/(\d+)\s(\d+)\s(\1*\2)/

$1 refers to the capture buffers from the last completed match, \1
inside of the pattern part of a regex refers to the capture buffer of
the currently matching regex.


This doesn't work too.

perl -Mstrict -le 'my $str = "2 3 6"; print "true" if 
$str=~/(\d+)\s(\d+)\s(\1*\2)/'


nothing printed.


Regards.


Re: how to improve throughput for long time running sessions

2020-01-08 Thread Wesley Peng

Any more details?

regards

on 2020/1/9 14:11, Mithun Bhattacharya wrote:
You need to split the request handler and the request processor. Receive 
the request in mod_perl and then queue it into a separate application 
which does the actual heavy lifting.


Re: what's difference between HTTP_HOST and SERVER_NAME

2020-01-08 Thread Wesley Peng

Hi

on 2020/1/9 14:14, Mithun Bhattacharya wrote:

This is for PHP but it still applies.

https://www.geeksforgeeks.org/what-is-the-difference-between-http_host-and-server_name-in-php/


This is good reference. Thanks.


Re: AW: Question on a rewrite rule

2020-01-08 Thread Wesley Peng

Hi

on 2020/1/9 14:27, Andreas Mock wrote:

You have to see in which virtualhost section this rule was put into.
I'm pretty sure it's only in the http section.


You are so right. they are put in plain HTTP section.
So requets were coming with HTTP, they will be rewriten to HTTPS, which 
is in another section, which doesn't have that rewrite config.


Regards.


gRPC implement question

2020-01-08 Thread Wesley Peng

Hello

is there a full gRPC implementation in perl rather than this protocal 
buffer library?


https://metacpan.org/pod/Google::ProtocolBuffers::Dynamic

Thanks.


DB connection pool management

2020-01-08 Thread Wesley Peng

Hallo

Is there DB connection pool management library like JDBC for mod_perl?
I know there is Apache::DBI, but that seems not the one who have pool 
capability.


Thanks & happy new year.

Regards.


how to improve throughput for long time running sessions

2020-01-08 Thread Wesley Peng

Hallo

We are running LR[1] and GBDT[2] and similar algorithm in MP2 handles.
For each request, there were about 1000 features as arguments passed 
into the handles, via HTTP POST.
The request will wait for about 100ms to get responses, coz the 
calculation is not cheap.

My question is, how can we improve the throughput by architecture
optimization?
Yes we know there are TFS[3] and RT[4] for prediction frameworks, but we 
didn't use Tensorflow yet.



[1] https://en.wikipedia.org/wiki/LR_parser
[2] https://en.wikipedia.org/wiki/Gradient_boosting
[3] https://www.tensorflow.org/tfx/guide/serving
[4] https://developer.nvidia.com/tensorrt


Thanks.


Question on a rewrite rule

2020-01-08 Thread Wesley Peng

Hello

After installation of Letsencrypt free SSL, it adds a rule into apache's 
config file:


RewriteCond %{SERVER_NAME} =sample.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]


I know it means when SERVER_NAME is sample.com, it rewrites the plain 
HTTP request to HTTPS request.


My question is, is this not a dead loop?

For HTTPS request, the SERVER_NAME is also matched, so it rewrites again 
and again...


My guess it's a dead rewrite loop, but it actually works fine.

I am not sure about this, please help.

Thanks.


what's difference between HTTP_HOST and SERVER_NAME

2020-01-08 Thread Wesley Peng

Hello

For HTTP headers, what's difference between HTTP_HOST and SERVER_NAME?

I was long time confused about them.

Thanks.


how to run regex calculation

2020-01-08 Thread Wesley Peng

Hello

Give the case I have a string,

$str = "2 3 6";

I want to match with:

true if $str =~ /(\d+)\s(\d+)\s($1*$2)/;

that's to say, the thrid column would be (firstCol * SecondCol).

How to write regex for this?

Thank you.


Re: [ANNOUNCE] mod_perl-2.0.11

2019-10-12 Thread Wesley Peng

Edward J. Sabol wrote:

Except we're actually upgrading from Apache 2.2.34 to 2.4.41, and all the
tests pass with 2.2.34 (I just ran them again and verified this), so this
is kind of a new issue for us, but I'm happy to trust in the experiences of
other folks who have running using mod_perl with Apache 2.4.x.


We also run mp2 with httpd 2.2. should we upgrade to httpd 2.4 for 
better performance?


regards.


Re: [OT] [RELEASE CANDIDATE] mod_perl-2.0.11 RC2

2019-09-26 Thread Wesley Peng




on 2019/9/26 18:32, André Warnier (tomcat) wrote:
Not being able myself to contribute really to this process, I did not 
comment on the previous emails here.
But as a grateful user of mod_perl for many years, I just want to 
express my immense gratitude to Steve and all other people who 
contribute to keep this project and product alive and well, and let them 
know that their efforts are not in vain.
The activity of my little software and services company in Germany, 
Spain and worldwide, depends vitally on Apache httpd, perl and mod_perl. 
And I expect that I am not alone in such a situation.


We also use modperl for regular commercial applications.
Thanks for everyone's contribution.

regards.