php-general | 2000071
Date: 07/08/00
- Next message: idban secandri: "Re: [PHP] Does PHP support PHP redirection ?"
- Previous message: mario mario: "[PHP] Does PHP support PHP redirection ?"
- Next in thread: Andreas Karajannis: "[PHP] Re: [PHP-DB] Worried about database connection..."
- Reply: Andreas Karajannis: "[PHP] Re: [PHP-DB] Worried about database connection..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi all.
I'm seriously worried about the load generated by database
connection on a site I'm developing... I'm crossposting this mex to
general an db list. Please direct me to the correct place where this
thread should live and I'll stick to that, thanks!
I'm in early developing stage. I set up a box with apache 1.3.12,
PHP 4.0.0 (--with-apxs), postgresql 7.0.2. The machine is quite
well equipped (1/2 Gig'o'Ram, PIII 500, High end SCSI disks...).
The problem is that PHP-enabled pages seem to spawn a large
number of database connections, and they don't seem to reuse
them efficiently. I'using _pconnect, to reduce latency, and keeping
the number of concurrent requests low... and after just a few hours
of work, with just two clients using the web site, I've reached the
max limit of 32 postgres client!
I know that I can increase that limit to much more than 32, and I
know that for the way the Http server works even a single user that
does many request can need many backend connections, since
each request could be served by a different http process. But since
there were so few users requesting a connection, why there wasn't
an available one? Moreover, the odd thing is that at the moment I
start getting the "too many client" error, I had 32 postgres backend
running but only 20 http processes!
I thought that when a http process gets killed, the connection
owned by that process should get closed.
Instead, it seems that the postgres backend lives on, and after
some time the http process can not find an available one no more.
If this is the case, even if I config my box to accept 100, or 200
concurrent requests, they will be used in little time, when I will have
the site exposed to the public!!!
What should I do? I wouldn't switch to another DB, since
PostgreSQL it's the one I know better. Nor I would like to use the
"normal" pgsql_connect, as it's far slower. I can't believe that with
these tools I will not bee able to set up a high-traffic website!!!
Thank you all in advance for any hint, and bye bye from Italy...
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Fabrizio Ermini Alternate E-mail:
C.so Umberto, 7 faermini <email protected>
loc. Meleto Valdarno Mail on GSM: (keep it short!)
52020 Cavriglia (AR) faermini <email protected>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: idban secandri: "Re: [PHP] Does PHP support PHP redirection ?"
- Previous message: mario mario: "[PHP] Does PHP support PHP redirection ?"
- Next in thread: Andreas Karajannis: "[PHP] Re: [PHP-DB] Worried about database connection..."
- Reply: Andreas Karajannis: "[PHP] Re: [PHP-DB] Worried about database connection..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

