How to solve the first time that PHP connects to Oracle is very slow
The database uses Oracle 11g
PHP connection to Oracle is very slow
PHP is very slow to connect to Oracle, as shown in the following figure: If you haven't connected to oracle for a long time, it will take 20 ~ to connect to oracle again ~ 40 seconds. However, the subsequent connection will be very fast.
Website architecture
PHP Version 5.5.12Apache 2.4.9Win7 64 connects to Oracle using the PHP OCI8 extension CodeIgniter
Connection Code (the first connection of this line of code will take 20 ~ 30 seconds later)
Public function db_connect () {return @ oci_connect ($ this-> username, $ this-> password, $ this-> hostname, $ this-> char_set );}
Java webloig connection is fast
However, in addition, Java + Weblogic connects to this oracle database very quickly.
Seek Solutions
A member center is required, but the oracle database is used and the website is PHP. It is impossible for a user to wait for 20 to 20 for the first time ~ 40 seconds.
-------------------------------------- Split line --------------------------------------
Oracle 11g installation manual on RedHat Linux 5.8 _ x64 Platform
Installing Oracle 12C in Linux-6-64
Install Oracle 11gR2 (x64) in CentOS 6.4)
Steps for installing Oracle 11gR2 in vmwarevm
Install Oracle 11g XE R2 In Debian
-------------------------------------- Split line --------------------------------------