From owner-freebsd-questions@freebsd.org Sun Jul 26 15:39:26 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC54D36399C for ; Sun, 26 Jul 2020 15:39:26 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: from kicp.uchicago.edu (kicp.uchicago.edu [128.135.20.70]) by mx1.freebsd.org (Postfix) with ESMTP id 4BF6Yn5hhfz3TKj for ; Sun, 26 Jul 2020 15:39:25 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: from [192.168.43.113] (unknown [172.58.142.216]) (Authenticated sender: galtsev) by kicp.uchicago.edu (Postfix) with ESMTPSA id 63BC84E674 for ; Sun, 26 Jul 2020 10:39:19 -0500 (CDT) Subject: Re: Ask stupid questions and you'll get a stupid answers, was: Technological advantages over Linux To: freebsd-questions@freebsd.org References: <20200725152412.GJ92589@admin.sibptus.ru> <20200725162403.GA4721@admin.sibptus.ru> <20200725182554.deffc63058a7c9f6d343ef06@sohara.org> <04df312d-9b2b-1873-2117-79a49e089bd9@kicp.uchicago.edu> <20200726063256.GA22924@admin.sibptus.ru> <20200726093909.ee5e14e643d31da4dad5c804@sohara.org> <20200726151835.GA35966@admin.sibptus.ru> From: Valeri Galtsev Message-ID: <27ca8c6c-6b06-6ad4-7af0-2b88f51a3856@kicp.uchicago.edu> Date: Sun, 26 Jul 2020 10:39:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200726151835.GA35966@admin.sibptus.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BF6Yn5hhfz3TKj X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=uchicago.edu (policy=none); spf=none (mx1.freebsd.org: domain of galtsev@kicp.uchicago.edu has no SPF policy when checking 128.135.20.70) smtp.mailfrom=galtsev@kicp.uchicago.edu X-Spamd-Result: default: False [0.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[172.58.142.216:received]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_SPAM_MEDIUM(0.13)[0.132]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_SHORT(-0.38)[-0.381]; NEURAL_SPAM_LONG(0.45)[0.447]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:160, ipnet:128.135.0.0/16, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[uchicago.edu : No valid SPF, No valid DKIM,none] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 15:39:26 -0000 On 7/26/20 10:18 AM, Victor Sudakov wrote: > Steve O'Hara-Smith wrote: >> >>> FreeBSD freezes, then kills some innocent random processes like >>> local_unbound, then it may slowly recover. Sometimes it guesses >>> correctly and kills the offender (firefox most often). >> >> What else would you have it do ? Kill the largest process ? Kill >> the last process to call malloc ? There is no good response to OOM. The OS >> has no way to know which processes you care about most. > I agree, Steve. Killing a process is a bad thing always. > AFAIK the Linux OOM killer uses multiple weighted criteria to decide > which process to kill. Each process has an oom_score showing its > eligibility to be killed. > My understanding of Linux OOM killer lies along same lines though my understanding is much more simplified: kill minimal number of processes to recover maximum amount of resources. Another speculative way to say it would be: process owning maximum amount of RAM that keeps allocating more RAM is first candidate. > So at least Linux attemps intelligent killing. What about FreeBSD? > Yes, but still I have to admit: killing a process is a bad thing. But under some circumstances it is better than system unresponsive for long time. In first case you can investigate logs of what process was killed etc. In second case if you had to press power button... That said, I never had any of my FreeBSD machines unresponsive. And that refers to a bunch of servers with dozens of jails, my workstation, my laptop. That probably is why I am so ignorant about Out Of Memory situation handling by FreeBSD. Never happened to me. I must confess, these are decently large RAM machines. No swap on servers and workstation. Swap of the same size as RAM (16GB) on laptop. And I still do not consider myself lucky. Valeri -- ++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++