Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pdtI1-0000vx-6N for pgsql-general@arkaria.postgresql.org; Sun, 19 Mar 2023 13:41:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pdtHy-0005EW-9O for pgsql-general@arkaria.postgresql.org; Sun, 19 Mar 2023 13:41:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pdtHx-0005EN-LS for pgsql-general@lists.postgresql.org; Sun, 19 Mar 2023 13:41:33 +0000 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pdtHs-00062g-Gh for pgsql-general@lists.postgresql.org; Sun, 19 Mar 2023 13:41:32 +0000 Received: by mail-qt1-x832.google.com with SMTP id ek9so10384258qtb.10 for ; Sun, 19 Mar 2023 06:41:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joeconway.com; s=google; t=1679233287; h=content-transfer-encoding:in-reply-to:subject:from:references:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=tKOkDQcrvPl6GJJR9etA83ZSGSW4tshcNdMc687VtCg=; b=awWWQP90eosVlp6eV8WNe3HDOFrK02/fvDeeaWOHs2yT3Kfij8tpfHA0/ZWt08qpJ5 N6PNyjG/wFYGwcBAshSNIQuyVgJbYDGVgcQevzfpeuydkljdS16QWD3wZVKwQ0N5XOC6 eI05WQoqCDSt9Qe2IxQD2FojpMC2iGl432XjKGDlgTEayg/DYK17R/UBNhwrY9WYn0Nz la2CsianUtqUdF3uXmn/chvmjfDg0Ll8WC2rzitI/FiwW/t/FS+9Zj1wLmMdO3toT37O eaAu6oVX4GyqW3VUR06eoo35oQC9/Uciyzd8jROSOh6ZYZohXWxlJV64aSUmVtcOp6Fq gDTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679233287; h=content-transfer-encoding:in-reply-to:subject:from:references:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tKOkDQcrvPl6GJJR9etA83ZSGSW4tshcNdMc687VtCg=; b=pZeBZMoBviY3gx5+bX8FnUKyCQhap06WLbgyYgaifXnLEBuA+7/ph/7tjLrsMUW3sL W2FFwJjSzf29cj/2IcPFPc/nWjaFL0J47QJJPryj7j8/xGch3puzNvzMuImqCAcQtkZC LRSBXbaSs5n52VSTfiYMp0wVPb7IE11NaylkFoJW6c3OhSUpbTU3NbyGfl2cZZ50wpCV /PZlen0bb1NRlmXOO1ubqiB1eKdKlVaaIMrGNyM0h5PX+oeaP+HJQtMTX2amzbuvfSVq LA1ni8GcHBjmmdKzTuIp7MFZ5KrgGNIl/o825r6+ROdSMtOgULEl0W1WToFblvSheUV4 yYBw== X-Gm-Message-State: AO0yUKWjtLpWZsIdMIRUBIMnA9QnsKVpjtl7GrDqCTJLhI8FIx/afrUn uzddwZYQ/dV48l9axXeXvQY0iQ== X-Google-Smtp-Source: AK7set+ThY6oKdLSJcqjAyfDbwtaBYParkOnHoS/G59wKV2b4yhuTx+XjIJawWnqYS11VZyAP5HGvw== X-Received: by 2002:a05:622a:58f:b0:3d0:7f38:bf80 with SMTP id c15-20020a05622a058f00b003d07f38bf80mr21223977qtb.27.1679233287007; Sun, 19 Mar 2023 06:41:27 -0700 (PDT) Received: from [192.168.4.41] (162-239-31-113.lightspeed.dybhfl.sbcglobal.net. [162.239.31.113]) by smtp.gmail.com with ESMTPSA id x26-20020ac86b5a000000b003bfa2c512e6sm4843042qts.20.2023.03.19.06.41.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Mar 2023 06:41:26 -0700 (PDT) Message-ID: <7bdf809f-c6f0-6fd0-c606-9ee9ed01885a@joeconway.com> Date: Sun, 19 Mar 2023 09:41:25 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Tomas Pospisek , pgsql-general@lists.postgresql.org References: <20230313174301.23n6crb5dpttozup@hjp.at> <03239776-b0c6-94a8-7bb3-a1af363d745f@joeconway.com> <9616AB47-E78B-49FD-81AE-41015E13AADC@alaska.edu> <3E19F901-6C7D-44C1-BBFE-11F78F9EE38C@alaska.edu> <7B4AC414-F5C9-46E8-969E-B629414719FA@alaska.edu> <579584ee-3980-499a-ffdb-40f45f0e80f3@sourcepole.ch> From: Joe Conway Subject: Re: Properly handle OOM death? In-Reply-To: <579584ee-3980-499a-ffdb-40f45f0e80f3@sourcepole.ch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/18/23 18:02, Tomas Pospisek wrote: > On 13.03.23 21:25, Joe Conway wrote: > >> Hmm, well big +1 for having swap turned on, but I recommend setting >> "vm.overcommit_memory=2" even so. > > I've snipped out the context here, since my advice is very unspecific: > do use swap only as a safety net. Once your system starts swapping > performance goes down the toilet. While I agree with this statement in principle, it is exactly the notion that "once your system starts swapping performance goes down the toilet" that leads people to conclude that having lots of memory and disabling swap will solve all their problems. Because of how the Linux kernel works, you should, IMHO, always have some swap available. For more on why, see: https://chrisdown.name/2018/01/02/in-defence-of-swap.html -- Joe Conway PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com