From owner-freebsd-performance@FreeBSD.ORG Mon Oct 23 06:21:08 2006 Return-Path: X-Original-To: freebsd-performance@freebsd.org 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 7566316A403 for ; Mon, 23 Oct 2006 06:21:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03D6843D4C for ; Mon, 23 Oct 2006 06:21:07 +0000 (GMT) (envelope-from adrian.chadd@gmail.com) Received: by wx-out-0506.google.com with SMTP id t4so1515459wxc for ; Sun, 22 Oct 2006 23:21:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=GIgQSRgxbhsPK/1CWh/AqBHddGQF9OMq+D/3ZI9embSVapjVsIyldqn0ThKkow2umwSK6CW5Vxy8YpoA/rLx/L1LcG40WeNZaB6+aM9n9pgX5LlEUw9qTjitmSbWqLJkjzArtHhmV+yxeWa9JHmCs60doa/Ra5MuKjv7uY4lAK8= Received: by 10.90.80.8 with SMTP id d8mr1870942agb; Sun, 22 Oct 2006 23:21:07 -0700 (PDT) Received: by 10.90.66.16 with HTTP; Sun, 22 Oct 2006 23:21:07 -0700 (PDT) Message-ID: Date: Mon, 23 Oct 2006 14:21:07 +0800 From: "Adrian Chadd" Sender: adrian.chadd@gmail.com To: freebsd-performance@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 63cc204d4e5db403 Subject: kqueue examples? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2006 06:21:08 -0000 Hi all, I'm currently fiddling with writing a 'simple' TCP proxy for FreeBSD which uses kqueue to handle IO. I've been looking for examples of kqueue code which uses all the cute features of kqueue to "optimise" things, eg "hinting" at send/recv size, whether EOF has been seen, setting the buffer low watermark for triggering, that kind of thing. All I've found thus far (and I hope I'm not to blame for my initial hackings of kqueue in a few bits of software!) are simple level-triggered uses which don't seem much better than Linux epoll or Solaris /dev/poll. Even libevent uses it pretty naively. Has anyone come across some network software which uses kqueue "differently" to the above ? Thanks, Adrian -- Adrian Chadd - adrian@freebsd.org