How to solve the first time that PHP connects to Oracle is very slow

Source: Internet
Author: User

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 --------------------------------------

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.