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

Mailing List Archive: ModPerl: ModPerl

mod-perl child process

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


Raja.Kulasekaran at netapp

Oct 27, 2009, 5:33 AM

Post #1 of 8 (1369 views)
Permalink
mod-perl child process

Hi,

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.

Can you please suggest me how to do I handle this scenario ?.

oracle 8021 1 0 17:51 ? 00:00:01 oracleXE (LOCAL=NO)
oracle 8038 1 0 17:51 ? 00:00:00 oracleXE (LOCAL=NO)
oracle 8050 1 0 17:51 ? 00:00:01 oracleXE (LOCAL=NO)
oracle 8068 1 0 17:52 ? 00:00:00 oracleXE (LOCAL=NO)

Thanks,
Raja



-----Original Message-----
From: André Warnier [mailto:aw [at] ice-sa]
Sent: Monday, October 26, 2009 3:17 AM
To: modperl [at] perl
Subject: Re: Server hangs after 502 request

Rolf Schaufelberger wrote:
...

> Of course, but what I meant was, can I tell LWP to pass the same
> referer string I found in my logfile, to simultate exactly that request ?
>
I'm sure you can. That "referrer" is just a HTTP header ("Referer:"
with only one r I think), and LWP allows you to add headers to the request.
lwp-request -h

I doubt this will help you however. If you examine your access log, you
probably have lots of such kinds of request, which do not necessarily
bring down your server.

Maybe an easier way :
- on one of your servers (suppose it is called
"yourserver.yourcompany.com"), create a really long path under the
document root and put a html page in it.
Like :
/var/www/htdocs/some/very/long/path/to/a/document/page.html
- in that html page, put a link to your front-end server
- call up that page in a browser, and click on the link.
- then look in your access log

The browser, when you click on the link in the page, sends a request to
your front-end server.
In that request, it will add a header :
Referer:
http://yourserver.yourcompany.com/some/very/long/path/to/a/document/page.html

That's what you see in the log.


pharkins at gmail

Oct 27, 2009, 11:17 AM

Post #2 of 8 (1307 views)
Permalink
Re: mod-perl child process [In reply to]

On Tue, Oct 27, 2009 at 8:33 AM, Kulasekaran, Raja
<Raja.Kulasekaran [at] netapp> 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


Raja.Kulasekaran at netapp

Oct 27, 2009, 9:32 PM

Post #3 of 8 (1302 views)
Permalink
RE: mod-perl child process [In reply to]

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

Raja

-----Original Message-----
From: Perrin Harkins [mailto:pharkins [at] gmail]
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
<Raja.Kulasekaran [at] netapp> 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


pharkins at gmail

Oct 28, 2009, 9:02 AM

Post #4 of 8 (1297 views)
Permalink
Re: mod-perl child process [In reply to]

On Wed, Oct 28, 2009 at 12:32 AM, Kulasekaran, Raja
<Raja.Kulasekaran [at] netapp> wrote:
> So, How to I control this ?. Is it possible to reuse the existing
> connection ?.

It should be doing that already. Each process will open one
connection and keep it open (unless you use different connection
parameters, like a different login), reusing it each time. What you
can't do is share a single connection between multiple processes.

If the number of connections to Oracle is a problem for you, there are
several tools out there that can help. You'll find discussion of them
in the mailing list archives. The first thing to do is make sure you
have a proxy in front of your mod_perl server.

- Perrin


Raja.Kulasekaran at netapp

Oct 29, 2009, 7:05 AM

Post #5 of 8 (1298 views)
Permalink
RE: mod-perl child process [In reply to]

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 [at] gmail]
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
<Raja.Kulasekaran [at] netapp> 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


pharkins at gmail

Oct 29, 2009, 7:48 AM

Post #6 of 8 (1294 views)
Permalink
Re: mod-perl child process [In reply to]

On Thu, Oct 29, 2009 at 10:05 AM, Kulasekaran, Raja
<Raja.Kulasekaran [at] netapp> wrote:
> How do I get the status that particular child process has been killed ?

Are you talking about the exit status of the process? You can't get
that. What are you trying to do?

- Perrin


savirn at hotmail

Oct 30, 2009, 11:52 AM

Post #7 of 8 (1292 views)
Permalink
RE: mod-perl child process [In reply to]

remove my email from list.

Thanks and regards,
Sudhakar Avirneni,
ph)6786228961



> Date: Thu, 29 Oct 2009 10:48:05 -0400
> Subject: Re: mod-perl child process
> From: pharkins [at] gmail
> To: Raja.Kulasekaran [at] netapp
> CC: modperl [at] perl
>
> On Thu, Oct 29, 2009 at 10:05 AM, Kulasekaran, Raja
> <Raja.Kulasekaran [at] netapp> wrote:
> > How do I get the status that particular child process has been killed ?
>
> Are you talking about the exit status of the process? You can't get
> that. What are you trying to do?
>
> - Perrin

_________________________________________________________________
New Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop


modperl at fadetoblack

Nov 23, 2009, 6:20 AM

Post #8 of 8 (1165 views)
Permalink
Re: mod-perl child process [In reply to]

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

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.