From nobody Sat Feb 18 20:46:43 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK12455YSz3rZrH for ; Sat, 18 Feb 2023 20:46:52 +0000 (UTC) (envelope-from SRS0=zpMN=6O=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK1242NF8z3LBq for ; Sat, 18 Feb 2023 20:46:52 +0000 (UTC) (envelope-from SRS0=zpMN=6O=quip.cz=000.fbsd@elsa.codelab.cz) Authentication-Results: mx1.freebsd.org; none Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id D6EEED7893; Sat, 18 Feb 2023 21:46:44 +0100 (CET) Received: from [192.168.145.50] (ip-89-177-27-225.bb.vodafone.cz [89.177.27.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id ECD4FD788C; Sat, 18 Feb 2023 21:46:43 +0100 (CET) Message-ID: Date: Sat, 18 Feb 2023 21:46:43 +0100 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: avoiding periodic(8) during long poudriere runs Content-Language: cs-Cestina To: freebsd-hackers@freebsd.org References: From: Miroslav Lachman <000.fbsd@quip.cz> Cc: void@f-m.fm In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4PK1242NF8z3LBq X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:42000, ipnet:94.124.104.0/21, country:CZ] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 18/02/2023 18:03, void wrote: > Hello hackers@ > > Is there an established way of telling periodic to not run when load is > over a certain value? Or to delay running it until load goes (for > example) under 1.00 for 15 mins. I don't know about any generic way, but you can put some shell code into /etc/periodic.conf to exit if load is too high Just a quick and dirty example, exit if 5 minutes avg is higher than 1.1: avg5load=$(top | awk '/load averages:/ { load=$7+0; if (load > 1.1) { print "HIGH" } }') echo $avg5load if [ "$avg5load" = "HIGH" ]; then echo "CPU load is too high" exit 5 fi Kind regards Miroslav Lachman