php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42204 Persistent connections
Submitted: 2007-08-03 20:04 UTC Modified: 2007-09-07 14:31 UTC
From: jcuello at sitrack dot com Assigned:
Status: Closed Package: Informix related
PHP Version: 4.4.7 OS: Linux, Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jcuello at sitrack dot com
New email:
PHP Version: OS:

 

 [2007-08-03 20:04 UTC] jcuello at sitrack dot com
Description:
------------
Every call to ifx_pconnect() opens a connection to the database server instead of using the connection previously created. This situation take place when the gap between each call is about 20 seconds or more. We monitor the connections to the database server with the informix command 'onstat -g ses'. The connections remains open until the apache server is stopped.


Reproduce code:
---------------
<?php
    $conn_id = ifx_pconnect ("db@server", "user", "pass");
?>

Expected result:
----------------
I expect the script doesn't open a new connection to the database server if it find a connection already established. I expect it uses the connection already open.

Actual result:
--------------
The script open a new connection to the server if the gap between each call to the script is about 20 seconds or more. The connections remains open until de apache server is stopped.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-05 14:32 UTC] jcuello at sitrack dot com
On Linux too.
 [2007-09-07 14:31 UTC] jcuello at sitrack dot com
The script opens a new connection because de it uses a new apache server process. The problem about a new connection is not concerned to php, instead of that it depends on how apache manage each child process. The gap about 20 seconds refer to the KeepAliveTimeout varible in the httpd.conf apache config file.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 14:01:32 2024 UTC