Persistent connections under multithreaded environments
| From: | Paco Ortiz | Date: | Thu, 05 Jul 2001 07:41:43 +0000 |
| Subject: | Persistent connections under multithreaded environments | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-58962@lists.php.net to get a copy of this message | ||
Hi all,
I was working lately with PHP under Win32. My aim is using PHP as an ISAPI filter of IIS or an
Apache (multithreaded)
module. I suppose it's the same problem with other multithreaded OS/Webservers.
It seems much more complicated than I expected with database persistent connections:
- Apache Win32 has child threads, not processes. So it seems quite logic that all the data
structures are shared among
threads. But Apache tries to keep several pools of persistent connections (because there is a
different executor_globals
structure for every thread). So what do we want the multithread webserver approach for? (I know,
less memory footprint
and so, but sharing connections has a better point). Is it an Apache/Win32 problem?
- PHP as ISAPI mode in IIS. I have to test it yet, but I think this really has an only
executor_globals estructure for all the
threads. But then there is a second problem: if an existing connection is opened and *in use*,
souldn't we have to keep a
semaphore to prevent some threads to override others? I think this is the reason that makes
IIS/PHP/ISAPI go nuts when
persistent connections/heavy traffic are involved.
I'm afraid this multithreaded webserver/semaphores problem is not yet adressed in the database
modules. I'm I wrong?
Which are your feelings about this?
Thanks for reading.
F.J.Ortiz
___________________________________
Francisco Javier Ortiz Torre
ComuNET,S.A.
mailto:fjortiz@comunet.es
ComuNET, S.A
Gral. Concha 39,6º
48012 Bilbao España
Tel: +34 944 700 101
Fax: +34 944 700 185
http://www.comunet.es
___________________________________