tcp_nodelay 
Author Message
 tcp_nodelay
Someone suggested that I use the "tcp_nodelay enabled" command
for an application that I am running.  I didn't catch where this
command belongs and what it's syntax is.  

Is it an ISQL, sybinit, net.cfg, etc.?  Any help is greatly
appreciated.



Tue, 03 Mar 1998 03:00:00 GMT
 tcp_nodelay

Quote:

> Someone suggested that I use the "tcp_nodelay enabled" command
> for an application that I am running.  I didn't catch where this
> command belongs and what it's syntax is.  

> Is it an ISQL, sybinit, net.cfg, etc.?  Any help is greatly
> appreciated.

As a traceflag in your RUN_* file:

   -T1610

Pablo Sanchez              | Ph # (415) 390.3812        Fax # (415) 390.2821

===============================================================================
"I am accountable for my actions."
   - pablo



Tue, 03 Mar 1998 03:00:00 GMT
 tcp_nodelay

: > Someone suggested that I use the "tcp_nodelay enabled" command
: > for an application that I am running.  I didn't catch where this
: > command belongs and what it's syntax is.  
: >
: > Is it an ISQL, sybinit, net.cfg, etc.?  Any help is greatly
: > appreciated.
:
: As a traceflag in your RUN_* file:
:
:    -T1610

This will enable tcp nodelay on the server. You can also enable it on the
client by getting the file descriptor and using the appropriate call. As
an example, you could do the following for CT-Lib (on a bsd system):

        if (ct_con_props(connection, CS_GET, CS_ENDPOINT,
                                 &endpoint, CS_UNUSED, NULL) != CS_SUCCEED)
        {
                return CS_FAIL;
        }

        /*
        ** Enable tcp nodelay on the endpoint. To be pedantic,
        ** IPPROTO_TCP should be obtained via getprotobyname().
        */
        optval = 1;
        if (setsockopt(endpoint, IPPROTO_TCP, TCP_NODELAY, optval,
                sizeof(optval)) < 0)
        {
                return CS_FAIL;
        }

Other systems may use other mechanisms for enabling this option (try "man
tcp" to find more info).  The no delay option will prevent TCP from
buffering small amounts of data to be sent while it's waiting for an
acknowledgement from a previous send.  This may be win or a lose
depending on your application, OS, and network topology.  If implementing
it on a client, I would make it runtime configurable and test it both
ways.

Otto

--
Otto Lind                  Otto Lind Consulting Services

skypoint!olcs!ottol        voice:(612)457-1080    fax:(612)457-0761



Thu, 05 Mar 1998 03:00:00 GMT
 tcp_nodelay

Quote:


> > Someone suggested that I use the "tcp_nodelay enabled" command
> > for an application that I am running.  I didn't catch where this
> > command belongs and what it's syntax is.

> > Is it an ISQL, sybinit, net.cfg, etc.?  Any help is greatly
> > appreciated.

> As a traceflag in your RUN_* file:

>    -T1610

> Pablo Sanchez              | Ph # (415) 390.3812        Fax # (415) 390.2821

> ===============================================================================
> "I am accountable for my actions."
>    - pablo

Can anyone help us with TCP_NODELAY with the client application
running under Microsoft Windows ?

Previously, we have resolved a lot of performance problems using
what Sybase call "TCP/IP Packet Batching". Quoting from an article
in their AnswerBase:

Setting NO_DELAY In TCP/IP Client Applications Can Also Yield
Additional Performance Gains. Many SQL batches map to small TDS packets
and get buffered in the TCP layer. RPC calls with many parameters often
span TDS packets and may also get buffered in the TCP layer. To set,
the application needs the file descriptor for the connection to the
server.

Use DBIOWDESC(dbproc) in DB-Lib or ct_con_props call specifying
CS_ENDPOINT in CT-Library. The returned interger file descriptor is
then used in a series of Unix system calls. For example (DB-Lib / BSD
platforms):

   dbfd = DBIOWDESC(dbproc);
   if ((proto = getprotobyname ("TCP")) == (struct protoent *)NULL) {
      perror("setsockopt() failed");
      exit (ERREXIT);
   }
   optval = 1;
   if (setsockopt (dbfd, proto->p_proto, TCP_NODELAY, (char *)&optval,
         sizeof(optval)) == -1) {
      perror("setsockopt() failed");
      exit (ERREXIT)
   }

We have now ported our application which previously ran under Unix V.4
and SCO Unix, to Microsoft Windows - and we get dire performance
problems because we are unable to set the "TCP_NODELAY" option
because the Sybase DBIOWDESC function is only supported in their Unix
and VMS version.

Microsoft have also documented in their Development Library (Ref PSS
ID Number Q126716) that setting TCP_NODELAY can give major performance
gains, and one of the major enhancements put into Windows Sockets
Version 1.1 was "Addition of TCP_NODELAY socket option for RFC 1122
conformance".

We have our first "Windows"-based customer attempting to run, and
are at our wits end - we have submitted a "feature request" to
Sybase, but I doubt whether we will have any customers around by
the time that gets implemented !

Has anyone out there found a way of enabling TCP_NODELAY with
DB-Library 10.0.3/Net-Library 10.0.2 or whatever ?

We have thought about developing a kind of proxy WINSOCK.DLL, which
would capture Sybase's calls, and set the TCP_NODELAY bit on the
fly before in some way calling the "real" WINSOCK.DLL routines.

Any help at all will be greatly appreciated.

Sorry for the length of this posting.
--

AT&T ISTEL (formerly JDC Data), R&D    Switchboard +45 7941 6400 ext 6604
Haeldagervej 165                       Direct      +45 7941 6604
DK-7100 Vejle, DENMARK                 FAX         +45 7941 6411



Mon, 29 Jun 1998 03:00:00 GMT
 tcp_nodelay

Quote:

> Previously, we have resolved a lot of performance problems using
> what Sybase call "TCP/IP Packet Batching".

[snip]

> We have now ported our application which previously ran under Unix V.4
> and SCO Unix, to Microsoft Windows - and we get dire performance
> problems because we are unable to set the "TCP_NODELAY" option
> because the Sybase DBIOWDESC function is only supported in their Unix
> and VMS version.

Have you considered digging around in the DBPROCESS structure.  DBIOWDESC
is only a macro.

Have you considered porting to a real operating system <g>?

--
Steve Baker (314)414-0108
Technology Applications, Inc.
http://www.techapp.com/~sbb/



Tue, 30 Jun 1998 03:00:00 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. TCP_NODELAY - the Nagle algorithm

2. TCP_nodelay

3. Exception at Connect to Sybase / TCP_NODELAY

4. TCP_NODELAY - why does it affect server processes?

5. Using TCP_NODELAY

6. TCP_NODELAY from sybperl

7. TCP_NODELAY on W95

8. TCP_NODELAY VIA TLI

9. TCP_NODELAY problem

10. ISTAR 5.03 SCO-UNIX (TCP_NODELAY)

11. Ok, I lied about it working... TCP_NODELAY?


 
Powered by phpBB® Forum Software