Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vL6An-003xYe-1B for pgsql-general@arkaria.postgresql.org; Mon, 17 Nov 2025 20:50:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vL6Al-0020z3-35 for pgsql-general@arkaria.postgresql.org; Mon, 17 Nov 2025 20:50:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vL6Al-0020yt-1u for pgsql-general@lists.postgresql.org; Mon, 17 Nov 2025 20:50:03 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vL6Aj-0003BR-0p for pgsql-general@lists.postgresql.org; Mon, 17 Nov 2025 20:50:02 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-6419aaced59so6506806a12.0 for ; Mon, 17 Nov 2025 12:50:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1763412600; x=1764017400; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=DH2YZvkQVzRVRdcICLuVbkXyCNpyWK0cCyUKg+F0NJw=; b=Y/3PSmQeTwsBeEyU7oWR/P5TNTe5t1SX2BujjHzaAv71RirkzESnfuThTcqSSomsNF f1xMvC8/wOQYwe/VgfbyoWtbmC/PiAxcdBeaK60BLFuQeymbwQ5X2uEws/JZV4gceM3y pXC5YFTzAWPx4s0HsQWLIHn6sWz4YTs0ttImOoPzTRd69CZCXY/lEX1fHKSxBUK+eTZ+ kgA25zNAeod08qhFwxKvVGJ2dRmBWEImMjeS3pzxWj/1Eo+SFHi6LPD4esHNDjBUDke7 +XRazMuG/ET/wIcqAiLaU1N4LM7J6teD8TovnpeQrzq9r4JQBb02UEEE93hoMooJvVEP 3BMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763412600; x=1764017400; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DH2YZvkQVzRVRdcICLuVbkXyCNpyWK0cCyUKg+F0NJw=; b=wBU0wfFaa+fORF+wHXJtk2EZtmRfTWBohn9176+b26IvBGzWqu7yS4A7mbCgQ5e5Is zHed1kkaVL2qig61sldd8b2s9x3IbQmaT9OFnn3Rz+X/0H8/KYnFqvzbwr5pNJ/3cEiI SNe1NseXINakanE6nFjSuTvLMlq9KggMLsPKS6yZ2/7ZVFYqr9SSJ400siu1jk16+Uuz pMcKEQSZQUIczTGQRemd3O5gjkhZexfRdK/IjXgJ0c01iaAYhNnWvKpxLtwBeGcNwoVc hcBhgEhr6Yl/8zj8hEbNczQyk1gi4MuIN/GIdCQcKIzC+Sih8bpeuqQgt8WEeRQY7TNB w+zQ== X-Forwarded-Encrypted: i=1; AJvYcCVR7jFYIsg7lctSMesofxk5s33cDCqv9fYTXg2PwXXhbq5cvwqkrM7dAdWS2UO5j+h6EdWWcZgypzTJqeHJ@lists.postgresql.org X-Gm-Message-State: AOJu0YwPrCaroRGqgmd8lkCGwwoTAZYsI4VuEI6T41ohN9o8bd4+l5Ne ZENTNeRgi5FWyIUnTQQpoRhjDh4P3JDIec02CRaRQCayi8hs3T4m0xt1eGIi9Dzm8/ojKumoxX3 uyIEHIQc= X-Gm-Gg: ASbGncv4vt98cXXsGqR1GOcLOTq5ScWmMk64feCeoLt03YtLyz6zPsxVMQ7TUCVlMmJ 3nE8p2Qsb/0+jSOfzIETKH0RrJcjtynpWkgDtFvqTgJ6CIZ/ydMBUbn5zLSeMfmW7GvBdNzVZ2I UDWFpR/0LTfnLfxO12kfsoDMqSuNixqEVja9jnDYv7uGPa4ZJRImyFGaaqWjic7s3G3zk2zy2eY x1eKinerbDIHz+0ctERS35JSI8QtAaJliGjKxuzFja3R2VqMDKBA0l1pupZC/b452CutDjvgpE8 E+dBiZY2cP+8sWra/+/Y+fCmRCaNIvEvdLmvaf5ceViJXlg/axHjDkMWNbxyBAmnKYvieeZt9la //wol7z9NNIxOVHbj4AvgV/O4Ov4gPNpMfpQXDyj9UyQzzk3TiKeZGZvl/a/XQjnCyUsj5kKk4u TOexTx0MXbVMGyuu5DlBKhYr0ySyYHgP8T8/Dq/b8foHInMnB53Ko= X-Google-Smtp-Source: AGHT+IEQ4cqUZf3BG2RUM0DWtdR4ReD0pqMe6e1HS5kkmAfyoNA9P1VUvD8IGJuoJXJ5E1F/vXRw7g== X-Received: by 2002:a05:6402:1d4d:b0:641:7a6b:c849 with SMTP id 4fb4d7f45d1cf-64350e8d765mr12015350a12.17.1763412600445; Mon, 17 Nov 2025 12:50:00 -0800 (PST) Received: from laurenz.albe-K4N0CV00F97414D ([213.83.186.126]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6433a3d6f5bsm10967106a12.6.2025.11.17.12.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Nov 2025 12:50:00 -0800 (PST) Message-ID: Subject: Re: postgres in swap space From: Laurenz Albe To: Marc Millas , "pgsql-general@lists.postgresql.org" Date: Mon, 17 Nov 2025 21:49:59 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2025-11-17 at 18:25 +0100, Marc Millas wrote: > Can someone point me to any doc describing why and how much=C2=A0space po= stgres uses on the swap of a debian machine ? > it's an old postgres 10, because it is used by a product for which only t= his version is certified. > (no comment on that, please) I'm biting down a comment. PostgreSQL itself doesn't use any swap space. The kernel can decide to swap out memory used by PostgreSQL. How much that= is depends on how you configured the Linux kernel and how much memory PostgreSQL uses.= The latter is mostly determined by "shared_buffers", "work_mem", "maintenance_work_mem= " and "max_connections". On the kernel side, it is mostly the "vm.swappiness" parameter that determi= nes how eager the kernel is to swap out memory, even if there is no pressure. For = best performance, that should happen as little as possible, and the database sho= uld determine what to keep in memory and what to store on disk. One tool you have to prevent shared buffers from being swapped out is to de= fine enough Linux hugepages, so that PostgreSQL can allocate shared buffers there. Lin= ux does not swap out hugepages. You can find the PostgreSQL parameters described in the PostgreSQL document= ation and the kernel parameters in the kernel documentation. Yours, Laurenz Albe