Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fD24U-0005WE-J8 for pgsql-admin@arkaria.postgresql.org; Mon, 30 Apr 2018 06:13:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fD24T-0006sA-LH for pgsql-admin@arkaria.postgresql.org; Mon, 30 Apr 2018 06:13:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fD24T-0006s0-Dn for pgsql-admin@lists.postgresql.org; Mon, 30 Apr 2018 06:13:57 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fD24Q-0002LN-7x for pgsql-admin@postgresql.org; Mon, 30 Apr 2018 06:13:56 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 7D04E40F2F; Mon, 30 Apr 2018 08:13:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id b_7c0x6F7UaK; Mon, 30 Apr 2018 08:13:40 +0200 (CEST) Message-ID: <1525066983.2466.5.camel@cybertec.at> Subject: Re: vacuumdb causes memory drain. From: Laurenz Albe To: Sushil Shirodkar Cc: "don@seiler.us" , "pgsql-admin@postgresql.org" In-Reply-To: <55DDA52C-9FA1-47FF-9E96-264A8522E7A1@hotmail.com> References: <1524809191.2382.4.camel@cybertec.at> <1524832787.2467.23.camel@cybertec.at> <55DDA52C-9FA1-47FF-9E96-264A8522E7A1@hotmail.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Date: Mon, 30 Apr 2018 07:43:03 +0200 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Sushil Shirodkar wrote: > > > > > > > On Thu, Apr 26, 2018 at 10:31 AM, Sushil Shirodkar wrote: > > > > > > > Running "vacuumdb -a -z -v" from the cron on one of our test environment, and > > > > > > > noticed that memory of the server goes down from 3.4GB free to 150MB. Once > > > > > > > the process is over, memory is not released, is it normal or something needs to be > > > > > > > changed ? also other processes start running slow afterwards due to low memory. > > Process which was running close to 99% memory was > "/usr/lib/postgresql/9.5/bin/postgres -D /var/lib/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf" > > free -h - was showing between 100-150 mb free. > > shared_buffers = 1GB > maintenance_work_mem = 256MB Can you share the "free -h" output? What do you get for ps -p -o rss,trs,drs,vsz,%mem if you substitute the postmaster's process ID? If you say that "sync" restored normal behavior, are you implying that there was a high I/O load? Still trying to figure out what exactly you are experiencing. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com