You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Kulasekaran, Raja" <Ra...@netapp.com> on 2009/11/23 14:57:50 UTC

FW: mod-perl child process

Hi 

The below method used to kill the child process after the successful
execution of web request. 

$r->child_terminate();

Can anyone suggest me where and how do I call this method in the
httpd.conf file. 

-Raja 
 


-----Original Message-----
From: Kulasekaran, Raja 
Sent: Thursday, October 29, 2009 7:36 PM
To: Perrin Harkins
Cc: mod_perl list
Subject: RE: mod-perl child process

Hi,

The below method used to kill the child process after the successful
execution of web request. 

$r->child_terminate();

How do I get the status that particular child process has been killed ?.
Any suggestion on this ?

Raja 

-----Original Message-----
From: Kulasekaran, Raja 
Sent: Wednesday, October 28, 2009 10:02 AM
To: Perrin Harkins
Cc: mod_perl list
Subject: RE: mod-perl child process


So, How to I control this ?. Is it possible to reuse the existing
connection ?. 

Raja 

-----Original Message-----
From: Perrin Harkins [mailto:pharkins@gmail.com] 
Sent: Tuesday, October 27, 2009 11:47 PM
To: Kulasekaran, Raja
Cc: mod_perl list
Subject: Re: mod-perl child process

On Tue, Oct 27, 2009 at 8:33 AM, Kulasekaran, Raja
<Ra...@netapp.com> wrote:
> I have configured the mod_perl with oracle persistent connection
through Apache::DBI module. On every web page request It creates a
process
> something like below and It never be killed automatically when the
request has completed.

That is the intended behavior.  You should get one Oracle connection
for each apache child process.  They will stay connected for the life
of the process.

- Perrin

Re: mod-perl child process

Posted by Carl Johnstone <mo...@fadetoblack.me.uk>.
Kulasekaran, Raja wrote:
> The below method used to kill the child process after the successful
> execution of web request.
>
> $r->child_terminate();
>
> Can anyone suggest me where and how do I call this method in the
> httpd.conf file.

You don't, you put it in your application code.

However you should not be calling this under normal circumstances as all 
it'll do is cause the current apache child process to exit and for the main 
apache process to fork another child. Which will massively increase the load 
on your server for zero gain.

Specifically having read your previous posts it will not reduce the number 
of DB connections you're seeing, as the newly-forked replacement process 
will make a new DB connection. You'll also increase the load on your DB 
server as Oracle will be constantly closing down connections and opening new 
connections - which is relatively expensive in Oracle and the reason that 
modules such as Apache::DBI exist in the first place.

Assuming that your problem is the number of Oracle processes, then you may 
be better switching to multithreaded Oracle.

You may also be able to reduce the number of connection by checking your 
code base to ensure that the same options are used whenever you request a DB 
handle.

Finally you'll be able to limit the number of connection by limiting the 
number of Apache child processes (MaxClients in httpd.conf) - however all 
that you're likely to achieve is pushing the bottleneck closer to the 
client. As Perrin has already suggested if you're not proxying or dealing 
with static content in another manner you need to ensure that these requests 
aren't going through to your mod_perl server.

Carl