From owner-freebsd-performance@FreeBSD.ORG Tue Jun 29 17:18:42 2004 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B648416A4CE for ; Tue, 29 Jun 2004 17:18:42 +0000 (GMT) Received: from utils.dsgx.org (Fadel.org [66.90.92.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B12C43D2F for ; Tue, 29 Jun 2004 17:18:42 +0000 (GMT) (envelope-from fabulous@t7ds.com.br) Received: from mx2.brasnet.org (irc.uninet.com.br [200.220.31.194]) by utils.dsgx.org (Postfix) with ESMTP id 8EAB7D7A492 for ; Tue, 29 Jun 2004 14:18:29 -0300 (BRT) Received: from [201.9.183.163] (localhost [127.0.0.1]) by mx2.brasnet.org (Postfix) with ESMTP id 93349123 for ; Tue, 29 Jun 2004 14:18:08 -0300 (BRT) Message-ID: <40E1A47D.6020709@t7ds.com.br> Date: Tue, 29 Jun 2004 14:18:53 -0300 From: fabulous User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a1) Gecko/20040520 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-performance@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: net.inet.tcp.sendspace X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jun 2004 17:18:42 -0000 Is there any way to change its value according to the connection's uid or port? I need small sendspaces to ircd and bigger ones to apache.. regards.. ps.: freebsd 5.2.1 From owner-freebsd-performance@FreeBSD.ORG Tue Jun 29 17:36:42 2004 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BAC016A4CE for ; Tue, 29 Jun 2004 17:36:42 +0000 (GMT) Received: from mail.trippynames.com (mail.trippynames.com [216.143.148.128]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E57D43D54 for ; Tue, 29 Jun 2004 17:36:42 +0000 (GMT) (envelope-from sean@chittenden.org) Received: from localhost (localhost [127.0.0.1]) by mail.trippynames.com (Postfix) with ESMTP id B87FDA715C; Tue, 29 Jun 2004 10:36:41 -0700 (PDT) Received: from mail.trippynames.com ([127.0.0.1]) by localhost (rand.nxad.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 77731-05; Tue, 29 Jun 2004 10:36:40 -0700 (PDT) Received: from [192.168.102.100] (dsl081-160-109.sea1.dsl.speakeasy.net [64.81.160.109]) by mail.trippynames.com (Postfix) with ESMTP id 4FD55A1320; Tue, 29 Jun 2004 10:36:40 -0700 (PDT) In-Reply-To: <40E1A47D.6020709@t7ds.com.br> References: <40E1A47D.6020709@t7ds.com.br> Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Sean Chittenden Date: Tue, 29 Jun 2004 10:36:38 -0700 To: fabulous X-Mailer: Apple Mail (2.618) cc: freebsd-performance@freebsd.org Subject: Re: net.inet.tcp.sendspace X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jun 2004 17:36:42 -0000 > Is there any way to change its value according to the connection's uid > or port? Not with sysctl(8). You can by hacking the application and adding a few setsockopt(2) calls, specifically the SO_RCVBUF and SO_SNDBUF options. Here's a sample snippit you could follow: /* Add these #includes if they aren't already there */ #include #include /* Add this to the top of the function that calls listen(2) */ int rcvbuf = 4096; int sndbuf = 4096; /* And add these calls before the application makes its listen(2) call. You may find that some applications are already setting their send and receive buffer sizes. */ if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)) != 0) err(EX_OSERR, "setsockopt(2) for SO_RCVBUF failed"); if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf)) != 0) err(EX_OSERR, "setsockopt(2) for SO_SNDBUF failed"); > I need small sendspaces to ircd and bigger ones to apache.. Add the above to each of the applications before they make their listen(2) calls. It's a shame more applications don't let you tweak this value via a config file. -sc -- Sean Chittenden From owner-freebsd-performance@FreeBSD.ORG Wed Jun 30 16:49:49 2004 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDE8816A4CE for ; Wed, 30 Jun 2004 16:49:49 +0000 (GMT) Received: from utils.dsgx.org (Fadel.org [66.90.92.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 69F0E43D55 for ; Wed, 30 Jun 2004 16:49:49 +0000 (GMT) (envelope-from fabulous@t7ds.com.br) Received: from mx2.brasnet.org (irc.uninet.com.br [200.220.31.194]) by utils.dsgx.org (Postfix) with ESMTP id E96C3D7A543 for ; Wed, 30 Jun 2004 13:49:31 -0300 (BRT) Received: from [201.9.183.163] (localhost [127.0.0.1]) by mx2.brasnet.org (Postfix) with ESMTP id 35A3613C for ; Wed, 30 Jun 2004 13:49:02 -0300 (BRT) Message-ID: <40E2EF4D.3050508@t7ds.com.br> Date: Wed, 30 Jun 2004 13:50:21 -0300 From: fabulous User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a1) Gecko/20040520 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-performance@freebsd.org References: <40E1A47D.6020709@t7ds.com.br> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: net.inet.tcp.sendspace X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2004 16:49:49 -0000 Thank you very very much.. but sysctl sendspace/recvspace will be the limits then? can I set SO_SNDBUF to something higher than tcp.sendspace? I'm thinking of setting tcp.sendspace to 64k and using setsockopt on ircd to set it to 2k (why an irc connection would need more than that?), so apache will use 64k and ircd 2k.. am I right? :P []'s Sean Chittenden wrote: >> Is there any way to change its value according to the connection's uid >> or port? > > > Not with sysctl(8). You can by hacking the application and adding a few > setsockopt(2) calls, specifically the SO_RCVBUF and SO_SNDBUF options. > Here's a sample snippit you could follow: > > /* Add these #includes if they aren't already there */ > #include > #include > > /* Add this to the top of the function that calls listen(2) */ > int rcvbuf = 4096; > int sndbuf = 4096; > > /* And add these calls before the application makes its listen(2) call. > You may find that some applications are already setting their send and > receive buffer sizes. */ > if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)) != 0) > err(EX_OSERR, "setsockopt(2) for SO_RCVBUF failed"); > > if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf)) != 0) > err(EX_OSERR, "setsockopt(2) for SO_SNDBUF failed"); > >> I need small sendspaces to ircd and bigger ones to apache.. > > > Add the above to each of the applications before they make their > listen(2) calls. It's a shame more applications don't let you tweak > this value via a config file. > > -sc > From owner-freebsd-performance@FreeBSD.ORG Wed Jun 30 17:33:06 2004 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87C1A16A4CE for ; Wed, 30 Jun 2004 17:33:06 +0000 (GMT) Received: from mail.trippynames.com (mail.trippynames.com [216.143.148.128]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C28543D31 for ; Wed, 30 Jun 2004 17:33:06 +0000 (GMT) (envelope-from sean@chittenden.org) Received: from localhost (localhost [127.0.0.1]) by mail.trippynames.com (Postfix) with ESMTP id 664DEAAB97; Wed, 30 Jun 2004 10:32:54 -0700 (PDT) Received: from mail.trippynames.com ([127.0.0.1]) by localhost (rand.nxad.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 02678-08; Wed, 30 Jun 2004 10:32:53 -0700 (PDT) Received: from [192.168.102.100] (dsl081-160-109.sea1.dsl.speakeasy.net [64.81.160.109]) by mail.trippynames.com (Postfix) with ESMTP id 164D6AAB86; Wed, 30 Jun 2004 10:32:53 -0700 (PDT) In-Reply-To: <40E2EF4D.3050508@t7ds.com.br> References: <40E1A47D.6020709@t7ds.com.br> <40E2EF4D.3050508@t7ds.com.br> Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <83A6DC4F-CABB-11D8-B344-000A95C705DC@chittenden.org> Content-Transfer-Encoding: 7bit From: Sean Chittenden Date: Wed, 30 Jun 2004 10:32:52 -0700 To: fabulous X-Mailer: Apple Mail (2.618) cc: freebsd-performance@freebsd.org Subject: Re: net.inet.tcp.sendspace X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2004 17:33:06 -0000 > Thank you very very much.. but sysctl sendspace/recvspace will be the > limits then? Yes. > can I set SO_SNDBUF to something higher than tcp.sendspace? Hrm... tcp(4) is a bit ambiguous about this: MIB Variables The TCP protocol implements a number of variables in the net.inet.tcp branch of the sysctl(3) MIB. TCPCTL_SENDSPACE (sendspace) Maximum TCP send window. TCPCTL_RECVSPACE (recvspace) Maximum TCP receive window. I don't know if setsockopt(2) will allow you to exceed these values. I don't see anything in setsockopt(2) that suggests that you can't exceed TCPCTL_SENDSPACE with setsockopt(2). > I'm thinking of setting tcp.sendspace to 64k and using setsockopt on > ircd to set it to 2k (why an irc connection would need more than > that?), so apache will use 64k and ircd 2k.. am I right? :P This is a wise course of action given the uncertainty of setsockopt(2) and the net.inet.tcp.* interaction. I'd grep through the source and give you a definitive answer but am busy/too lazy at the moment. :) -sc -- Sean Chittenden From owner-freebsd-performance@FreeBSD.ORG Fri Jul 2 22:48:10 2004 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7C5316A4CE for ; Fri, 2 Jul 2004 22:48:10 +0000 (GMT) Received: from mars.webnext.com (mars.webnext.com [213.161.193.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6965D43D48 for ; Fri, 2 Jul 2004 22:48:10 +0000 (GMT) (envelope-from apignard@frontier.fr) Received: from portarn.frontier.fr (alfortville-6-82-66-251-138.fbx.proxad.net [82.66.251.138]) by mars.webnext.com (Postfix) with ESMTP id 4F4E29BE5E for ; Sat, 3 Jul 2004 00:47:07 +0200 (CEST) Message-Id: <6.1.1.1.2.20040703004545.07e22690@213.161.193.184> X-Sender: arnaud@213.161.193.184 X-Mailer: QUALCOMM Windows Eudora Version 6.1.1.1 Date: Sat, 03 Jul 2004 00:47:53 +0200 To: freebsd-performance@freebsd.org From: Arnaud Pignard In-Reply-To: <40E1A47D.6020709@t7ds.com.br> References: <40E1A47D.6020709@t7ds.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable Subject: net.inet.ip.intr_queue_maxlen X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2004 22:48:10 -0000 Is there a way to know the limit of queue_maxlen on network card ? Especially with em & fxp. Regards, --=20 Arnaud Pignard (apignard@frontier.fr) Frontier Online - Op=E9rateur Internet