From owner-freebsd-questions@FreeBSD.ORG Fri Jan 22 23:54:35 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDFA51065693 for ; Fri, 22 Jan 2010 23:54:35 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr16.xs4all.nl (smtp-vbr16.xs4all.nl [194.109.24.36]) by mx1.freebsd.org (Postfix) with ESMTP id 6C2248FC12 for ; Fri, 22 Jan 2010 23:54:34 +0000 (UTC) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr16.xs4all.nl (8.13.8/8.13.8) with ESMTP id o0MNsXGX011458; Sat, 23 Jan 2010 00:54:33 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 2F5E8BA98; Sat, 23 Jan 2010 00:54:33 +0100 (CET) Date: Sat, 23 Jan 2010 00:54:33 +0100 From: Roland Smith To: fpineda Message-ID: <20100122235433.GA35458@slackbox.xs4all.nl> References: <27280687.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline In-Reply-To: <27280687.post@talk.nabble.com> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: Re: Periodic maintenaince X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 23:54:36 -0000 --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 22, 2010 at 02:04:21PM -0800, fpineda wrote: >=20 > Hi! >=20 > I like to know how can I optimize the execution about periodic daily. I k= now > periodic execute is a set of scripts, but I have some problems with a > sepecific script: 450.status-security. >=20 > When this script is running by periodic_daily on cron, take some time to = end > and many times cause network errors like lost packets or timeouts. When t= he > script is executing I saw with top command that generate a procces called > "find" and it take all CPU resources while 450.status-security is executi= ng. >=20 > How can I optimize this script? This scripts calls /usr/sbin/periodic, which then executes all the scripts = in /etc/periodic/security.=20 With the command 'grep find /etc/periodic/security/*', you'll find that thr= ee scripts contain a find command; - /etc/periodic/security/100.chksetuid - /etc/periodic/security/800.loginfail - /etc/periodic/security/900.tcpwrap What you could do is prepend the find(1) commands with the nice(1) command,= to give the find commands lower priority. E.g. 'find -bla' then becomes '/usr/bin/nice -n 19 find -bla'.=20 Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --FCuugMFkClbJLl1L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAktaOrkACgkQEnfvsMMhpyW1zACgiRkiK5P3PTXjB7ztTvQJZSkn t2sAnRyJGM6Cvp9eQEcOInfYjgfDQmGs =OM7N -----END PGP SIGNATURE----- --FCuugMFkClbJLl1L--