From owner-freebsd-net Tue Sep 24 12:30:51 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31A4237B401 for ; Tue, 24 Sep 2002 12:30:49 -0700 (PDT) Received: from mail4.uunet.ca (mail4.uunet.ca [209.167.141.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73EC443E42 for ; Tue, 24 Sep 2002 12:30:48 -0700 (PDT) (envelope-from kfl@xiphos.ca) Received: from tick ([216.95.199.148]) by mail4.uunet.ca with SMTP id <1033102-17801>; Tue, 24 Sep 2002 15:30:44 -0400 From: "kfl" To: "freebsd - net" , "Cheng Jin" Subject: RE: TCP receiving buffer Date: Tue, 24 Sep 2002 15:33:28 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Importance: Normal Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, If you want to set it more than 512KB you need to grow maxsockbuf so: #sysctl -w kern.ipc.maxsockbuf=2147483648 The waste factor is used (see /sys/kern/uipc_socket2.c) to make the socket buffer specifed a multiple of 8 (basically your buffers becomes a multiple of 32bits) for efficient usilisation of memory. good luck. Karim Fodil-Lemelin. Xiphos Technologies. -----Original Message----- From: owner-freebsd-net@FreeBSD.ORG [mailto:owner-freebsd-net@FreeBSD.ORG]On Behalf Of Cheng Jin Sent: Monday, September 23, 2002 7:23 PM To: freebsd-net@freebsd.org Subject: TCP receiving buffer Hi all, I am having a hard time setting TCP receiving buffer space to be large than 512K using setsockopt under FreeBSD 4.6.2-RELEASE #0. I have tried playing with various sysctl variables, but I can't seem to break the 512K barrier. I looked at my kernel config file and didn't really find any hard limit either. here are the systcl vars that I have tried. nmbclusters is small, but I should still be able to get about 12 MB of clusters. Any idea on what sockbuf_waste_factor is?? It was 8 by default. Do I have to reduce the number of sockets for this to work? kern.ipc.maxsockbuf: 4094305 kern.ipc.sockbuf_waste_factor: 4 kern.ipc.somaxconn: 512 kern.ipc.nmbclusters: 6656 kern.ipc.nmbufs: 26624 kern.ipc.maxsockets: 12328 net.inet.tcp.sendspace: 32768 net.inet.tcp.recvspace: 4094305 Please cc me a copy when you reply. Thank you very much, Cheng To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message