pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgres network preformance
2+ messages / 2 participants
[nested] [flat]

* Postgres network preformance
@ 2002-06-07 12:20  Ferdinand Smit <ferdinand@telegraafnet.nl>
  0 siblings, 0 replies; 2+ messages in thread

From: Ferdinand Smit @ 2002-06-07 12:20 UTC (permalink / raw)
  To: pgsql-admin

Hi,

Does anyone have any tips to improve the network preformance op Postgres ?

To test the preformance i've done a little test using the perlmodule DBI.
The ping last 1 ms and the computers are identical.

The test script:

#!/usr/bin/perl
use DBI;

my $connectTo = "dbi:Pg:dbname=testdb;host=obelix.telegraaf.net";
my $dbh = DBI->connect($connectTo,undef,undef,undef) or die("$DBI::errstr 
($connectTo)");
my $sth = $dbh->prepare("SELECT ?") or die $DBI::errstr;

for ($T=0; $T<10000; $T++) {
  $sth->execute($T);
  $sth->finish;
}
$dbh->disconnect();


The 'time' results:
- Running local:
real    0m2.770s
user    0m0.490s
sys     0m0.250s
- Via network:
real    0m39.919s
user    0m0.470s
sys     0m0.190s




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Postgres network preformance
@ 2002-06-07 20:49  nikolaus@dilger.cc
  0 siblings, 0 replies; 2+ messages in thread

From: nikolaus@dilger.cc @ 2002-06-07 20:49 UTC (permalink / raw)
  To: ferdinand@telegraafnet.nl; +Cc: pgsql-admin

Ferdinand,

The results are not bad at all.  But your test seems
flawed to me.  And you would get the same result
regardles of database engine used.

You do 10,000 loops and each loop has 2 calls to the
DBI module.  So if your network roundtrip is really
exactly 1ms that would put you at 20,000ms = 20 seconds
for the network roundtrips.  Most likely the network
roundtrip is longer.  Instead of a single ping you
would need to compare 20,000 network roundtrips without
database access.

And you should use a valid SQL statement if you want to
do a serious database test.

Regards,
Nikolaus



Ferdinand Smit wrote

> 
> Hi,
> 
> Does anyone have any tips to improve the network
preformance op Postgres ?
> 
> To test the preformance i've done a little test using
the perlmodule DBI.
> The ping last 1 ms and the computers are identical.
> 
> The test script:
> 
> #!/usr/bin/perl
> use DBI;
> 
> my $connectTo =
"dbi:Pg:dbname=testdb;host=obelix.telegraaf.net";
> my $dbh = DBI->connect($connectTo,undef,undef,undef)
or die("$DBI::errstr 
> ($connectTo)");
> my $sth = $dbh->prepare("SELECT ?") or die
$DBI::errstr;
> 
> for ($T=0; $T<10000; $T++) {
>   $sth->execute($T);
>   $sth->finish;
> }
> $dbh->disconnect();
> 
> 
> The 'time' results:
> - Running local:
> real    0m2.770s
> user    0m0.490s
> sys     0m0.250s
> - Via network:
> real    0m39.919s
> user    0m0.470s
> sys     0m0.190s
> 
> 
> ---------------------------(end of
broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
unregister command
>     (send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-06-07 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-06-07 12:20 Postgres network preformance Ferdinand Smit <ferdinand@telegraafnet.nl>
2002-06-07 20:49 Re: Postgres network preformance nikolaus@dilger.cc

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