Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SO_RCVBUF larger than 64K

2,352 views
Skip to first unread message

Terje A. Bergesen

unread,
Aug 14, 2002, 1:43:47 AM8/14/02
to
I am developing an app that will received quite a few UDP
packages over a very short period of time. The problem is
that I am not able to do this properly on Linux (or Solaris
for that matter) at this point in time since I can not set
the SO_RCVBUF larger than 64K.

On Win2K which is the third platform this app must run on,
I can set the receive buffer to more or less any size I
wish, and Win2K is therefore able to survive the storm.

Any ideas on how I can change this on Linux (or Solaris
for that matter)? Will I have to recompile the kernel?


--
+------------------------+-------------------------------------------+
| Terje A. Bergesen | ter...@yahoo.com |
| Santa Monica, CA | http://terje.bivrost.com/ |
| Living it, loving it | http://ingrid.bivrost.com/ |

Casper H.S. Dik

unread,
Aug 14, 2002, 5:11:08 AM8/14/02
to
"Terje A. Bergesen" <ter...@yahoo.com> writes:

>I am developing an app that will received quite a few UDP
>packages over a very short period of time. The problem is
>that I am not able to do this properly on Linux (or Solaris
>for that matter) at this point in time since I can not set
>the SO_RCVBUF larger than 64K.


I believed this is governed by the Solaris ndd setting for /dev/udp
of udp_max_buf.

(ndd -set /dev/udp udp_max_buf <value>)

The default appears to be 256K.

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

Kevin Easton

unread,
Aug 14, 2002, 6:45:33 AM8/14/02
to
In comp.os.linux.development.apps Terje A. Bergesen <ter...@yahoo.com> wrote:
> I am developing an app that will received quite a few UDP
> packages over a very short period of time. The problem is
> that I am not able to do this properly on Linux (or Solaris
> for that matter) at this point in time since I can not set
> the SO_RCVBUF larger than 64K.
>
> On Win2K which is the third platform this app must run on,
> I can set the receive buffer to more or less any size I
> wish, and Win2K is therefore able to survive the storm.
>
> Any ideas on how I can change this on Linux (or Solaris
> for that matter)? Will I have to recompile the kernel?
>

On Linux, echo the new maximum you want for the RCVBUF into
/proc/sys/net/core/rmem_max. wmem_max in the same directory is for
setting the maximum SNDBUF.

- Kevin.

Philip Brown

unread,
Sep 1, 2002, 3:44:14 PM9/1/02
to
On Wed, 14 Aug 2002 05:43:47 GMT, ter...@yahoo.com wrote:
>I am developing an app that will received quite a few UDP
>packages over a very short period of time. The problem is
>that I am not able to do this properly on Linux (or Solaris
>for that matter) at this point in time since I can not set
>the SO_RCVBUF larger than 64K.
>..

>Any ideas on how I can change this on Linux (or Solaris
>for that matter)? Will I have to recompile the kernel?

Have you already tried using threads,and having one that is dedicated to
waiting on the socket and draining the buffer as quickly as possible?


--
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]
S.1618 http://thomas.loc.gov/cgi-bin/bdquery/z?d105:SN01618:@@@D
http://www.spamlaws.com/state/ca1.html

Allen McIntosh

unread,
Sep 1, 2002, 5:23:47 PM9/1/02
to
>On Wed, 14 Aug 2002 05:43:47 GMT, ter...@yahoo.com wrote:
>>I am developing an app that will received quite a few UDP
>>packages over a very short period of time. The problem is
>>that I am not able to do this properly on Linux (or Solaris
>>for that matter) at this point in time since I can not set
>>the SO_RCVBUF larger than 64K.
>>..
>>Any ideas on how I can change this on Linux (or Solaris
>>for that matter)? Will I have to recompile the kernel?

On Linux, with a 2.4 series kernel, you can change the value of
/proc/sys/net/core/rmem_max

Lew Pitcher

unread,
Sep 2, 2002, 9:50:03 PM9/2/02
to
On Wed, 14 Aug 2002 05:43:47 GMT, ter...@yahoo.com wrote:

>I am developing an app that will received quite a few UDP
>packages over a very short period of time. The problem is
>that I am not able to do this properly on Linux (or Solaris
>for that matter) at this point in time since I can not set
>the SO_RCVBUF larger than 64K.
>..
>Any ideas on how I can change this on Linux (or Solaris
>for that matter)? Will I have to recompile the kernel?

Well, since SO_RCVBUF seems to be the buffersize for _one_ packet, it
appears that the call is checking that the size doesn't exceed the max
size of a single packet under IPv4.

Perhaps if you explained your intended technique, we could come up with
an alternate solution.

--
Lew Pitcher

Master Codewright and JOAT-in-training
Registered (Slackware) Linux User #112576 (http://counter.li.org/)

Rick Jones

unread,
Sep 3, 2002, 7:45:00 PM9/3/02
to
In comp.unix.solaris Terje A. Bergesen <ter...@yahoo.com> wrote:
> On Win2K which is the third platform this app must run on, I can set
> the receive buffer to more or less any size I wish, and Win2K is
> therefore able to survive the storm.

So long as the storm is short enough...

rick jones
--
Wisdom Teeth are impacted, people are affected by the effects of events.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...

Alfredo Cabrera

unread,
Sep 11, 2002, 10:13:07 AM9/11/02
to
under solaris 2.6 and up you can use ndd to set the /dev/udp parameters
including buffer sizes, for example :

ndd -set /dev/udp udp_recv_hiwat 65536

According to the documentation you can use setsockopt to set SO_RCVBUF,
so changing the value using ndd should not be necessary.

The man page for setsockopt also mentions that there is a 256K setting for
max_buf for both tcp and udp so your socket can at any point in time grow
up to that much.

Alfredo Cabrera
0 new messages