Skip to Main Content

PHP, RAC, OCI8 Slow trying to set up HA

bsimondsAug 6 2009 — edited May 23 2011
I am trying to set up a php application to connect to an Oracle 11g 2 node RAC. I have set it up with PHP 5.2.8 and 5.2.10.

php 5.2 comes with the oci8 1.2.5, and when I was running that version connections were quick and responsive. My test script which forks 10 "users" and connects to the web app 10 times each would complete in less than 20 seconds, however, when ever there was a db failure, some of the connections would, presumably because they are waiting for a connection timeout before letting go. needless to say this was counter productive.

I upgraded the oci8 driver to 1.3.5, and the failovers went much smoother, the problem was when I started load testing, I realized something was not right. The same set of tests that ran in under 20 seconds now took over 6 minutes to complete. I have absolutely no idea where to start with this. This is my first project working with oracle, so I am not really familar with the connections, and failover.

Some of the details are as follows, and if there is additional info that would be helpful, please let me know, and I will post what I can.

php 5.2.8
oci8 1.3.5
oracle rac 11g
oracle instand client 11.1



(ADDRESS = (PROTOCOL = TCP)(HOST = node-vip-02)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = node-vip-01)(PORT = 1521))
(SERVICE_NAME = rac_service)
(TYPE = select)
(METHOD = basic)
(DELAY = 1)

Thank you,
Post Details
Added on Aug 6 2009