From nobody Wed Jan 26 19:33:10 2022 X-Original-To: dev-commits-src-all@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 604C71971197; Wed, 26 Jan 2022 19:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JkYm62ChWz4dtY; Wed, 26 Jan 2022 19:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643225590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KqyO/x3dzqkMuJo+g2qShRR15Vkt+MgblKVtYrpq0lk=; b=G3LKDJueJxPuclT6J6RGRPbeqXOA6sWmZtFnfORfCQ3M9/oG1a33cwogA7H21EB2l1S5DY o8VdrXTJSdXVlasKCR8Ht3He0rgqbVOJ+t5+wZdYmHn0LaEIKKTYSl0U4QvLjh44dMJi9m MS2fu3NTHiftKlVEl513x+lBJGNCEDPIJUPLHtZ3Ji2p6vEybcHJyovvBLJeFSMv/us6/Q Xy3VNh0voNW8Qf0uKabzDO1Xa70uG271BPhOYDBBS/8rOKtkVN/lGeFnk7OQifva5/8MQB bjl3G7KHbGuG6+O8392bJgD9HSFrNMHKJHsLfy2vkkr/et4mM1uZOY4BnU4PpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B4FF563; Wed, 26 Jan 2022 19:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20QJXAHq026072; Wed, 26 Jan 2022 19:33:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20QJXADp026071; Wed, 26 Jan 2022 19:33:10 GMT (envelope-from git) Date: Wed, 26 Jan 2022 19:33:10 GMT Message-Id: <202201261933.20QJXADp026071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 5cf00496537a - main - limit sort(1) memory usage to 20% of available main memory List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5cf00496537a27d0f4bece7f5783327b59c2146b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643225590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KqyO/x3dzqkMuJo+g2qShRR15Vkt+MgblKVtYrpq0lk=; b=LnR2kaGHfYul7nDD2JHucR1sj/N7MvOR2uWJZK+PyQfrK24FQ2xEpirPM2lMeL4H3fkhZh GFkQ3paC0tC1DRpKExbbHP1zyZpsOR7nS6si0ogWb/3ixGqOKMYcQI3N9kULmHU9a3ichu alS4FFqSe5VpWptaW4kfQlGbShXkpO4T1hvFRNCSeIyn19GlZogzPPDaqEYcSbrH/5/3w6 VF6UaETPJzl8I/uO4O8M+XB/qlqh0lg++v0Mqyrwd2ojGvLs+h9qWtHKuZ31yUf9hq8TLG TC5FAJfQifoECsHaTHBjoW7A3RZxBs76JqyhsykkrQlqRjSRnaSsolkbnJYPyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643225590; a=rsa-sha256; cv=none; b=oKighUSEqP1T0eytY4PYQjK97+UCQJbDIKc+ZaC0AeW2O9k/N9oF0/7C79tbsxWaRr4U+d rSyObg+uIrJ/MmvlYWxpgdyZX4ylZRx5bj9hgy2W9Gz94DXTtk+GQtyEeaggVr8HQe/7BD /AoEX0RaQP3ZKD5AGHCiDE4aiFB9yxo50d5uuRUspxgAhtlw2/o+Vu1DIdJkLn4qc2fYIp qr7hxYq+duIPYNyRrW2LUNEuKznCc2mv65piQDyja5CrUPjHBL4f0Sc/xRIJ6SKqfk30ai E3ymcp1aMdD/YznRVJ8BrtgrR4Q6nJn8BwXX9GXa8NN528OfWRdMq8hraKP2Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=5cf00496537a27d0f4bece7f5783327b59c2146b commit 5cf00496537a27d0f4bece7f5783327b59c2146b Author: Wolfram Schneider AuthorDate: 2022-01-26 19:30:11 +0000 Commit: Wolfram Schneider CommitDate: 2022-01-26 19:30:11 +0000 limit sort(1) memory usage to 20% of available main memory By default BSD sort(1) uses 90% (or at least 50%?) of the available main memory. That is good for performance for a single job, but not for a shared OS. For a long running script the performance is less important than the stability of the server. Also, if a server with 64GB RAM starts swapping, the performance goes south and hurts other running applications. Note: this change does not affect the weekly cron job to rebuild the locate database. The FreeBSD locate.updatedb use the -presort option (find -s) --- usr.bin/locate/locate/mklocatedb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/locate/locate/mklocatedb.sh b/usr.bin/locate/locate/mklocatedb.sh index 284ea6416493..e838c9795820 100644 --- a/usr.bin/locate/locate/mklocatedb.sh +++ b/usr.bin/locate/locate/mklocatedb.sh @@ -52,7 +52,7 @@ fi : ${sort:=sort} -sortopt="-u -T $TMPDIR" +sortopt="-u -T $TMPDIR -S 20%" sortcmd=$sort