From owner-freebsd-rc@FreeBSD.ORG Fri Nov 6 15:10:32 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E52BE106566B for ; Fri, 6 Nov 2009 15:10:32 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id ADAC38FC1D for ; Fri, 6 Nov 2009 15:10:32 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C387235A856 for ; Fri, 6 Nov 2009 16:10:31 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id B7C53228C0; Fri, 6 Nov 2009 16:10:31 +0100 (CET) Date: Fri, 6 Nov 2009 16:10:31 +0100 From: Jilles Tjoelker To: freebsd-rc@freebsd.org Message-ID: <20091106151031.GA54363@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Subject: unnecessary check_process calls due to r179870 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2009 15:10:33 -0000 I noticed that r179870 considerably slows down startup on my qemu virtual machine running on an old box. Reverting it speeds up the /etc/rc part of the startup by about 30%. This is because with r179870 the check_process or check_pidfile (eval $_pidcmd) is executed even if the service is not enabled. It also seems strange that eval $_pidcmd is done even if $rc_fast is enabled. Skipping the eval if $rc_fast or $rc_quiet are enabled provides a similar speedup. One part of check_process that seems particularly slow is the ps ... -ax | while read loop. Now that pgrep is in /bin it may be faster to use that. -- Jilles Tjoelker