Re: pgBackRest for a 50 TB database

From: Abhishek Bhola <abhishek(dot)bhola(at)japannext(dot)co(dot)jp>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pgBackRest for a 50 TB database
Date: 2023-10-03 00:08:16
Message-ID: CAEDsCzj6PFh=1JXHwBSZkjrsWzo4qjUWnHwE-V_SeU0pPQYQSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

As said above, I tested pgBackRest on my bigger DB and here are the results.
Server on which this is running has the following config:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 36
On-line CPU(s) list: 0-35
Thread(s) per core: 1
Core(s) per socket: 18
Socket(s): 2
NUMA node(s): 2

Data folder size: 52 TB (has some duplicate files since it is restored from
tapes)
Backup is being written on to DELL Storage, mounted on the server.

pgbackrest.conf with following options enabled
repo1-block=y
repo1-bundle=y
start-fast=y

1. *Using process-max: 30, Time taken: ~26 hours*
full backup: 20230926-092555F
timestamp start/stop: 2023-09-26 09:25:55+09 / 2023-09-27
11:07:18+09
wal start/stop: 000000010001AC0E00000044 /
000000010001AC0E00000044
database size: 38248.9GB, database backup size: 38248.9GB
repo1: backup size: 6222.0GB

2. *Using process-max: 10, Time taken: ~37 hours*
full backup: 20230930-190002F
timestamp start/stop: 2023-09-30 19:00:02+09 / 2023-10-02
08:01:20+09
wal start/stop: 000000010001AC0E0000004E /
000000010001AC0E0000004E
database size: 38248.9GB, database backup size: 38248.9GB
repo1: backup size: 6222.0GB

Hope it helps someone to use these numbers as some reference.

Thanks

On Mon, Aug 28, 2023 at 12:30 AM Abhishek Bhola <
abhishek(dot)bhola(at)japannext(dot)co(dot)jp> wrote:

> Hi Stephen
>
> Thank you for the prompt response.
> Hearing it from you makes me more confident about rolling it to PROD.
> I will have a discussion with the network team once about and hear what
> they have to say and make an estimate accordingly.
>
> If you happen to know anyone using it with that size and having published
> their numbers, that would be great, but if not, I will post them once I set
> it up.
>
> Thanks for your help.
>
> Cheers,
> Abhishek
>
> On Mon, Aug 28, 2023 at 12:22 AM Stephen Frost <sfrost(at)snowman(dot)net> wrote:
>
>> Greetings,
>>
>> * Abhishek Bhola (abhishek(dot)bhola(at)japannext(dot)co(dot)jp) wrote:
>> > I am trying to use pgBackRest for all my Postgres servers. I have
>> tested it
>> > on a sample database and it works fine. But my concern is for some of
>> the
>> > bigger DB clusters, the largest one being 50TB and growing by about
>> > 200-300GB a day.
>>
>> Glad pgBackRest has been working well for you.
>>
>> > I plan to mount NAS storage on my DB server to store my backup. The
>> server
>> > with 50 TB data is using DELL Storage underneath to store this data and
>> has
>> > 36 18-core CPUs.
>>
>> How much free CPU capacity does the system have?
>>
>> > As I understand, pgBackRest recommends having 2 full backups and then
>> > having incremental or differential backups as per requirement. Does
>> anyone
>> > have any reference numbers on how much time a backup for such a DB would
>> > usually take, just for reference. If I take a full backup every Sunday
>> and
>> > then incremental backups for the rest of the week, I believe the
>> > incremental backups should not be a problem, but the full backup every
>> > Sunday might not finish in time.
>>
>> pgBackRest scales extremely well- what's going to matter here is how
>> much you can give it in terms of resources. The primary bottle necks
>> will be CPU time for compression, network bandwidth for the NAS, and
>> storage bandwidth of the NAS and the DB filesystems. Typically, CPU
>> time dominates due to the compression, though if you're able to give
>> pgBackRest a lot of those CPUs then you might get to the point of
>> running out of network bandwidth or storage bandwidth on your NAS.
>> We've certainly seen folks pushing upwards of 3TB/hr, so a 50TB backup
>> should be able to complete in less than a day. Strongly recommend
>> taking an incremental backup more-or-less immediately after the full
>> backup to minimize the amount of WAL you'd have to replay on a restore.
>> Also strongly recommend actually doing serious restore tests of this
>> system to make sure you understand the process, have an idea how long
>> it'll take to restore the actual files with pgBackRest and then how long
>> PG will take to come up and replay the WAL generated during the backup.
>>
>> > I think converting a diff/incr backup to a full backup has been
>> discussed
>> > here <https://github.com/pgbackrest/pgbackrest/issues/644>, but not yet
>> > implemented. If there is a workaround, please let me know. Or if
>> someone is
>> > simply using pgBackRest for a bigger DB (comparable to 50TB), please
>> share
>> > your experience with the exact numbers and config/schedule of backups. I
>> > know the easiest way would be to use it myself and find out, but since
>> it
>> > is a PROD DB, I wanted to get some ideas before starting.
>>
>> No, we haven't implemented that yet. It's starting to come up higher in
>> our list of things we want to work on though. There are risks to doing
>> such conversions though that have to be considered- it creates long
>> dependencies on things all working because if there's a PG or pgBackRest
>> bug or some way that corruption slipped in then that ends up getting
>> propagated down. If you feel really confident that your restore testing
>> is good (full restore w/ PG replaying WAL, running amcheck across the
>> entire restored system, then pg_dump'ing everything and restoring it
>> into a new PG cluster to re-validate all constraints, doing additional
>> app-level review and testing...) then that can certainly help with
>> mitigation of the risks mentioned above.
>>
>> Overall though, yes, people certainly use pgBackRest for 50TB+ PG
>> clusters.
>>
>> Thanks,
>>
>> Stephen
>>
>

--
_This correspondence (including any attachments) is for the intended
recipient(s) only. It may contain confidential or privileged information or
both. No confidentiality or privilege is waived or lost by any
mis-transmission. If you receive this correspondence by mistake, please
contact the sender immediately, delete this correspondence (and all
attachments) and destroy any hard copies. You must not use, disclose, copy,
distribute or rely on any part of this correspondence (including any
attachments) if you are not the intended
recipient(s).本メッセージに記載および添付されている情報(以下、総称して「本情報」といいます。)は、本来の受信者による使用のみを意図しています。誤送信等により本情報を取得された場合でも、本情報に係る秘密、または法律上の秘匿特権が失われるものではありません。本電子メールを受取られた方が、本来の受信者ではない場合には、本情報及びそのコピーすべてを削除・破棄し、本電子メールが誤って届いた旨を発信者宛てにご通知下さいますようお願いします。本情報の閲覧、発信または本情報に基づくいかなる行為も明確に禁止されていることをご了承ください。_

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rob stone 2023-10-03 01:33:54 Re: How to force "re-TOAST" after changing STORAGE or COMPRESSION?
Previous Message Michael Paquier 2023-10-02 23:57:26 Re: How to force "re-TOAST" after changing STORAGE or COMPRESSION?