<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">I tried the two most obvious solutions
(respectively: file:read_file/1 followed by gen_tcp:send/2, and file:sendfile/2),
of course both work but the second is not only faster but able to cope
with larger files (whereas the first approach would have needed a more
complex sending by chunks, lest it fails with enomem - i.e. not enough
memory).</font>
<br>
<br><font size=2 face="sans-serif">So I will stick with as many file:sendfile/2
concurrent calls as needed on the same file, this should be sufficient
for my use case. <br>
</font>
<br><font size=2 face="sans-serif">Cheers,</font>
<br><font size=2 face="sans-serif"><br>
Olivier.<br>
---------------------------<br>
Olivier Boudeville<br>
<br>
EDF R&D : 1, avenue du Général de Gaulle, 92140 Clamart, France<br>
Département SINETICS, groupe ASICS (I2A), bureau B-226<br>
Office : +33 1 47 65 59 58 / Mobile : +33 6 16 83 37 22 / Fax : +33 1 47
65 27 13</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>vances@motivity.ca</b>
</font>
<p><font size=1 face="sans-serif">27/03/2013 17:54</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">A</font></div>
<td><font size=1 face="sans-serif">olivier.boudeville@edf.fr</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">erlang-questions@erlang.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td><font size=1 face="sans-serif">Re: [erlang-questions] Sending a large
Erlang content to a set of remote nodes</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=3>I have a similar use case for which I am considering using
IP multicasting  and implementing a reliable layer on top. Basically
broadcasting sends but buffering data until there's been time for negative
acknowledgements.</font>
<p><font size=3>On Mar 27, 2013 10:18 PM, "Olivier BOUDEVILLE"
<</font><a href=mailto:olivier.boudeville@edf.fr><font size=3 color=blue><u>olivier.boudeville@edf.fr</u></font></a><font size=3>>
wrote:</font>
<br><font size=3 face="sans-serif"><br>
Hi,</font><font size=3> <br>
</font><font size=3 face="sans-serif"><br>
I would have a potentially large number of Erlang terms to send to a set
of remote VMs. Currently it is a matter of a few megabytes, but it could
be up to a few gigabytes in the future; and the exact same content may
have to be sent to typically a dozen of other nodes.</font><font size=3>
<br>
</font><font size=3 face="sans-serif"><br>
I was searching for a solution that would be reliable/simple/efficient
to do so (preferably in that order), knowing that these terms could be
either be kept in the RAM of the sender or, maybe preferably (the size
of the data being probably roughly on par with the local RAM), as a compressed
file on disk. </font><font size=3><br>
</font><font size=3 face="sans-serif"><br>
Currently I send a binary, compressed archive thanks to a basic Erlang
message, but I think it is not a good practice (ex: maybe the kernel ticks
are not sent "out of band" and their delaying by larger archives
could trigger spurious time-outs). I imagine sendfile with enough async
threads could be a good candidate, however I am unsure that the same content
(either as a whole or by chunks) could be read once, yet be sent to multiple
recipients. </font><font size=3><br>
</font><font size=3 face="sans-serif"><br>
Any idea? </font><font size=3><br>
</font><font size=3 face="sans-serif"><br>
Thanks in advance for any hint!</font><font size=3> <br>
</font><font size=3 face="sans-serif"><br>
Best regards,</font><font size=3> </font><font size=3 face="sans-serif"><br>
<br>
Olivier.<br>
---------------------------<br>
Olivier Boudeville<br>
<br>
EDF R&D : 1, avenue du Général de Gaulle, 92140 Clamart, France<br>
Département SINETICS, groupe ASICS (I2A), bureau B-226<br>
Office : </font><a href=tel:%2B33%201%2047%2065%2059%2058 target=_blank><font size=3 color=blue face="sans-serif"><u>+33
1 47 65 59 58</u></font></a><font size=3 face="sans-serif"> / Mobile : </font><a href=tel:%2B33%206%2016%2083%2037%2022 target=_blank><font size=3 color=blue face="sans-serif"><u>+33
6 16 83 37 22</u></font></a><font size=3 face="sans-serif"> / Fax : +33
1 47 65 27 13</font>
<p><font size=3><br>
Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis
à l'intention exclusive des destinataires et les informations qui y figurent
sont strictement confidentielles. Toute utilisation de ce Message non conforme
à sa destination, toute diffusion ou toute publication totale ou partielle,
est interdite sauf autorisation expresse.</font>
<p><font size=3>Si vous n'êtes pas le destinataire de ce Message, il vous
est interdit de le copier, de le faire suivre, de le divulguer ou d'en
utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci
de le supprimer de votre système, ainsi que toutes ses copies, et de n'en
garder aucune trace sur quelque support que ce soit. Nous vous remercions
également d'en avertir immédiatement l'expéditeur par retour du message.</font>
<p><font size=3>Il est impossible de garantir que les communications par
messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées
de toute erreur ou virus.<br>
____________________________________________________</font>
<p><font size=3>This message and any attachments (the 'Message') are intended
solely for the addressees. The information contained in this Message is
confidential. Any use of information contained in this Message not in accord
with its purpose, any dissemination or disclosure, either whole or partial,
is prohibited except formal approval.</font>
<p><font size=3>If you are not the addressee, you may not copy, forward,
disclose or use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the sender
immediately by return message.</font>
<p><font size=3>E-mail communication cannot be guaranteed to be timely
secure, error or virus-free.</font>
<p><font size=3><br>
_______________________________________________<br>
erlang-questions mailing list</font><font size=3 color=blue><u><br>
</u></font><a href="mailto:erlang-questions@erlang.org"><font size=3 color=blue><u>erlang-questions@erlang.org</u></font></a><font size=3 color=blue><u><br>
</u></font><a href="http://erlang.org/mailman/listinfo/erlang-questions" target=_blank><font size=3 color=blue><u>http://erlang.org/mailman/listinfo/erlang-questions</u></font></a><font size=3><br>
</font>
<p><p></p>

<p><br>
Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.</p>

<p>Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.</p>

<p>Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.<br>
____________________________________________________</p>

<p>This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.</p>

<p>If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.</p>

<p>E-mail communication cannot be guaranteed to be timely secure, error or virus-free.</p>