Re: ODBC driver over network very slow

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-performance(at)postgresql(dot)org>, "Milan Sekanina" <milan(at)sde(dot)cz>
Subject: Re: ODBC driver over network very slow
Date: 2005-06-30 14:10:25
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3415C2C49@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> Milan Sekanina <milan(at)sde(dot)cz> writes:
> > We are running an application that uses psqlodbc driver on Windows
XP to
> > connect to a server and for some reason the download of data from
the
> > server is very slow. We have created a very simple test application
that
> > inserts a larger amount of data into the database and uses a simple
> > "SELECT * from test" to download it back. The INSERT of 10MB takes
about
> > 4 seconds, while the SELECT takes almost 5 minutes (with basically
> > nothing else running on both the network and the two computers). If
we
> > run the PostgreSQL server on the local machine so that the network
is
> > not used, both actions are very fast.
>
> I seem to recall having seen similar reports not involving ODBC at
all.
> Try searching the mailing-list archives, but I think the cases we
solved
> involved getting rid of third-party add-ons to the Windows TCP stack.

IIRC there was a TCP related fix in the odbc driver related to
performance with large buffers. I'd suggest trying a newer odbc driver
first.

Merlin

dave page wrote ([odbc] 500 times slower)
>
> My collegue spent some time to dig the following case and it
> looks like
> Nagle algorithm and delayed ACKs related problem.
> In psqlodbc.h
> #define SOCK_BUFFER_SIZE 4096
>
> I changed that value to 8192 and driver works fine for me.
> I am not sure why this change helps.

Err, no neither am I. Why do you think it's got something to do with
Nagle/delayed ACKs?

The only thing that instantly rings bells for me is that the max size of
a text field is 8190 bytes at present (which really should be increased,
if not removed altogether), which won't fit in the default buffer. But
then, I wouldn't expect to see the performance drop you describe with a
4096 byte buffer, only one much smaller.

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2005-06-30 14:47:19 Re: ODBC driver over network very slow
Previous Message Tom Lane 2005-06-30 13:48:19 Re: ODBC driver over network very slow