Hi Dan, many thanks for your help, having investigated the matter further
I now concur that the issue is Nagle.
> The only way to really verify this is to dump packets on the wire.
> It's almost impossible to get tcpdump running on SCO OpenServer, so
> I suggest downloading Ethereal for windows, and viewing the connection
> from there. If you see
>
> 0.000 client -> server: query (150 bytes)
> 0.010 server -> client: result header (32 bytes)
> 0.210 server -> client: result records (100 bytes)
> 0.211 client -> server: ACK
Interesting. For a query that shows the problem:
SELECT * FROM X WHERE (PRIMARY KEY) = 100
I get:
0.000 client -> server: query (41 bytes)
0.000 server -> client: ACK
0.002 server -> client: result data (field names + record data) (1460 bytes)
0.130 client -> server: ACK
0.130 server -> client: (Login command? false positive) (actually contains
more record data) (132 bytes)
0.330 client -> server: ACK
The client reports that the mysql_query() time was 0ms, and the
mysql_store_result()
time was 130ms.
It also looks like I've got Nagle on the client side, as the last client ACK
was
200ms after the previous one. I think that I've also got Nagle on the server
side,
according to what you've told me.
Here are the results of a query that do NOT show the problem:
SELECT SomeField FROM X WHERE (PRIMARY KEY) = 100
0.000 client -> server: query (48 bytes)
0.000 server -> client: ACK
0.001 server -> client: result data (field names + record data) (56 bytes)
0.178 client -> server: ACK
So my next question is, how do I go about preventing Nagle at both ends?
I'm now running the standard binary of mysql 3.23.43 on the SCO OpenServer,
and I'm using the latest (3.23.43) libmysql.dll on the client side. My
test application calls the API routines in libmysql.dll directly, so there
should be no other layers like ODBC getting involved.
MSDN tells me that Win2000 implements Nagle, but that applications can
disable it using the TCP_NODELAY flag on the socket. Looking at the mysql
source, it looks like this is being requested in libmysql.dll, but I'm not
enough of a C/C++ expert to know if it is actually happening.
Many thanks for any further assistance or comments!
Philip Brown