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 1eo2sr-0008G3-Q5 for pgsql-general@arkaria.postgresql.org; Tue, 20 Feb 2018 08:02:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eo2sq-0005Zm-Sx for pgsql-general@arkaria.postgresql.org; Tue, 20 Feb 2018 08:02:40 +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.84_2) (envelope-from ) id 1eo2sq-0005Zd-Kz for pgsql-general@lists.postgresql.org; Tue, 20 Feb 2018 08:02:40 +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 1eo2so-000650-9o for pgsql-general@lists.postgresql.org; Tue, 20 Feb 2018 08:02:39 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (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 EAC2240FFB; Tue, 20 Feb 2018 09:02:35 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id lI-dZYoCsTTX; Tue, 20 Feb 2018 09:02:30 +0100 (CET) Message-ID: <1519113748.2482.2.camel@cybertec.at> Subject: Re: Performance issues during backup From: Laurenz Albe To: Dylan Luong , "pgsql-general@lists.postgresql.org" Date: Tue, 20 Feb 2018 09:02:28 +0100 In-Reply-To: <7cf3e053324e4946a8468f4a5989fc3b@ITUPW-EXMBOX3B.UniNet.unisa.edu.au> References: <7cf3e053324e4946a8468f4a5989fc3b@ITUPW-EXMBOX3B.UniNet.unisa.edu.au> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dylan Luong wrote: > We perform nighty base backup of our production PostgreSQL instance. We have a script that basically puts the instance > into back mode and then backs up (tar) the /Data directory and then takes it out of backup mode. > Ie, > psql -c "SELECT pg_start_backup('${DATE}');" > tar -cvf - ${DATA_DIR} --exclude ${DATA_DIR}/pg_log | split -d -b $TAR_SPLIT_SIZE - ${BACKUP_DIR}/${BACKUP_NAME} > psql -c "SELECT pg_stop_backup();" > > The size of our database is about 250GB and it usually takes about 1 hour to backup. > During this time, we have performance issue where queries can take up to 15secs to return where normally it takes 2 to 3 seconds. > During this time (1:30am) usage is low (less than 10 users) on the system. > > Has anyone experience the same problem and any suggestions where to look at to resolve the problem? The "tar" is probably taking up too much I/O bandwidth. Assuming this is Linux, you could run it with ionice -c 2 -n 7 tar ... or ionice -c 3 tar ... Of course then you can expect the backup to take more time. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com