开发者

Oracle 10g and PHP

开发者 https://www.devze.com 2023-01-17 17:30 出处:网络
HI I\'ve converted a call center app from Oracle Forms into a web app using PHP i am using oci_pconnect() to connect to the DB but we are seeing very high connections (in excess of 40 000 a day) beca

HI I've converted a call center app from Oracle Forms into a web app using PHP

i am using oci_pconnect() to connect to the DB but we are seeing very high connections (in excess of 40 000 a day) because each user has a unique username and password.开发者_如何转开发 this is obviously killing the DB

any advice on best practices to minimize the impact or reuse connections?


The most common I've come across is to use a generic account for DB access and moving user authentication elsewhere (LDAP?). Although there are other approaches (as per iddqd's answer) you're still going to end up with a large connection pool at both ends, and though the performance will be improved, there's still an additional overhead each time a new session is created.


Consider to use shared server, cman or move database to 11g and try DRCP.


oci_pconnect will create a new session with Oracle for each Oracle user and each web server process. So maximum number of session connections to Oracle will be (# of Oracle users in application) * (# of processes on each web server) * (oci8.max_persistent runtime parameter). You can limit this number by setting oci8.max_persistent = 1.

0

精彩评论

暂无评论...
验证码 换一张
取 消