Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iG1Rk-0003bx-Cq for pgsql-general@arkaria.postgresql.org; Thu, 03 Oct 2019 13:47:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iG1Rj-0001Oy-22 for pgsql-general@arkaria.postgresql.org; Thu, 03 Oct 2019 13:47:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iG1Ri-0001On-Ku for pgsql-general@lists.postgresql.org; Thu, 03 Oct 2019 13:47:06 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iG1Rf-0006Vd-94 for pgsql-general@postgresql.org; Thu, 03 Oct 2019 13:47:05 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4830421C1B; Thu, 3 Oct 2019 09:47:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 03 Oct 2019 09:47:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=r 0T5sj46vMgLnIJF0gZUibewefbcH1VXNeD5kIq9mMg=; b=YHmexLuMDgx1F0BG/ GObnJQm2Bdm/oVd608vqSIWx+UxKFuW5+XYrvItsS+MQcQjaMaY6xOFjBTWOcdfK H1nRI69l/yWTNL7Y8PAZa9cKRGVKJag8UgCKALAC+7oZFJDALbR/uGnPd1xiPK7W BzAeyF/QI+cxeO9dJ31DZH4g67aAQ/keQ7Cr9VI6VnbGGCZNjrMCT6niivYgkM4F XLOe99GQLyobmoLz4W0fjCqtXV1t4uJJMyUn5KsmFszPOzPGB4Xrzg0z4IlLmEg/ 34peYm1P1GhtJN44j2nxZc/lw79XGfu3wboFU/8BcSR9HNchtJyV+nIsUuhy/Th6 r6IVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=r0T5sj46vMgLnIJF0gZUibewefbcH1VXNeD5kIq9m Mg=; b=I3Li240/TLDyGwr8CUmO1fOOr2tqE5447R72EYx03o9V8pFCdj83Gp6+s SEKkPfVH/D046RuoTFE+PC2rgKg0lKbrDUeFqk55epz34toL4N5NuLOdmpxRZSMz 4k+RtE2N3S5XAlelBVW/1Gjvv1vfFWv5qmtgHU1CbdCuqA/asyyMb50IAj163s0M xwQGwvYXpFU2mtWkTtre1asgwdGcG0BR5RXWOB7Ql2mX3JjT2UZNBw7zoGkyZv8I aZJfZt47yymTQgLxAiKSUFWhAua8qnFz6SXxcA/4WI6rIv3lRFujgxEKOtPiwn2Z AHwoHQZC0bLIxiagWXFtFy8PG0Mhg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrgeekgdeilecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpmhgvughiuhhmrdgtohhm necukfhppedujeegrddvuddrjedtrdeigeenucfrrghrrghmpehmrghilhhfrhhomheprg gurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhi iigvpedt X-ME-Proxy: Received: from [192.168.1.3] (174-21-70-64.tukw.qwest.net [174.21.70.64]) by mail.messagingengine.com (Postfix) with ESMTPA id 9E185D60067; Thu, 3 Oct 2019 09:47:00 -0400 (EDT) Subject: Re: performance of pg_upgrade "Copying user relation files" To: Glenn Pierce Cc: pgsql-general References: <6890f634-b620-e6b3-530c-181d459dfec8@aklaver.com> From: Adrian Klaver Message-ID: <9196dbcf-0f3d-78e8-75a8-fb7300cfaa05@aklaver.com> Date: Thu, 3 Oct 2019 06:46:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <6890f634-b620-e6b3-530c-181d459dfec8@aklaver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/2/19 5:47 PM, Adrian Klaver wrote: > On 10/2/19 4:58 PM, Glenn Pierce wrote: > Please reply to list also. > Ccing list. >> >> >> On Thu, 3 Oct 2019, 00:11 Adrian Klaver, > > wrote: >> >>     On 10/2/19 3:30 PM, Glenn Pierce wrote: >>      > I have been trying to upgrade postgres 9.5 to 9.6 with pg_upgrade >>      > >>      > Everything seems to start fine but when pg_upgrade gets to >> "Copying >>      > user relation files" >>      > It takes ages to complete copying. >> >>     This is going to need more information: >> >>     1) What is the pg_upgrade command you are using? >> >> >> I was using pg_upgrade from the installed postgres 9.6 >> >> /usr/pgsql-9.6/bin/pg_upgrade --old-bindir=/usr/pgsql-9.5/bin/ >> --new-bindir=/usr/pgsql-9.6/bin/ >> --old-datadir=/var/lib/pgsql/9.5/data/ >> --new-datadir=/var/lib/pgsql/9.6/data/ What happens if you use the -j option: https://www.postgresql.org/docs/9.6/pgupgrade.html -j --jobs number of simultaneous processes or threads to use "The --jobs option allows multiple CPU cores to be used for copying/linking of files and to dump and reload database schemas in parallel; a good place to start is the maximum of the number of CPU cores and tablespaces. This option can dramatically reduce the time to upgrade a multi-database server running on a multiprocessor machine." >> >> >>     I was following the article from >> >> https://medium.com › postgresql-upg... >> Web results >> PostgreSQL upgrade on CentOS - Dzmitry Plashchynski - Medium >> >> >> >>     2) Where are you upgrading from/to? >> >> >> Trying to upgrade from 9.5 to 9.6 >> Same machine with both versions installed. >> >> >>     3) What OS, version? >> >>     Centos 7.4 >> >> >> Thanks >> >> >>      > >>      > ie >>      > Each file like >>      > >>      > /var/lib/pgsql/9.5/data/base/24602/25140 >>      > is 1G and taking ~5-10 minutes to copyand that directory is >> 223G of >>      > about 990 files >>      > >>      > After a couple of hours running pg_upgrade I had to give up. >>      > >>      > looking a iotop I was seeing >>      > >>      > 99% IO load caused by [md0_raid1] >>      > >>      > and only seeing pg_upgrade go to 99% every 3-4 seconds >>      > >>      > I had no other processes using io or high cpu. >>      > >>      > Has anyone got any pointers of what could be the issue ? >>      > >>      > Ps running cp on /var/lib/pgsql/9.5/data/base/24602/25140 to my >> home >>      > directory is instantaneous >>      > >>      > System is Centos 7 >>      > >>      > Thanks >>      > >>      > >> >> >>     --     Adrian Klaver >>     adrian.klaver@aklaver.com >> > > -- Adrian Klaver adrian.klaver@aklaver.com