2 Replies Latest reply: Oct 16, 2008 3:08 AM by michal.taborsky RSS

    oci_close does not release the connection when using DRCP

    michal.taborsky
      Hello everyone,

      we are currently testing the deplyment of DRCP with 11g. I have the whole thing setup (correctly to my best knowledge), but I am facing an issue. The call to oci_close does not seem to release the connection to the pool as I would expect and therefore we see similar behavior like we were getting without using the DRCP.

      Our setup is using two RAC instances running 11.1.0.6.0, I am using PHP 5.1.6 with PECL installed oci8 1.3.4. The DRCP pool is configured and started, each with 100 max servers.

      When the webserver is idle it looks, well, idle.

      SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;

      INST_ID NUM_BUSY_SERVERS
      ---------- ----------------
      1 0
      2 0


      The script is as simple as it gets:

      <?php
      $c = oci_pconnect('scott','tiger','IWPPOOLED');
      $s = oci_parse($c, 'select * from emp');
      $r = oci_execute($s, OCI_DEFAULT);
      oci_close($c);
      sleep(30);
      ?>

      What I would expect is that the script would connect to the pool, do the work for a tiny moment and then release the connection for usage by other script.

      But after I point the browser to the script, I get a 30 second loading time (as expected) but the server is busy all the time, like this:

      SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;

      INST_ID NUM_BUSY_SERVERS
      ---------- ----------------
      1 0
      2 1

      After the 30 second sleep, it is released and busy servers are back to 0.

      If I load the server with ab using 256 connections:

      ab -n 1000000 -c 256 -k http://mywebserver/ocitest.php

      the pool is maxed out and the connects are stalling:

      SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;

      INST_ID NUM_BUSY_SERVERS
      ---------- ----------------
      1 95
      2 95


      My network config for this service is following:
      IWPPOOLED =
      (DESCRIPTION =
      (LOAD_BALANCE=ON)
      (FAILOVER=ON)
      (ADDRESS = (PROTOCOL = tcp)(HOST = 10.1.16.33)(PORT = 1521))
      (ADDRESS = (PROTOCOL = tcp)(HOST = 10.1.16.34)(PORT = 1521))
      (CONNECT_DATA =
      (SERVICE_NAME = IWP)
      (SERVER=POOLED)
      (FAILOVER_MODE=
      (TYPE=SELECT)
      (METHOD=BASIC)
      (RETRIES=5)
      (DELAY=3)
      )
      )
      )

      The phpinfo() look like this:
      OCI8 Support enabled
      Version 1.3.4
      Revision $Revision: 1.269.2.16.2.38.2.20 $
      Active Persistent Connections 1
      Active Connections 1
      Oracle Instant Client Version 11.1
      Temporary Lob support enabled
      Collections support enabled

      Directive Local Value Master Value
      oci8.connection_class IWPAPP IWPAPP
      oci8.default_prefetch 100 100
      oci8.events On On
      oci8.max_persistent -1 -1
      oci8.old_oci_close_semantics Off Off
      oci8.persistent_timeout -1 -1
      oci8.ping_interval -1 -1
      oci8.privileged_connect Off Off
      oci8.statement_cache_size 20 20


      I am using the instant client for 11g

      Any ideas?

      Thanks!
      Michal