1

I would like to use mbuffer to do ZFS replication with, but in order to do that, I have to start it in listening mode on the target host. That I would do from the master host by

ssh 10.10.10.11 mbuffer -s 128k -m 1G -I 9090 | zfs receive tank3/pro4

mbuffer will never timeout, but exit with success when a replication have completed.

Question

It is possible to timeout mbuffer if it haven't returned success within e.g. 2 minutes?

3 Answers 3

2

There is timelimit utility in FreeBSD ports to limit execution time of any command. If timeout fired, command will be killed.

1
  • timeout is a similar utility for linux (at least debian and the like)
    – ndemou
    Aug 30, 2014 at 12:11
1

Yes, use a wrapper script to start the mbuffer process, record the PID associated with mbuffer, have the script sleep for 2 minutes then if the PID is still in existence, TERM kill the PID.

1

You could also initiate mbuffer through an all-in-one command that uses SSH as a transport. Not an issue if the destination is remote... more of a performance penalty if it's local...

zfs send tank3/pro4@snapshot | mbuffer -q -v 0 -s 128k -m 1G | ssh [email protected] 'mbuffer -s 128k -m 1G | zfs receive tank3/pro4'

If performance is an issue, you may be bound by CPU and SSH encryption. There are a couple of workarounds for that...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .