php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56951 php failing to cache presistent connections
Submitted: 2006-04-11 19:24 UTC Modified: 2006-07-07 05:12 UTC
From: vijay dot vujjini at fmr dot com Assigned:
Status: No Feedback Package: oci8 (PECL)
PHP Version: HEAD CVS-2006-04-11 OS: Solaris + OIC
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vijay dot vujjini at fmr dot com
New email:
PHP Version: OS:

 

 [2006-04-11 19:24 UTC] vijay dot vujjini at fmr dot com
Description:
------------
Hi: When I am using Oracle Instant Client Libraries (v10.2.0.2) to connect to my DB. I complied the latest version of oci8 (1.2.0) with php-5.1.2 source and running it on IPLANET+SOLARIS.

When I invoke oci_pconnect I do not see connection being cached and reused when with my subsequent calls. Each new request is opening up a new connection and on top of that, the connections are not being closed as per my oci8_presistent_timeout value (60 sec).





Reproduce code:
---------------
php.ini configuration:
======================
oci8.privileged_connect = 0
oci8.max_persistent	= -1
oci8.persistent_timeout	= 60
oci8.ping_interval	= -1
oci8.statement_cache_size = 20
oci8.default_prefetch	  = 10
oci8.old_oci_close_semantics	= 0

calling oci_pconnect at the start of the script and invoking stored proc.

Expected result:
----------------
Expect one connection to be opened and reused with subsequent requests.

Actual result:
--------------
Seeing a new connection opened with db for each new request.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-12 04:33 UTC] tony2001 at phpclub dot net
Persistent connections are reused only in terms of one child/thread. If you have 500 separate web-server process, you'll have 500 persistent connections.

>the connections are not being closed as per my 
>oci8_presistent_timeout value (60 sec).
How exactly did you check that?
 [2006-04-12 10:58 UTC] vijay dot vujjini at fmr dot com
I only have two IPLANET instances using this database service. For testing purposes I shut down one and tested it and I had my database admin monitor the connections on the oracle server. 

50 is the max limit set on the server and I manually refreshed  my php script 50 times and 51st time I get this error:


oci_connect() [<a href='function.oci-connect'>function.oci-connect</a>]: ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit in <b>/usr/local/apps/iplanet/servers/docs/rss/class.db.php</b> on line <b>143</b><br />

Also on the database, we see a new request being opened for each refresh. Restarting the Iplanet server will only reset the connections back to 0.

I also would like to correct my earlier statement about connection close...I think connections are being closed but I don't think they are being closed at the 60 sec idle time. Its very random.


Thanks
 [2006-04-12 11:24 UTC] tony2001 at phpclub dot net
I've no idea what is iPlanet and what "instance" means for it. Is it a fork()-based server or is it multithreaded?
Can you try it with plain Apache?
I can't reproduce it with Apache and I don't have iPlanet to play with.
 [2006-04-12 11:58 UTC] vijay dot vujjini at fmr dot com
iPlanet is Netscape Web Server (part of sun one web servers) and iPlanet instance is equivalent to having an apache child.

So when i say iPlanet instance, I mean...I have an iPlanet Server thats exclusively used for this application and listens on a specific port and is multithreaded.

I will try to test this with Apache and see if I can reproduce this issue? Since I don't have any Apache servers with me...give me 2/3 days to get whole php/my application set and test this out...

Are you using Oracle Instant Client Libraries or a full Client? 

Thanks
 [2006-04-12 12:02 UTC] tony2001 at phpclub dot net
I've tested with both full and instant clients.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC