# PBM small backup size

**URL:** <https://forums.percona.com/t/pbm-small-backup-size/25978>\
**Category:** Percona Backup for MongoDB\
**Created:** [October 17, 2023, 1:42pm UTC](https://forums.percona.com/t/pbm-small-backup-size/25978 "2023-10-17T13:42:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexSmith](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@AlexSmith](https://forums.percona.com/u/AlexSmith)\
**Post date:** [October 17, 2023, 1:42pm UTC](https://forums.percona.com/t/pbm-small-backup-size/25978/1 "2023-10-17T13:42:36Z")

</div>

Hi  
My mongodb sharded installation has a data volume of 20+ GB on each shard. When I start Percone Backup Mongodb backup, the backup size in storage Minio is 71MB after backup finished. Why backup size is too small?

---

<div class="post-metadata">

**Author:** ![AlexSmith](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@AlexSmith](https://forums.percona.com/u/AlexSmith)\
**Post date:** [October 17, 2023, 1:45pm UTC](https://forums.percona.com/t/pbm-small-backup-size/25978/2 "2023-10-17T13:45:12Z")

</div>

```auto
Cluster:
========
shard_1:
  - shard_1/shardsvr-mongodb.mongodb-db-4.example.com:27018 [S]: pbm-agent v2.3.0 OK
  - shard_1/shardsvr-mongodb.mongodb-db-5.example.com:27018 [S]: pbm-agent v2.3.0 OK
  - shard_1/shardsvr-mongodb.mongodb-db-6.example.com:27018 [P]: pbm-agent v2.3.0 OK
shard_2:
  - shard_2/shardsvr-mongodb.mongodb-db-7.example.com:27018 [S]: pbm-agent v2.3.0 OK
  - shard_2/shardsvr-mongodb.mongodb-db-8.example.com:27018 [S]: pbm-agent v2.3.0 OK
  - shard_2/shardsvr-mongodb.mongodb-db-9.example.com:27018 [P]: pbm-agent v2.3.0 OK
replTest:
  - mongodb/configsvr-mongodb.mongodb-db-1.example.com:27019 [S]: pbm-agent v2.3.0 OK
  - mongodb/configsvr-mongodb.mongodb-db-2.example.com:27019 [P]: pbm-agent v2.3.0 OK
  - mongodb/configsvr-mongodb.mongodb-db-3.example.com:27019 [S]: pbm-agent v2.3.0 OK

PITR incremental backup:
========================
Status [OFF]

Currently running:
==================
(none)

Backups:
========
S3 us-east-1 s3://http://mongodb-storage-1.example.com:9000/mongodbbackup/backups
  Snapshots:
    2023-10-17T13:27:19Z 71.21MB <logical> [restore_to_time: 2023-10-17T13:27:26Z]

```

---

<div class="post-metadata">

**Author:** ![AlexSmith](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@AlexSmith](https://forums.percona.com/u/AlexSmith)\
**Post date:** [October 17, 2023, 1:47pm UTC](https://forums.percona.com/t/pbm-small-backup-size/25978/3 "2023-10-17T13:47:22Z")

</div>

```auto
pitr:
  enabled: false
  oplogSpanMin: 0
  compression: gzip
  compressionLevel: 3
storage:
  type: s3
  s3:
    provider: aws
    region: us-east-1
    endpointUrl: http://mongodb-storage-1.example.com:9000
    forcePathStyle: true
    bucket: mongodbbackup
    prefix: backups
    credentials:
      access-key-id: '***'
      secret-access-key: '***'
    uploadPartSize: 5
    maxUploadParts: 10000
    storageClass: STANDARD
    insecureSkipTLSVerify: false
    retryer:
      numMaxRetries: 2
      minRetryDelay: 5ns
      maxRetryDelay: 5ns
restore:
  batchSize: 500
  numInsertionWorkers: 5
backup:
  timeouts:
    startingStatus: 60
  compression: gzip
  compressionLevel: 3

```

---

<div class="post-metadata">

**Author:** ![AlexSmith](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@AlexSmith](https://forums.percona.com/u/AlexSmith)\
**Post date:** [October 17, 2023, 2:48pm UTC](https://forums.percona.com/t/pbm-small-backup-size/25978/4 "2023-10-17T14:48:21Z")

</div>

Mongodb, pbm agent all in docker containers

---

<div class="post-metadata">

**Author:** ![Parag\_Bhayani](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/parag_bhayani/32/3710_2.png) [@Parag\_Bhayani](https://forums.percona.com/u/Parag_Bhayani)\
**Post date:** [October 17, 2023, 4:59pm UTC](https://forums.percona.com/t/pbm-small-backup-size/25978/5 "2023-10-17T16:59:03Z")

</div>

Hi @AlexSmith ,

Welcome to the Percona community !!

When we are taking backups using PBM, by default the it uses s2 compression algorithm. From the above mentioned yaml file, you are using `gzip` compression algorithm with level 3 which provides higher compression than s2.

| Compression method | Supported compression levels | Default |
| --- | --- | --- |
| zstd | 1 - fastest speed, 2 - default, 3 - better compression, 4 - best compression | 2 |
| snappy | no levels | |
| lz4 | From 1 (fastest) to 16 | 1 |
| gzip and pgzip | -1 - default compression, 0 - no compression, 1 - best speed, 9 - best compression | -1 |

Kindly check the [documentation](https://docs.percona.com/percona-backup-mongodb/usage/start-backup.html#compressed-backups) for various compression algorithm.

Also just confirm that the backup is successfully completed, you can check pbm logs where it states backup finished.

Regards,  
Parag
