From owner-freebsd-hackers Thu Oct 24 14:37:47 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3CA437B401 for ; Thu, 24 Oct 2002 14:37:45 -0700 (PDT) Received: from tomts16-srv.bellnexxia.net (tomts16.bellnexxia.net [209.226.175.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0C5843E77 for ; Thu, 24 Oct 2002 14:37:44 -0700 (PDT) (envelope-from ian@damnit.org) Received: from damnit.org ([142.177.225.46]) by simmts8-srv.bellnexxia.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20021024210744.UEZD17055.simmts8-srv.bellnexxia.net@damnit.org> for ; Thu, 24 Oct 2002 17:07:44 -0400 Message-ID: <3DB8611D.1040507@damnit.org> Date: Thu, 24 Oct 2002 18:07:41 -0300 From: Ian Campbell User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2 X-Accept-Language: en-us MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: sfbuf problems Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I wrote an httpd based around sendfile() for a moderately high traffic (50mbit or so) host. It chugs along happily for a couple hours before it eventually dies, locked in the sfbufa wait. We tried upping NSFBUFS a couple times up through 30000, to the point that there was no free kvm and it (predictably) panicked. The traffic isn't too much for the machine (dual 2ghz xeon, 2gb ram, 100/1000 nic), and the number of simultaneous connections is limited at 256. There's no obviously leak in either memory or fds, fstat and top back me up on that. The server doesn't thread or fork. I'm not sure how important it is, but it also uses kqueue/kselect and accf_http. I tried a hack sendfile replacement with write() and lseek(), just to see if that made a difference... but all it did was chew mbufs instead of sf_bufs ... How can I tell if I'm just using all available buffer space, or if it's just a leak I'm not seeing? How can I increase available kvm if it becomes necessary? As a side note, is kqueue thread safe? I'd be grateful for any help you can give me. --Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message