From owner-freebsd-current@FreeBSD.ORG Mon Apr 12 16:16:30 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8FAB16A4CE for ; Mon, 12 Apr 2004 16:16:30 -0700 (PDT) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DA4043D58 for ; Mon, 12 Apr 2004 16:16:30 -0700 (PDT) (envelope-from tim@kientzle.com) Received: from kientzle.com (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id i3CNGT90017517; Mon, 12 Apr 2004 16:16:29 -0700 (PDT) (envelope-from tim@kientzle.com) Message-ID: <407B234D.7070209@kientzle.com> Date: Mon, 12 Apr 2004 16:16:29 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: current@freebsd.org References: <11095.1081621779@critter.freebsd.dk> <407B1EBC.6050405@freebsd.org> In-Reply-To: <407B1EBC.6050405@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Poul-Henning Kamp Subject: Re: Optimizing RCng execution speed ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2004 23:16:31 -0000 Poul-Henning Kamp wrote: > > Is anybody working on optimizing RCng execution speed ? > > I think our boottime is getting a bit too slow these days... I haven't tested the performance impact, but I've long been suspicious of the way that RCng executes every script in /etc/rc.d even if the corresponding functionality is disabled. For example, even if you've disabled all Kerberos functionality, /etc/rc.d/kadmind will still get loaded and executed just so it can test the kadmind5_server_enable variable and abort immediately. If rcorder could prune out such obviously-disabled scripts, then that might make a difference. For example, we might add a new keyline to scripts: ONLY_IF: kadmind5_server_enable or enforce a naming convention (the "kadmind_enable" variable controls whether the "kadmind" script gets run). In this way, rcorder could pull in /etc/rc.conf, then scan and order the available scripts, omitting any that were clearly disabled. Obviously, some scripts require more complex "enabled" checking, but simple logic in rcorder should be able to prune out the majority of the disabled scripts without actually running them. Tim Kientzle P.S. There was a discussion about a year ago on one of the mailing lists about the best way for a C program to obtain the settings from rc.conf. The best approach was to fork a shell and have it parse rc.conf and (via a simple helper program) spit out the resulting environment to be read in by the program.