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 1fBwX1-0003iY-OV for pgsql-admin@arkaria.postgresql.org; Fri, 27 Apr 2018 06:06:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBwX0-0008Iy-IJ for pgsql-admin@arkaria.postgresql.org; Fri, 27 Apr 2018 06:06:54 +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 1fBwX0-0008Io-4a for pgsql-admin@lists.postgresql.org; Fri, 27 Apr 2018 06:06:54 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fBwWw-0002Uq-GM for pgsql-admin@postgresql.org; Fri, 27 Apr 2018 06:06:53 +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 mx1.mailbox.org (Postfix) with ESMTPS id 237D344165; Fri, 27 Apr 2018 08:06:48 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id VDThOU15psOo; Fri, 27 Apr 2018 08:06:46 +0200 (CEST) Message-ID: <1524809191.2382.4.camel@cybertec.at> Subject: Re: vacuumdb causes memory drain. From: Laurenz Albe To: Sushil Shirodkar , Don Seiler Cc: "pgsql-admin@postgresql.org" In-Reply-To: References: , Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Date: Fri, 27 Apr 2018 08:06:31 +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. > > > > How are you measuring free memory? Memory might be listed in cached/buffers instead of > > free but is still available. Although that wouldn't then explain other processes being slow. > > I have put some small script which runs in a loop with "free -h" command, > while I am running "vacuumdb". Once I clear by "sync" or bounce PG, > everything runs normal afterward. Then I would say everything is fine. It is normal for a Linux system to have almost no free memory; the memory is used for the file system cache. Do you experience any problems, like reduced performance or high I/O? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com