*BSD News Article 9666


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA6234 ; Wed, 06 Jan 93 05:16:05 EST
Xref: sserve comp.unix.bsd:9723 comp.unix.admin:8826 comp.unix.misc:6174 comp.sys.sgi:25983 comp.sys.sgi.apps:38 comp.sys.sgi.misc:199 comp.unix.internals:5487
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!purdue!not-for-mail
From: spaf@cs.purdue.edu (Gene Spafford)
Newsgroups: comp.unix.bsd,comp.unix.admin,comp.unix.misc,comp.sys.sgi,comp.sys.sgi.apps,comp.sys.sgi.misc,comp.unix.internals
Subject: Re: Problem to transfer large data via socket communication - Need Help
Date: 8 Jan 1993 12:23:32 -0500
Organization: Department of Computer Sciences, Purdue University
Lines: 29
Message-ID: <1ikdakINN3tn@uther.cs.purdue.edu>
References: <1993Jan8.071612.13716@news.uni-stuttgart.de>
NNTP-Posting-Host: uther.cs.purdue.edu
In-reply-to: wnkretz@ikesg1.energietechnik.uni-stuttgart.de's message of Fri, 8 Jan 1993 07:16:12 GMT

Oliver asks about how large a buffer can be sent at once using
sockets.

The problem is not really one of buffer size, at least not at the
level of read/write calls.  The underlying transport mechanism between
machines has a limit.  For instance, standard Ethernet packets will
have a limit of about 1500 bytes each (depending on headers, trailers,
etc).  The network software and hardware will need to do fragmentation
and reassembly of whatever buffers you have so as to meet these
limits.  The only possible savings you get by bigger buffers in the
user calls are by reducing the number of calls into the OS to
accomplish the transmission -- and that cost is usually far outweighed
by the network latency involved.

If you are trying to speed up large transfers, the places to optimize
are in the number of bytes actually sent (can you compress the data
somehow?), the protocols used (possibly reduces the size of
headers/trailers that need to be transmitted, reducing latency), and
in using better routes (faster lines, less switching).

Of course, these comments only hold if you are sending the data off
the machine.  If you are communicating between sockets on the same
machine, you are much better off using shared memory and avoiding
sockets entirely.
-- 
Gene Spafford
Software Engineering Research Center & Dept. of Computer Sciences
Purdue University, W. Lafayette IN 47907-1398
Internet:  spaf@cs.purdue.edu	phone:  (317) 494-7825