The database uses Oracle11gPHP to connect to Oracle very slowly PHP to connect to oracle very slowly, reflected in, if not connected to oracle for a long time, then connect to oracle again, it will take 20 ~ 40 seconds. However, the subsequent connection will be very fast. Website architecture {code...} connection code (this line... 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.
Reply content:
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.
Why not use PDO