> -----Original Message-----
> From: Niral Trivedi [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 18, 2000 3:57 PM
> To: Geoffrey Young
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: Confusion on Apache::DBI
> 
> 
> Geoff,
> 
> I know, once child dies, db handle goes out of scope and DBI cleans up
> the connection..
> 
> What I was asking is, we have directive called 
> 'MaxRequestPerChild' for
> Apache server configuration which basically says how many request one
> child can process before it dies. So, if we have in 'httpd.conf' file
> 'MaxRequestPerChild 1000', that means, one child process will 
> serv 1000
> request and then it will die.
> 
> Now, with Apache::DBI, we'll have one DBI handle per child process
> during the server startup. Now, let's say one child has started its
> processing and hasn't served any request yet. Now, first request comes
> in and it will look for DB handle, which is available and start
> processing it. Now, second request comes in for same child process and
> request for DBI handle, which is still serving first request. 

how would the child be available to serve another request but not have
completed its DBI work?  are you forking off a new process or something?


> So, what
> happened at this time to second request?? Does it have to wait for DBI
> handle to be free?? That's my question..
> 
> I think, second request has to wait.. i.e. it will be the 
> same as normal
> CGI.. only difference is, we'll save overhead of opening a DB 
> connection
> each time request comes in.. Correct me if I am wrong..
> 
> And I'll look in DBI::Proxy ..
> 
> Thanks again for your help Geoff..
> 
> Niral
> 
> Geoffrey Young wrote:
> > 
> > > -----Original Message-----
> > > From: Niral Trivedi [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, May 18, 2000 3:15 PM
> > > To: Geoffrey Young
> > > Cc: '[EMAIL PROTECTED]'
> > > Subject: Re: Confusion on Apache::DBI
> > >
> > >
> > > Thanks Geoff,
> > >
> > > You were right... I was using 
> "DBI:mysql:DBNAME::localhost" as connect
> > > string in startup file whereas "DBI:mysql:DBNAME" in my mod_perl
> > > script.. I have changed that and it worked...
> > >
> > > Now, another question.. As we agreed, we can have as many 
> db handle
> > > available as server processes are running..
> > >
> > > Now, can we set number of  db connection per server process
> > > in script or
> > > in startup script or any other way???
> > >
> > > Because what I see is in this way... Let's say a child process can
> > > handle 10 request and then dies.. now it has one db connection
> > > available..
> > 
> > I believe that once the child dies, $dbh goes out of scope 
> and DBI cleans up
> > the connection.  I could be wrong, though...
> > 
> > > and it is processing one request which uses available db
> > > handle.. now what happen if another request comes in and ask
> > > for same db
> > > handle???
> > 
> > well, another request won't come in and ask for the _same_ 
> handle that died
> > with the other child - that's the nature of Apache::DBI, 
> one handle per
> > child.  It's not a pool of shared connections, really...  
> Apache will either
> > serve the new request to an existing child (which would get a cached
> > connection) or initialize a new child (which would 
> subsequently open a new
> > connection and cache it)...
> > 
> > > does that request has to wait for that or what???
> > > If yes, then
> > > is there any way we can set number of connection per 
> process?? I mean
> > > each child process can have 5 db connection open at the same
> > > time.. and
> > > it can grow upto 10.. So, if all 5 db handle are in use, 
> and if 6th
> > > request comes in then process will open another connetion and
> > > it can do
> > > like this upto max of 10 connection..
> > >
> > > Is it possible??? has anybody done this kind of things before????
> > 
> > folks have talked about this type of stuff on the dbi-users 
> list - it comes
> > up every so often...
> > 
> > I don't know that anyone has implemented a solution, though 
> you might try
> > looking at DBI::ProxyServer - I think it does something 
> like this (though I
> > haven't looked at it myself)
> > 
> > --Geoff
> > 
> > >
> > > Thanks again for your help..
> > >
> > > Niral
> > >
> > > Geoffrey Young wrote:
> > >
> > > >>
> > > >>
> 

Reply via email to