From owner-freebsd-questions@FreeBSD.ORG Wed Aug 29 13:56:17 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63E271065670 for ; Wed, 29 Aug 2012 13:56:17 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5C28FC17 for ; Wed, 29 Aug 2012 13:56:16 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirg.bris.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1T6ikc-0004ds-D3 for freebsd-questions@freebsd.org; Wed, 29 Aug 2012 14:56:10 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1T6ikb-00050c-Sx for freebsd-questions@freebsd.org; Wed, 29 Aug 2012 14:56:10 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5) with ESMTP id q7TDu8MM055577 for ; Wed, 29 Aug 2012 14:56:08 +0100 (BST) (envelope-from mexas@mech-cluster241.men.bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5/Submit) id q7TDu7wO055575 for freebsd-questions@freebsd.org; Wed, 29 Aug 2012 14:56:07 +0100 (BST) (envelope-from mexas) Date: Wed, 29 Aug 2012 14:56:07 +0100 (BST) From: Anton Shterenlikht Message-Id: <201208291356.q7TDu7wO055575@mech-cluster241.men.bris.ac.uk> To: freebsd-questions@freebsd.org Subject: reduce priority of large port builds, e.g. firefox, gcc4x X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mexas@bristol.ac.uk List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 13:56:17 -0000 Is it possible to reduce priority of port building processes with something like "nice +19 make" (tcsh syntax)? Here's a typical scenario for a large build (actually building gcc-4.7 and firefox in parallel): last pid: 54736; load averages: 5.27, 5.38, 5.11 up 9+15:37:09 14:49:11 89 processes: 7 running, 79 sleeping, 2 zombie, 1 waiting CPU 0: 19.9% user, 46.3% nice, 33.8% system, 0.0% interrupt, 0.0% idle CPU 1: 15.4% user, 39.7% nice, 44.9% system, 0.0% interrupt, 0.0% idle Mem: 1141M Active, 3853M Inact, 1097M Wired, 128K Cache, 823M Buf, 1914M Free Swap: 13G Total, 16K Used, 13G Free PID UID THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 54720 0 1 89 10 111M 102M RUN 1 0:04 24.07% cc1plus 11 0 16 -76 - 0K 512K WAIT 0 26:55 11.33% intr 54732 0 1 85 10 87976K 77872K RUN 0 0:01 11.28% cc1plus 3289 1001 10 20 0 515M 387M uwait 0 163:26 3.47% firefox-bin 54721 1001 1 20 0 13656K 11744K CPU0 0 0:00 0.10% top 54731 0 1 49 10 14440K 12064K wait 0 0:00 0.10% g++ 54736 0 1 52 0 11240K 9856K biowr 0 0:00 0.00% as 54734 0 1 42 0 12176K 10992K wait 0 0:00 0.00% c++ 54735 0 1 72 0 17696K 11336K CPU1 1 0:00 0.00% cc1plus At such loads the system is noticeably slower. I'm not sure if nice has the same effect on all child processes, or only on the parent process? I'd like to set the make process and all its child processes to run only when there is some idle CPU. Is it feasible? Thanks Anton