lkml.org 
[lkml]   [2003]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sendfile or r+w for sending file to multiple machines
jlnance@unity.ncsu.edu wrote:
> Hello All,
> I have an application that needs to be able to send large files to
> multiple machines (less than 10). The files get sent to the machines at
> the same time so we are thinking about writing the code so that it does
> 1 read (or perhaps a mmap) on the file, and then does multiple writes,
> onece to each machines socket.
> We are also considering using multicast but this seems unnecessarily
> complex. I dont want to reimplement TCP.

Given that your stated goal is to minimize disk reads, to me at least reading
once and sending via TCP on multiple sockets seems to make sense, and is the
only option that actually gives you direct control over the reads.

If it was an advantage for the receivers to have the file as soon as possible,
you might be able to do slightly better by sending the whole file once as UDP to
all listeners and then filling in the blanks later. This way, some of the
listeners would get the file on the first pass and not have to wait for the
lowest common denominator. You probably wouldn't gain much though.

Chris



--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:1.545 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site