Subject: PGbackrest very slow!

From: Pär Mattsson <[email-masked]>
Date: Thu, 23 Oct 2025 10:59:23 +0200

Hi!
I have  3 node postgres cluster with repmgr and pgpool.

Pgbackrest is configed like this
We use pgbackrest with this config
=======================================

[global]

backup-standby=y

repo1-path=/postgresql/backup

repo1-retention-full=2

start-fast=y

[PG]

pg1-path=/postgresql/data

pg2-host=node2

pg2-host-user=postgres

pg2-path=/postgresql/data

pg3-host=node3

pg3-host-user=postgres

pg3-path=/postgresql/data

=================================================

I run the backuplike this

/usr/bin/pgbackrest --log-level-console=detail --stanza=PG --type=full
backup

The backup of 50GB took 40 min.

It is not a network issue. I tested to transfer 2GB between two host and it
took 4 sec.

I think backup-standby=y slows down the backup out of all minds.

Br Pär

---

From: Ilya Kosmodemiansky <[email-masked]>
Date: Thu, 23 Oct 2025 11:54:42 +0200

Hi Pär,

> We use pgbackrest with this config

It is a quite basic config,

> It is not a network issue. I tested to transfer 2GB between two host and it took 4 sec.
>
>

so if you are sure it is not a network issue, your guess could be
right. You can try to compare with backup from primary and if it is
faster, it could be archiving process on standby which slows you down.
You can try to improve it with more processes [1] and with better zst
compression [2]. Async archiving [3] could also help

> Br Pär

[1] https://pgbackrest.org/configuration.html#section-general/option-process-max
[2] https://pgbackrest.org/configuration.html#section-general/option-compress
[3] https://pgbackrest.org/configuration.html#section-archive/option-archive-async

best regards,
Ilya Kosmodemiansky
CEO, Founder

Data Egret GmbH
Your remote PostgreSQL DBA team
T.: +49 6821 919 3297
[email-masked]

---

From: Scott Ribe <[email-masked]>
Date: Thu, 23 Oct 2025 07:14:20 -0600

> On Oct 23, 2025, at 2:59 AM, Pär Mattsson <[email-masked]> wrote:
> 
> ...

pgbackrest defaults to gzip compression, which is slow--try lz4 and see what happens

---

From: Pär Mattsson <[email-masked]>
Date: Thu, 23 Oct 2025 13:51:07 +0000

Thanks I will test that!
Br Pär

Mvh Pär
________________________________
Från: Scott Ribe <[email-masked]>
Skickat: Thursday, October 23, 2025 3:14:20 PM
Till: Pär Mattsson <[email-masked]>
Kopia: pgsql-admin <[email-masked]>
Ämne: Re: PGbackrest very slow!

---

From: Ron Johnson <[email-masked]>
Date: Thu, 23 Oct 2025 10:21:37 -0400

> pgbackrest defaults to gzip compression, which is slow--try lz4 and see

lz4 is faster, but not 1440x faster.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

---

From: Ken Marshall <[email-masked]>
Date: Thu, 23 Oct 2025 09:25:18 -0500

> lz4 is faster, but not 1440x faster.

But it might be 24x faster, using 2s/GB. :)

--Ken

---

From: adnan salam <[email-masked]>
Date: Thu, 23 Oct 2025 17:54:40 +0000 (UTC)

Hi,
Increase the Parallel processes for pg back rest backup.
Regards,Adnan

Yahoo Mail: Search, organise, conquer 

lz4 is faster, but not 1440x faster.
-- 
Death to <Redacted>, and butter sauce.Don't boil me, I'm still alive.
<Redacted> lobster!

---

From: Pär Mattsson <[email-masked]>
Date: Thu, 23 Oct 2025 18:07:40 +0000

Thanks

Mvh Pär
________________________________
Från: adnan salam <[email-masked]>
Skickat: Thursday, October 23, 2025 7:54:40 PM
Till: [email-masked] <[email-masked]>; Pgsql-admin <[email-masked]>
Ämne: Re: PGbackrest very slow!

Hi,

Regards,
Adnan

Yahoo Mail: Search, organise, conquer<https://mail.onelink.me/107872968?pid=nativeplacement&c=US_Acquisition_YMktg_315_SearchOrgConquer_EmailSignature&af_sub1=Acquisition&af_sub2=US_YMktg&af_sub3=&af_sub4=100002039&af_sub5=C01_Email_Static_&af_ios_store_cpp=0c38e4b0-a27e-40f9-a211-f4e2de32ab91&af_android_url=https://play.google.com/store/apps/details?id=com.yahoo.mobile.client.android.mail&listing=search_organize_conquer>

On Thu, 23 Oct 2025 at 19:22, Ron Johnson
<[email-masked]> wrote:
On Thu, Oct 23, 2025 at 9:14 AM Scott Ribe <[email-masked]<mailto:[email-masked]>> wrote:
> On Oct 23, 2025, at 2:59 AM, Pär Mattsson <[email-masked]<mailto:[email-masked]>> wrote:
>
> ...

---

From: "DINESH NAIR" <[email-masked]>
Date: Fri, 24 Oct 2025 02:15:22 +0000

Hi,

Kindly try changing below mentioned parameters.

Parallel-process=      -- based on the CPU CORE
compress-type=lz4
compress-level=       -- based on the CPU CORE

Thanks & Regards

Dinesh Nair

________________________________
From: Pär Mattsson <[email-masked]>
Sent: Thursday, October 23, 2025 7:21 PM
To: Scott Ribe <[email-masked]>
Cc: pgsql-admin <[email-masked]>
Subject: Re: PGbackrest very slow!

You don't often get email from [email-masked]. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Caution: This email was sent from an external source. Please verify the sender’s identity before clicking links or opening attachments.
Thanks I will test that!
Br Pär

Mvh Pär

---

From: Pär Mattsson <[email-masked]>
Date: Fri, 24 Oct 2025 14:36:46 +0200

Hi!

[global]

repo1-retention-full=2

start-fast=y

process-max=4

When I deleted  backup-standby=y and increased process-max=4 , then the
backup took 7 min of 50GB.

I will test all your tips! Thanks alot!

Br Pär

Den fre 24 okt. 2025 kl 04:15 skrev DINESH NAIR <
[email-masked]>:

> ------------------------------
> *From:* Pär Mattsson <[email-masked]>
> *Sent:* Thursday, October 23, 2025 7:21 PM
> *To:* Scott Ribe <[email-masked]>
> *Cc:* pgsql-admin <[email-masked]>
> *Subject:* Re: PGbackrest very slow!
>
> You don't often get email from [email-masked]. Learn why this
> is important <https://aka.ms/LearnAboutSenderIdentification>
> Caution: This email was sent from an external source. Please verify the
> sender’s identity before clicking links or opening attachments.
> Thanks I will test that!
> Br Pär
>
> Mvh Pär
> ------------------------------
> *Från:* Scott Ribe <[email-masked]>
> *Skickat:* Thursday, October 23, 2025 3:14:20 PM
> *Till:* Pär Mattsson <[email-masked]>
> *Kopia:* pgsql-admin <[email-masked]>
> *Ämne:* Re: PGbackrest very slow!
>