From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 18 14:13:31 2003 Return-Path: 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 EA64616A4B3 for ; Sat, 18 Oct 2003 14:13:31 -0700 (PDT) Received: from Princeton.EDU (postoffice02.Princeton.EDU [128.112.130.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CB0343FB1 for ; Sat, 18 Oct 2003 14:13:31 -0700 (PDT) (envelope-from yruan@cs.princeton.edu) Received: from smtpserver2.Princeton.EDU (smtpserver2.Princeton.EDU [128.112.129.148]) by Princeton.EDU (8.12.9/8.12.9) with ESMTP id h9ILDIdN010641; Sat, 18 Oct 2003 17:13:18 -0400 (EDT) Received: from cs.princeton.edu (targe.CS.Princeton.EDU [128.112.139.194]) (authenticated bits=0)h9ILDHf9017079 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Sat, 18 Oct 2003 17:13:17 -0400 (EDT) Message-ID: <3F91AC9D.DDCF0261@cs.princeton.edu> Date: Sat, 18 Oct 2003 17:11:57 -0400 From: Yaoping Ruan X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: rodrigc@crodrigues.org Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Benchmarking kqueue() performance? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2003 21:13:32 -0000 Hi, We've done some sort of tests in terms of the performance of kqueue( ) and select( ). We used a event-driven web server, which has both kevent() and select() implementation. We designed a workload called hot-cold test, which has multiple clients machines request up to thousands of persistent connections, but only dynamically pick some of them(1%, 2%, 5%, 15%) issue HTTP requests (hot connections), others just stay idle (cold connections). Thus a high cost event driven mechanism may spend more time picking up the right connections having real requests. The results show that the kqueue( ) has neglectable cost on throughput. But the select( ) version server has about 20% of the full bandwidth when 1% of the workloads are hot, but jump to 90% of the full bandwidth when 15% of the workloads are hot. I've put the two result graphs on: www.cs.princeton.edu/~yruan/flexiclient But I have to admit that we didn't scale the demand too much, just up to 2000 connections. (but the FD set for the queue should be larger since there're open files.) - Yaoping Ruan Computer Science Dept. Princeton University