From owner-freebsd-hackers Thu Jul 22 12: 8:39 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from ns1x.pvt.net (ns.pvt.net [194.149.105.18]) by hub.freebsd.org (Postfix) with ESMTP id AAE7314D82 for ; Thu, 22 Jul 1999 12:08:15 -0700 (PDT) (envelope-from papezik@pvt.net) Received: from mail1.pvt.net (news.pvtnet.cz [194.149.101.166]) by ns1x.pvt.net (8.9.3/8.9.3) with ESMTP id VAA10498 for ; Thu, 22 Jul 1999 21:08:11 +0200 Received: from pvt.net (papezik.pvt.net [194.149.103.213]) by mail1.pvt.net (8.9.3/8.9.3) with ESMTP id VAA19584; Thu, 22 Jul 1999 21:08:06 +0200 (CEST) Message-ID: <37976C03.A4A797A7@pvt.net> Date: Thu, 22 Jul 1999 21:07:47 +0200 From: Papezik Milon X-Mailer: Mozilla 4.51 [en] (X11; I; FreeBSD 3.2-RELEASE i386) X-Accept-Language: cs, cz, sk, en MIME-Version: 1.0 To: hackers@freebsd.org Subject: Squid - a bug in src/sys/kern/uipc_socket.c Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, please don't kill me if it's "well known issue": I've found that there is a report on Squid site, which describes a problem with FreeBSD IPC and includes suggested fix. I verified that this suggested fix is not included in 3.2-RELEASE. I wonder, if it is really a bug, as I cannot find it in PR database. Could someone please comment on this report/bug/suggested fix and if/when the fix could/will be submited? original URL: http://squid.nlanr.net/Squid/FAQ/FAQ-14.html#ss14.2 Thanks in advance, Milon -- papezik@pvt.net ------------ bug report and suggested fix --------- mbuf size We noticed an odd thing with some of Squid's interprocess communication. Often, output from the dnsserver processes would NOT be read in one chunk. With full debugging, it looks like this: 1998/04/02 15:18:48| comm_select: FD 46 ready for reading 1998/04/02 15:18:48| ipcache_dnsHandleRead: Result from DNS ID 2 (100 bytes) 1998/04/02 15:18:48| ipcache_dnsHandleRead: Incomplete reply ....other processing occurs... 1998/04/02 15:18:48| comm_select: FD 46 ready for reading 1998/04/02 15:18:48| ipcache_dnsHandleRead: Result from DNS ID 2 (9 bytes) 1998/04/02 15:18:48| ipcache_parsebuffer: parsing: $name www.karup.com $h_name www.karup.inter.net $h_len 4 $ipcount 2 38.15.68.128 38.15.67.128 $ttl 2348 $end Interestingly, it is very common to get only 100 bytes on the first read. When two read() calls are required, this adds additional latency to the overall request. On our caches running Digital Unix, the median dnsserver response time was measured at 0.01 seconds. On our FreeBSD cache, however, the median latency was 0.10 seconds. Here is a simple patch to fix the bug: =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_socket.c,v retrieving revision 1.40 retrieving revision 1.41 diff -p -u -r1.40 -r1.41 --- src/sys/kern/uipc_socket.c 1998/05/15 20:11:30 1.40 +++ /home/ncvs/src/sys/kern/uipc_socket.c 1998/07/06 19:27:14 1.41 @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94 - * $Id: FAQ.sgml,v 1.75 1999/07/06 16:07:36 wessels Exp $ + * $Id: FAQ.sgml,v 1.75 1999/07/06 16:07:36 wessels Exp $ */ #include @@ -491,6 +491,7 @@ restart: mlen = MCLBYTES; len = min(min(mlen, resid), space); } else { + atomic = 1; nopages: len = min(min(mlen, resid), space); /* Another technique which may help, but does not fix the bug, is to increase the kernel's mbuf size. The default is 128 bytes. The MSIZE symbol is defined in /usr/include/machine/param.h. However, to change it we added this line to our kernel configuration file: options MSIZE="256" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message