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 1stmHh-001X87-6M for pgsql-general@arkaria.postgresql.org; Thu, 26 Sep 2024 11:03:45 +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 1stmHg-006hJF-JU for pgsql-general@arkaria.postgresql.org; Thu, 26 Sep 2024 11:03:44 +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 1stmHg-006hJ4-7v for pgsql-general@lists.postgresql.org; Thu, 26 Sep 2024 11:03:44 +0000 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1stmHd-001951-DQ for pgsql-general@lists.postgresql.org; Thu, 26 Sep 2024 11:03:43 +0000 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-277dd761926so522558fac.2 for ; Thu, 26 Sep 2024 04:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727348620; x=1727953420; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=vs7lH2yePEQ7wa2kkbgGnLTWRfwjXXwm70VnbVChaGU=; b=HqRDv/j6O0cX3hyYocRX/3t49wiMPubgY9ySm5c97WsrJgNAEmLI73bp4XrxCgCSYS x/54flyl9HBrOot9J4xsGbpzDvcoreQlr3fWDzheshm300c4MEW2oo0AeamfrToPQQyw KGRxQ4aqzxxrDRCqeTeZxGAVY/foiGQVkssvYeI60Gnjiq2U3vcrLVCi2SZGkaSYrWi2 2lTXjjswj4MS59UVq/UFXfHDnKHmGRJ/+z/9tr+FuEeHGpKDWjTsHWxwoA8eM24Y8VEx 8sCP3N1YQwAhW9pqGPyQd+zJxY/MLjGqFJsdngcd/JeDGQRLXQH62p0pINz7hYS2k5rr nSdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727348620; x=1727953420; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vs7lH2yePEQ7wa2kkbgGnLTWRfwjXXwm70VnbVChaGU=; b=hXGhHceR0u13O5stc0GpNbpmV6BcR20tJW5SGipS+Ii/Wab5nTJL/TKiOlinzHY2hT M3ZumIa3Ln+cc3/xykUYmgM3JvTyQJqXaFsth7TpuPiGLFVga4Usu06EbN6iJVf65TSG qf13/8UXX3nf6CcnoVfMq65ey4UPUEdoPx8xPJrM0ku6leEjn8azp0uxxvq4sUVt/BhO zPikEGAuzjS8DzooViREpwFpOfNv5eVQ7UM9u1M4GZ+nJAvQ1IsOFlyXQIwggtO5Dx+T KIvVFf+/YZGpIkQ4DpeEyhdFAzamPImtBpmHZgy5BA0HE207XBzaR315YUbpI3xaURDK VMEQ== X-Gm-Message-State: AOJu0Yxpewf5lb1J9HG5muP0bxVA1n9NsJd+1WTAgAZq0gbaQvMV0iC4 mMXlSR7gJH3fSOf4A9kt+8OQnn7yUUU8Pp3G4CwbNT40X7fQBXRQ+zyotp9TyFXCIAcSFcKZ20/ jQc3xrxIyI1Ctdxim9cD7sH61AnBdbsF6 X-Google-Smtp-Source: AGHT+IExCFBXH3DHLAGXAqvykRFlJPdqojuijR3URH0ED8Nfv1Acsm+L5NUceMa8i2noEwPyHcAI8OAMjPPFufGoxWA= X-Received: by 2002:a05:6870:1712:b0:277:f722:45e1 with SMTP id 586e51a60fabf-286e13dc514mr4634928fac.17.1727348620357; Thu, 26 Sep 2024 04:03:40 -0700 (PDT) MIME-Version: 1.0 From: yudhi s Date: Thu, 26 Sep 2024 16:33:28 +0530 Message-ID: Subject: Suggestion for memory parameters To: pgsql-general Content-Type: multipart/alternative; boundary="000000000000eb7dd4062303b0c9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000eb7dd4062303b0c9 Content-Type: text/plain; charset="UTF-8" Hello All, In a RDS postgres we are seeing some select queries when running and doing sorting on 50 million rows(as its having order by clause in it) , the significant portion of wait event is showing as "IO:BufFileWrite" and it runs for ~20minutes+. Going through the document in the link below, it states we should monitor the "FreeLocalStorage" metric and when monitoring that, I see it showing up to ~535GB as the max limit and when these queries run this goes down till 100GB. Note- (it's a R7g8xl instance) https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/apg-waits.iobuffile.html We were thinking of bumping up the work_mem to a higher value in database level , which is currently having size 4MB default. But we will also have ~100 sessions running at same time and majority were from other applications which execute other single row "insert" queries and I hope that will not need high "work_mem" . And setting it at database level will consume 100 times that set work_mem value. So how to handle this situation? Or Is it fine to let it use "FreeLocalStorage" unless it goes till zero? Also I am confused between the local storage (which is showing as 535GB) vs the memory/RAM which is 256GB for this instance class with ~128TB max storage space restriction, how are these storage different, (mainly the 535GB space which it's showing vs the 128TB storage space restriction)? Appreciate your guidance. select query looks something as below with no Joins but just single table fetch:- Select.... from where order by column1, column2 LIMIT $b1 OFFSET $B2 ; Regards Yudhi --000000000000eb7dd4062303b0c9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello All,

In a RDS postgres we are seeing some sel= ect queries when running and doing sorting on 50 million rows(as its having= order by clause in it) , the significant portion of wait event is showing = as "IO:BufFileWrite" and it runs for ~20minutes+. =C2=A0

G= oing through the document in the link below, it states we should monitor th= e "FreeLocalStorage" metric and when monitoring that, I see it sh= owing up to ~535GB as the max limit and when these queries run this goes do= wn till 100GB. Note-=C2=A0 (it's a R7g8xl instance)

https://docs.aws= .amazon.com/AmazonRDS/latest/AuroraUserGuide/apg-waits.iobuffile.html
We were thinking of bumping up the work_mem to a higher value in data= base level , which is currently having size 4MB default. But we will also h= ave ~100 sessions running at same time and majority were from other applica= tions which execute other single row "insert" queries and I hope = that will not need high "work_mem" . And setting it at database l= evel will consume 100 times that set work_mem value. So how to handle this = situation?
=C2=A0Or
=C2=A0Is it fine to let it use "FreeLocalSto= rage" unless it goes till zero?

Also I am confused between the = local storage (which is showing as 535GB) vs the memory/RAM which is 256GB = for this instance class with ~128TB max storage space restriction, how are = these storage different, (mainly the 535GB space which it's showing vs = the 128TB storage space restriction)?=C2=A0 Appreciate=C2=A0your guidance.<= br>
select query looks something as below with no Joins but just single = table fetch:-

Select....
from <table_name>
where
or= der by column1, column2 LIMIT $b1 OFFSET $B2 ;

Regar= ds
Yudhi
--000000000000eb7dd4062303b0c9--