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.94.2) (envelope-from ) id 1sWxb9-000i6O-11 for pgsql-general@arkaria.postgresql.org; Thu, 25 Jul 2024 12:29:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sWxb7-00EYLe-Ik for pgsql-general@arkaria.postgresql.org; Thu, 25 Jul 2024 12:29:29 +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.94.2) (envelope-from ) id 1sWxXz-00ETQD-9g for pgsql-general@lists.postgresql.org; Thu, 25 Jul 2024 12:26:15 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sWxXw-001N21-4N for pgsql-general@lists.postgresql.org; Thu, 25 Jul 2024 12:26:13 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a7ac469e4c4so86594766b.0 for ; Thu, 25 Jul 2024 05:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1721910370; x=1722515170; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=/fHDeAgeIZKaLfl5pjfxlJT/JhSQV4/WMEQHIpETrbA=; b=yJ5MrEk9yNyuZYwha0lPcDzpumvVvGXVE2o/3fc0rnBUXKScQVdicqpUePSAPMlc4p rQECyyuzJ1Cy6yQX0hYU54AgiU7ql62I1s8bPn3dAdGheOrItGPNu0xy91bIC4891BD8 2KyMywrolMVyaxwUuX/lNk3UfMU3kb/FkNuUi8BztVPprIHv5dqQ4chPF5vpkCK7VE45 Qtxg+LISXmkvjlBqOkErXsgMNlTzf+rpsRfsd0pxQnyLDPVa+qCI2L8GBevHXgys3Kij 2HCiI8u+NLFB48PKlmAEs3jChQhTB+JcZOz85hpZhl6t3yLP5tg0pWPfcQWjjH/W8wDY a4QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721910370; x=1722515170; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/fHDeAgeIZKaLfl5pjfxlJT/JhSQV4/WMEQHIpETrbA=; b=wWm4EC/X4UjzlnqudHMUjbDnIwqmlnVamo/It+r02cDI1znrQzmUCQgQDF2qvXXZYy bM8YgVf9EEraj0gvv8IhR/hkIJbKLgiD8o5uuo0bMhdagFuGvVjNIQfbz0YR66toovrG +VDhYk5/Yl0n9efI4/mnja6Giqjm0MRnzrvb8kqWGtwEF3/LCwRdeutt2PNEX0mZSsWN zYtJKdn7SOdy6RtzX7xx1sx77jIB7CuDuF2K1EJE+/v9ZuRL7XIb8JCSpDUi8BdAh+o8 HQBSZJuWwKchOmLt2eDh4tC0ibu0UJIMM+Juo7AqYe0ly1tDIfCiAgk8yEZYNVhxOmE0 03/Q== X-Forwarded-Encrypted: i=1; AJvYcCUBGVwNIG9bqeyDx+N+Uti0ruldNCOnndpIvIJXOk3quGa3xhjMPOiV67UttRU2pc/6bFsEVxIodiCkzfKEw/C8GcW7rp8uv89f1pf2Fhr/xzTH X-Gm-Message-State: AOJu0YxUhqPHoDQbP/r8oQb9nHB0SXdxtl6QTErzcWtvmoQqmqfnTDFj XHH/NT4f7i/qFMttGolfsu9d/pssbe/DiYsys3XtjDfi9ukzf7ezA5ST2plsT+M= X-Google-Smtp-Source: AGHT+IFBc3MqZ6uj8DusOJLWxqpNGOMYQdFuad+mxosnymHKnb10bQLZOPV4yri8R2aKYjGfRSdnew== X-Received: by 2002:a17:907:7b87:b0:a77:afd5:62aa with SMTP id a640c23a62f3a-a7ab2ff2b98mr504439566b.23.1721910369965; Thu, 25 Jul 2024 05:26:09 -0700 (PDT) Received: from [10.1.138.108] ([88.116.133.170]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acad4117asm67679266b.133.2024.07.25.05.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 05:26:09 -0700 (PDT) Message-ID: <201d6db4e58df881eb480008b6856fd7c34ee73f.camel@cybertec.at> Subject: Re: Memory issues with PostgreSQL 15 From: Laurenz Albe To: Christian =?ISO-8859-1?Q?Schr=F6der?= , "pgsql-general@lists.postgresql.org" Cc: Francisco Olarte , Tom Lane , Eric Wong Date: Thu, 25 Jul 2024 14:26:03 +0200 In-Reply-To: References: <3332.1717019021@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3 (3.52.3-1.fc40) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2024-07-25 at 10:58 +0000, Christian Schr=C3=B6der wrote: > The current error messages are similar to what we have seen before: >=20 > <2024-07-25 12:27:38 CEST - > LOG:=C2=A0 could not fork autovacuum worker= process: Cannot allocate memory > <2024-07-25 12:27:38 CEST - mailprocessor> ERROR:=C2=A0 could not resize = shared memory segment "/PostgreSQL.1226901392" to 189280 bytes: No space le= ft on device >=20 > As far as I understand, it does not make much sense to look into SysV sha= red > memory (which is what ipcs does). Indeed, there is only the same small sh= ared > memory segment as we have seen back then: >=20 > [...] > > Francisco and Tom both pointed at Posix shared memory instead; however, t= his > also does not seem to be used a lot: >=20 > # df -h /dev/shm > Filesystem=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Size=C2=A0 Used Avail Use% Mount= ed on > tmpfs=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 7.8G=C2= =A0 6.6M=C2=A0 7.8G=C2=A0=C2=A0 1% /dev/shm >=20 > We also still see a lot of available memory: >=20 > # free -m > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 total=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 used=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 free=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 shared=C2=A0= buff/cache=C2=A0=C2=A0 available > Mem:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 15882=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 6966=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 191=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2109=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 8725=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 6477 > Swap:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1999=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 271=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 1728 >=20 > Again, exactly the same situation as before. >=20 > Tom suggested that we hit some kernel limits, but I could not find any re= lated > kernel setting. The only limit I am aware of is the size of the /dev/shm = filesystem > itself. This could be changed, but the default value of 8 GB (which is ha= lf of > the machine's memory) seems to be enough (given that it is not even used)= . >=20 > Is there anything else I can analyze? Sorry again for reviving this old t= hread. It could be dynamic shared memory segments created temporarily during paral= lel query execution. Try setting "max_parallel_workers_per_gather =3D 0", that should make that = problem disappear. Yours, Laurenz Albe