Bug #14948 Updated: mssql_pconnect opens connection everytime is called

From: Date: Mon, 14 Jan 2002 08:51:12 +0000
Subject: Bug #14948 Updated: mssql_pconnect opens connection everytime is called
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-76985@lists.php.net to get a copy of this message
ID: 14948 Comment by: fjortiz@comunet.es Old Reported By: spilka@adash.cz Reported By: fjortiz@comunet.es Status: Open Bug Type: MSSQL related Operating System: NT 4.0 SP5 PHP Version: 4.1.1 New Comment: I think this is not a bug, but Apache 1.3.x Win32 default behavior: if you configured Apache to have 25 threads, for example, there will be 25 opened connections, because Apache seems to rotate requests among threads. So the persistent connection pool is PER THREAD, not per process. IIS (and Apache 2 I think) uses a different way: it creates threads as they are needed. Pity this creates some thread-safe issues thanks to the clunky MSSQL DB-library... And beware!, by default MSSQL DB-library only accepts 25 connections per process. Previous Comments: ------------------------------------------------------------------------ [2002-01-10 02:22:56] spilka@adash.cz Apache 1.3.22 Win NT SP5 PHP 4.1.1, run as DLL Apache module MSDE SQL server mod_mssql module loaded The web server with PHP module and SQL server are running on the same machine. Problem: When opening connection to MSSQL database with mssql_pconnect, the connections are not persistently used. Instead, new connection is opened everytime. MSSQL sp_who2 clearlz determines this (everytime REFRESH inbrowser is called new connection pops up). Ondra. ------------------------------------------------------------------------ [2002-01-09 09:44:21] spilka@adash.cz Apache 1.3.22 Win NT SP5 PHP 4.1.1, run as DLL Apache module MSDE SQL server mod_mssql module loaded Problem: When opening connection to MSSQL database with mssql_pconnect, the connections are not persistently used. Instead, new connection is opened everytime. See MSSQL sp_who2 results: SPID Status DBName Command CPUTime DiskIO LastBatch ProgramName SPID ----- ---------- ------ ---------------- ------- ------ -------------- -------------- ----- 1 sleeping master SIGNAL HANDLER 0 0 01/09 15:07:02 1 2 BACKGROUND UKOLY LOCK MONITOR 0 0 01/09 15:07:02 2 3 BACKGROUND UKOLY LAZY WRITER 0 0 01/09 15:07:02 3 4 sleeping UKOLY LOG WRITER 0 0 01/09 15:07:02 4 5 sleeping UKOLY CHECKPOINT SLEEP 0 0 01/09 15:07:02 5 6 BACKGROUND UKOLY AWAITING COMMAND 0 5 01/09 15:07:02 6 7 RUNNABLE UKOLY SELECT INTO 0 169 01/09 15:41:39 MS SQL Query 7 8 sleeping UKOLY AWAITING COMMAND 0 0 01/09 15:41:34 PHP 4.0 8 9 sleeping UKOLY AWAITING COMMAND 0 0 01/09 15:41:31 PHP 4.0 9 10 sleeping UKOLY AWAITING COMMAND 0 0 01/09 15:41:37 PHP 4.0 10 11 sleeping UKOLY AWAITING COMMAND 0 0 01/09 15:41:39 PHP 4.0 11 12 sleeping UKOLY AWAITING COMMAND 0 0 01/09 15:41:40 PHP 4.0 12 13 sleeping UKOLY AWAITING COMMAND 0 0 01/09 15:41:41 PHP 4.0 13 ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14948&edit=1

« previous php.dev (#76985) next »