1

I've installed barman on a dedicated server to backup all my postgresql servers. One of the server is now using 100Gb space and the instruction barman backup myserver takes 23 hours. I find it too long, but I have no reference points. Is it common? What should I investigate to improve such situation? Here are the settings for streaming the server

; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Backup settings (via pg_basebackup)
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
backup_method = postgres
;streaming_backup_name = barman_streaming_backup

; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WAL streaming settings (via pg_receivexlog)
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
streaming_archiver = on
slot_name = barman
;streaming_archiver_name = barman_receive_wal
;streaming_archiver_batch_size = 50


minimum_redundancy = 3
last_backup_maximum_age = '3 DAYS'
retention_policy = 'RECOVERY WINDOW OF 16 DAYS'
  • How fast is the network connection between the servers? – jjanes Mar 14 at 15:27
  • Using iperf3 I get the following results:[ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 453 MBytes 380 Mbits/sec 76 sender [ 4] 0.00-10.00 sec 449 MBytes 377 Mbits/sec receiver Download [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 30.0 MBytes 25.2 Mbits/sec 97 sender [ 4] 0.00-10.00 sec 29.6 MBytes 24.8 Mbits/sec receiver. – jean pierre huart Mar 20 at 8:26
  • I suppose that the speed to be taken into consideration is 25 Mbits/sec. So if I'm not wrong, the backup should last around one hour. – jean pierre huart Mar 20 at 8:29
  • I get a little over 9 hours. Remember there are 8 bits in a byte. Also, what if you run iPerf3 in "-R" mode? – jjanes Mar 20 at 12:29
  • 25Mbits/sec is the result obtained using "-R" mode. – jean pierre huart Mar 25 at 21:23
1

You are plausibly in the range where network bandwidth is limiting. I get 9 hours versus your reported 23, but that could be accounted for by overhead, inefficiencies or competing network usage.

You can try turning on network compression, which requires changing the backup method, which in turn will require you to configure "ssh_command".

ssh_command=ssh postgres@192.168.0.15
backup_method = rsync
network_compression=true

Of course this will impose some CPU overhead on the server for it to do the compression.

  • Thank you for your comment, I will try the scenario you propose to see if I get similar results to yours. – jean pierre huart Mar 25 at 21:25
0

The scenario using ssh instead of streaming_archive is better, backup time less than 2 hours, compression diminish needed space of one third. Here is the settings I've used:

ssh_command = ssh postgres@conn_host
conninfo = host=conn_host user=conn_user dbname=conn_db
backup_method = rsync
reuse_backup = link
archiver = on
network_compression = true
minimum_redundancy = 3
last_backup_maximum_age = '3 DAYS'
retention_policy = 'RECOVERY WINDOW OF 31 DAYS'
wal_retention_policy = main

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.