Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > IBM DB2 > Re: express-c a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 8837 of 9520
Post > Topic >>

Re: express-c and php very slow

by "Dave Hughes" <dave@[EMAIL PROTECTED] > Apr 29, 2008 at 01:08 PM

Christian Welzel wrote:

> Hi Dave,
> 
> > I'd hazard a guess that
> > your PHP app is the only thing connecting to the database? 
> 
> Yes, it is.
> 
> > I'd also guess that
> > you're not using connection pooling / persistent connections?
> 
> Correctly. I dont know if the php-db2-driver sup****ts this, but i 
> investigate this.

I'm no PHP expert (I've never used it heavily), but it looks like
there's a db2_pconnect() function which might be handy:

http://php.net/manual/en/function.db2-pconnect.php

> 
> > 2) A better idea is to change the application to use persistent
> > connections / connection pooling. However, before doing that I'd use
> > ACTIVATE DB just to see if this is actually what the problem is.
> 
> I activated the database and now the requests are handled very
> fast. Seems this solved my problem at a first step.

Excellent, glad to hear it :)

> As we are in a very early state of development, this solution is 
> ok for me, but for later use i will look for some pooling code
> as you suggested.

I'd recommend connection pooling / persistent connections as a long
term solution simply because if you have to reboot the server at some
point (or restart DB2, or whatever) the database will be inactive again
and performance will suffer until ACTIVATE DB is performed again. You
could always set up a little script to automatically activate the
database on reboot or something similar, but I feel persistent
connections are a "cleaner" solution.

Of course, in some cases ACTIVATE DB is the only (easy) solution. For
example, CGI applications which don't persist between requests can't
hold a persistent connection (things like SQLRelay are an alternative
solution, although rather more complex, in such cir***stances).


Cheers,

Dave.
 




 4 Posts in Topic:
express-c and php very slow
Christian Welzel <gawa  2008-04-29 16:35:39 
Re: express-c and php very slow
"Dave Hughes" &  2008-04-29 10:46:05 
Re: express-c and php very slow
Christian Welzel <gawa  2008-04-29 18:37:14 
Re: express-c and php very slow
"Dave Hughes" &  2008-04-29 13:08:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 20:50:13 CST 2008.