Bug #51610 [Wfx]: 1 second+ needed for OCI8 versus PDO/oci to open/close connection and exit
| From: | sixd@php.net | Date: | Thu, 08 Jul 2010 05:37:57 +0000 |
| Subject: | Bug #51610 [Wfx]: 1 second+ needed for OCI8 versus PDO/oci to open/close connection and exit | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-152196@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51610&edit=1
ID: 51610
Updated by: sixd@php.net
Reported by: marioroy at verizon dot net
Summary: 1 second+ needed for OCI8 versus PDO/oci to open/close
connection and exit
Status: Wont fix
Type: Bug
Package: OCI8 related
Operating System: Linux & Snow Leopard
PHP Version: 5.3SVN-2010-04-20 (snap)
Assigned To: sixd
New Comment:
I wonder what issues the following patch would bring?
Index: oci8.c
===================================================================
--- oci8.c (revision 300858)
+++ oci8.c (working copy)
@@ -35,6 +35,7 @@
#include "php.h"
#include "ext/standard/info.h"
#include "php_ini.h"
+#include "SAPI.h"
#include "ext/standard/php_smart_str.h"
#if HAVE_OCI8
@@ -3187,7 +3188,11 @@
PHP_OCI_CALL(OCIHandleFree, ((dvoid *) session_pool->err,
OCI_HTYPE_ERROR));
}
- if (session_pool->env) {
+ /* When PHP is invoked as a CLI then destruction of the
+ * Environment handle is left to the OS at PHP process shutdown.
+ */
+ if (session_pool->env && !sapi_module.phpinfo_as_text) {
PHP_OCI_CALL(OCIHandleFree, ((dvoid *) session_pool->env,
OCI_HTYPE_ENV));
}
Previous Comments:
------------------------------------------------------------------------
[2010-06-26 05:44:43] marioroy at verizon dot net
I have applied this patch to oci8.c. It resolves the issue for me. I
set
use_spool to 0. Can we have use_spool enabled/disabled via an oci8.ini
directive. Thanks.
@@ -1711,7 +1693,7 @@
smart_str hashed_details = {0};
time_t timestamp;
php_oci_spool *session_pool = NULL;
- zend_bool use_spool = 1; /* Default is to use
client-side
session pool */
+ zend_bool use_spool = 0; /* Default is to use
client-side
session pool */
zend_bool ping_done = 0;
------------------------------------------------------------------------
[2010-06-18 04:19:45] sixd@php.net
The PHP OCI8 code changes in question have been in production for two
years. They were introduced to support Database Resident Connection
Pooling and FAN for scalability in web apps. The dominant use cases
for SQL*Plus and PHP are very different.
------------------------------------------------------------------------
[2010-06-17 15:29:25] chris at leaflock dot net
I filed a duplicate bug, but I noticed something unique; It doesn't
happen with Oracle 10.2.0.3.
I'm pretty unhappy about this, what is the benefit and/or requirement
for this behavior, and why does it not happen in 10.2.0.3?
Oracle's own SQLPlus doesn't display this behavior. I never thought I'd
see the day when SQLPlus could do something faster for me than PHP.
------------------------------------------------------------------------
[2010-04-22 00:33:09] marioroy at verizon dot net
Thank you for the feedback.
------------------------------------------------------------------------
[2010-04-21 18:31:34] sixd@php.net
This is expected. There is a shutdown cost at process termination from
closing
a timer thread needed by the connection rearchitecture of OCI8 1.3.
Most deployments either do not start and stop PHP processes frequently,
or are
not sensitive to the time between completing the work of the script and
the
termination of the process.
It's possible that PDO_OCI may be changed in future and might get the
same
behaviour.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=51610
--
Edit this bug report at http://bugs.php.net/bug.php?id=51610&edit=1