pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres connection
3+ messages / 3 participants
[nested] [flat]
* Postgres connection
@ 2003-08-19 13:13 Joe Nilson Zegarra Galvez <nzegarra@kolareal.net>
0 siblings, 2 replies; 3+ messages in thread
From: Joe Nilson Zegarra Galvez @ 2003-08-19 13:13 UTC (permalink / raw)
To: pgsql-php
Hi all, i have a question, i have a php file with all my class to
connect into a postgresql db and i'm using the pg_connect in this form:
pg_connect("192.168.1.X","","","",$dbase);
but when i have 8 or 10 users inserting data, the db response is very
slow, is problem in the pg_connect?, all ppl use the same file_class.php
to connect to the db.
The Server is a Compaq Proliant with two Xeon 2.20Ghz Processors, 1Gb
Memory, 20Gb SCSI HD, 1Gb Ethernet and Redhat Linux 8.0 with apache
2.0.47,
php 4.2.2 and PostgreSQL 7.2.2
How can i do better the response of the server?
Thankx for your answers
Regards
Nilson
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Postgres connection
@ 2003-08-19 16:24 scott.marlowe <scott.marlowe@ihs.com>
parent: Joe Nilson Zegarra Galvez <nzegarra@kolareal.net>
1 sibling, 0 replies; 3+ messages in thread
From: scott.marlowe @ 2003-08-19 16:24 UTC (permalink / raw)
To: Joe Nilson Zegarra Galvez <nzegarra@kolareal.net>; +Cc: pgsql-php
On 19 Aug 2003, Joe Nilson Zegarra Galvez wrote:
> Hi all, i have a question, i have a php file with all my class to
> connect into a postgresql db and i'm using the pg_connect in this form:
>
> pg_connect("192.168.1.X","","","",$dbase);
That's the old style connect method, you should update to the single
argument versions that lookgs like this:
pg_connect("dbname=dbname host=host user=user port=port");
But that's not the problem, just advice. Someday the 5 argument version
might slip off the face of PHP.
> but when i have 8 or 10 users inserting data, the db response is very
> slow, is problem in the pg_connect?, all ppl use the same file_class.php
> to connect to the db.
the problem is probably in your schema. Do you have lots of fk
constraints on the tables you're inserting into? Are you wrapping all
your inserts / updates / deletes into a single transaction? (you should).
How many inserts per second are these clients doing? (or trying to do :)
> The Server is a Compaq Proliant with two Xeon 2.20Ghz Processors, 1Gb
> Memory, 20Gb SCSI HD, 1Gb Ethernet and Redhat Linux 8.0 with apache
> 2.0.47,
> php 4.2.2 and PostgreSQL 7.2.2
Always run the latest version, either 7.2.4 or 7.3.4. 7.3.4 is a bit
faster at fks than 7.2.4 so may be worth the upgrade if that's the issue.
> How can i do better the response of the server?
It may well be a fk mismatch issue or something like it. examine your
table structure to make sure you aren't keying a varchar against an int8
or something like that.
also, look at tuning your default postgresql.conf file, it's pretty weak
out of the box on 7.2.x.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Postgres connection
@ 2003-08-20 15:04 Martin Marques <martin@bugs.unl.edu.ar>
parent: Joe Nilson Zegarra Galvez <nzegarra@kolareal.net>
1 sibling, 0 replies; 3+ messages in thread
From: Martin Marques @ 2003-08-20 15:04 UTC (permalink / raw)
To: Joe Nilson Zegarra Galvez <nzegarra@kolareal.net>; +Cc: pgsql-php
El Mar 19 Ago 2003 10:13, escribió:
> Hi all, i have a question, i have a php file with all my class to
> connect into a postgresql db and i'm using the pg_connect in this form:
>
> pg_connect("192.168.1.X","","","",$dbase);
Change this to what the manual says:
http://www.php.net/manual/en/function.pg-connect.php
See that it passes only one argument.
> but when i have 8 or 10 users inserting data, the db response is very
> slow, is problem in the pg_connect?, all ppl use the same file_class.php
> to connect to the db.
>
> The Server is a Compaq Proliant with two Xeon 2.20Ghz Processors, 1Gb
> Memory, 20Gb SCSI HD, 1Gb Ethernet and Redhat Linux 8.0 with apache
> 2.0.47,
> php 4.2.2 and PostgreSQL 7.2.2
>
> How can i do better the response of the server?
Depends on what your postgresql.conf file says.
Check these links:
http://www.varlena.com/GeneralBits/Tidbits/perf.html
http://www.varlena.com/GeneralBits/Tidbits/annotated_conf_e.html
Saludos... :-)
--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués | mmarques@unl.edu.ar
Programador, Administrador, DBA | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-08-20 15:04 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-08-19 13:13 Postgres connection Joe Nilson Zegarra Galvez <nzegarra@kolareal.net>
2003-08-19 16:24 ` scott.marlowe <scott.marlowe@ihs.com>
2003-08-20 15:04 ` Martin Marques <martin@bugs.unl.edu.ar>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox