Date: Tue, 28 Nov 2000 11:03:15 -0800 From: Lars Eggert <larse@ISI.EDU> To: Alfred Perlstein <bright@wintelcom.net> Cc: questions@FreeBSD.ORG Subject: Re: send(2) and resuming after ENOBUFS Message-ID: <3A240173.D67E5DB5@isi.edu> References: <3A2326E6.AD835284@isi.edu> <20001127220700.W8051@fw.wintelcom.net> <3A23EE64.D50FD149@isi.edu> <20001128094820.I8051@fw.wintelcom.net> <3A23F7C2.EC30C6E9@isi.edu> <20001128103629.K8051@fw.wintelcom.net>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] Alfred Perlstein wrote: > > * Lars Eggert <larse@ISI.EDU> [001128 10:21] wrote: > > The problem with using nanosleep() is that I have no idea how long to sleep > > for in the general case. (Sure, I can pick good value based on the link > > speed/message size, but not if those vary.) > > Well the idea is to yeild for a small time and just try again. > > Another option would be to keep track of how much data is actually > being sent per-interval and do some sliding based on time. I've implemented a scheme where the sender sleeps on each failed send(), and for each two consecutive failed send()s, the sleep time is doubled. It seems to work pretty well, instead of hogging the CPU, the process now uses around 3%, while throughput is still up at 95Mb/s. (The sleep time stabilizes at about 16msec for my link, which is about right considering large socket and card buffers.) Thanks for the help! Lars -- Lars Eggert <larse@isi.edu> Information Sciences Institute http://www.isi.edu/larse/ University of Southern California [-- Attachment #2 --] 0# *H 010 + 0 *H 00A#0 *H 010 UZA10UWestern Cape10UDurbanville10 U Thawte10UCertificate Services1(0&UPersonal Freemail RSA 1999.9.160 000824203008Z 010824203008Z0T10 UEggert1 0U*Lars10ULars Eggert10 *H larse@isi.edu00 *H 0 \p9 H;vr∩6"C?mxfJf7I[3CF́L I - zHRVA怤2]0-bL)%X>nӅ w0u0*+e!0 00L2uMyffBNUbNJJcdZ2s0U0 larse@isi.edu0U0 0U#0`fUXFa#Ì0 *H _3 F=%nWY-HXD9UOc6ܰwf@uܶNԄR?Pr}E1֮23mFhySwM_h|d yR=$P 00}0 *H 010 UZA10UWestern Cape10U Cape Town10U Thawte Consulting1(0&UCertification Services Division1$0"UThawte Personal Freemail CA1+0) *H personal-freemail@thawte.com0 990916140140Z 010915140140Z010 UZA10UWestern Cape10UDurbanville10 U Thawte10UCertificate Services1(0&UPersonal Freemail RSA 1999.9.1600 *H 0 iZz]!#rLK~r$BRW{azr98e^eyvL>hput ,O 1ArƦ]D.Mօ>lx~@эWs0FO 7050U0 0U#0rIs4Uvr~wƲ0 *H kY1rr`HU{gapm¥7؝(V\uoƑlfq|ko!6- -mƃRt\~ orzg,ks nΝc) ~U100010 UZA10UWestern Cape10UDurbanville10 U Thawte10UCertificate Services1(0&UPersonal Freemail RSA 1999.9.16#0 + 0 *H 1 *H 0 *H 1 001128190315Z0# *H 13<aNL5ِ(z|^0R *H 1E0C0 *H 0*H 0+0 *H @0 *H (0 *H RcEwhxe9 LY_2u8apIU?@_ЧF> Gӄ&YJlaO@B å"KG2P%F| /%T}help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A240173.D67E5DB5>
