Discussion:
ZFS send progress reporting in process title
Xin Li
2013-11-20 02:26:52 UTC
Permalink
Hi,

This is a proof-of-concept changeset that adds progress reporting via
process title. This is useful for third party observers (for
instance, Web based GUI) to find out what the 'zfs send' process is doing.

Note that this do not yet work for Illumos or Linux due to the lack of
setproctitle(), but it's pretty straightforward to port it to Linux if
the zfs(1) program is linked against libbsd or use compatibility shims
from OpenSSH.

When applied, on FreeBSD, it's now possible to determine the progress
using "top -a" or ps -aux without having a helper program to parse and
process output from "zfs send -v". The progress indicator would look
like this:

zfs: sending tank/home/***@trans01 (80%: 135388948744/168379989120)

Known caveats:

- the "-V" flag is arbitrarily picked, there may be a better form for
that.
- The estimated stream size is slightly smaller than the actual size.
This version capped the percentage value at 100%.

Cheers,
Schlacta, Christ
2013-11-20 02:36:28 UTC
Permalink
I like this idea. The only two suggestions I have are:
1) use -T for title
2) overestimate instead of underestimate. Better to finish early than late
almost always.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
This is a proof-of-concept changeset that adds progress reporting via
process title. This is useful for third party observers (for
instance, Web based GUI) to find out what the 'zfs send' process is doing.
Note that this do not yet work for Illumos or Linux due to the lack of
setproctitle(), but it's pretty straightforward to port it to Linux if
the zfs(1) program is linked against libbsd or use compatibility shims
from OpenSSH.
When applied, on FreeBSD, it's now possible to determine the progress
using "top -a" or ps -aux without having a helper program to parse and
process output from "zfs send -v". The progress indicator would look
- the "-V" flag is arbitrarily picked, there may be a better form for
that.
- The estimated stream size is slightly smaller than the actual size.
This version capped the percentage value at 100%.
Cheers,
-----BEGIN PGP SIGNATURE-----
iQIcBAEBCgAGBQJSjB3sAAoJEJW2GBstM+ns4aYP/jnH6SH0E3giOJF5CC3X93Oh
4y4Lj77xcfwvFWez4vDhKuzrT7O1SA/FEFdP2UKdawyR4jnD+MN2tjmAMAGV1FnU
7ErF7MXTd04pHhXSFoo+2qOlnXJgxOdYxZAj9ONTuG9j4ZROMd+Z9uAL0IZElM+F
mqGemF/MKT73wppnVF/X1vovB7fg0gGHI8uVQ8O0cHofxGNejoGSXAfNIQRYRlFf
OdpgckEVhgik9tz7C/XR5XQqpyyvBE3UlOGH1zxlx3cvE5RbMSJDO0Ah4PYxXDlW
WmPOAmkSsNSl2M90pbKy5748xiWWnlBK49Er0VYhl6ohfqSV/jjTJvdSBszdHO2C
z8T5PwK1UnmzvRVsekN0ys5QSvT1qPXJAynmSiA7Ra1QOCyW4UBjXU2F2g72LhE5
blXUCoCPF+fkDfaP3XiOf6OqGdMeaIzTsn5a0BM9vjAvYOdgVKubxD/ZM8gGoI2o
M62Z+4l0hYvJXNW10rx+H/uZK0K25kfC3wGwuhPOnplEwSNqcty81R/5Q7jv1t7s
pLt3wEfptDaDfuvcWjGZ1wopg1uG84AO07P5q1bv2DBWbPYDOa3xIMilrpqqM83i
pTGzXUNLayg1JimN0xATGMwZ+/bpxwRdGc7GV9h6yHWRb2iLGhhaqNgCXQWJVDFE
Sf7GT4rD2LqJshrVqsEg
=FOoQ
-----END PGP SIGNATURE-----
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/23047029-187a0c8d
Modify Your Subscription: https://www.listbox.com/member/?member_id=23047029&id_secret=23047029-2e85923f
Powered by Listbox: http://www.listbox.com
Matthew Ahrens
2013-11-20 05:59:03 UTC
Permalink
This is a great achievement for one day's work at the OpenZFS Developer
Summit hackathon!

It looks like you are changing the behavior of -v so that it doesn't print
the size or progress any more? I think we should be cautious about
changing existing behavior. What would you think about keeping the -v
behavior, but adding the -V (or -T, as Christ suggested) behavior in
addition?

--matt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
This is a proof-of-concept changeset that adds progress reporting via
process title. This is useful for third party observers (for
instance, Web based GUI) to find out what the 'zfs send' process is doing.
Note that this do not yet work for Illumos or Linux due to the lack of
setproctitle(), but it's pretty straightforward to port it to Linux if
the zfs(1) program is linked against libbsd or use compatibility shims
from OpenSSH.
When applied, on FreeBSD, it's now possible to determine the progress
using "top -a" or ps -aux without having a helper program to parse and
process output from "zfs send -v". The progress indicator would look
- the "-V" flag is arbitrarily picked, there may be a better form for
that.
- The estimated stream size is slightly smaller than the actual size.
This version capped the percentage value at 100%.
Cheers,
-----BEGIN PGP SIGNATURE-----
iQIcBAEBCgAGBQJSjB3sAAoJEJW2GBstM+ns4aYP/jnH6SH0E3giOJF5CC3X93Oh
4y4Lj77xcfwvFWez4vDhKuzrT7O1SA/FEFdP2UKdawyR4jnD+MN2tjmAMAGV1FnU
7ErF7MXTd04pHhXSFoo+2qOlnXJgxOdYxZAj9ONTuG9j4ZROMd+Z9uAL0IZElM+F
mqGemF/MKT73wppnVF/X1vovB7fg0gGHI8uVQ8O0cHofxGNejoGSXAfNIQRYRlFf
OdpgckEVhgik9tz7C/XR5XQqpyyvBE3UlOGH1zxlx3cvE5RbMSJDO0Ah4PYxXDlW
WmPOAmkSsNSl2M90pbKy5748xiWWnlBK49Er0VYhl6ohfqSV/jjTJvdSBszdHO2C
z8T5PwK1UnmzvRVsekN0ys5QSvT1qPXJAynmSiA7Ra1QOCyW4UBjXU2F2g72LhE5
blXUCoCPF+fkDfaP3XiOf6OqGdMeaIzTsn5a0BM9vjAvYOdgVKubxD/ZM8gGoI2o
M62Z+4l0hYvJXNW10rx+H/uZK0K25kfC3wGwuhPOnplEwSNqcty81R/5Q7jv1t7s
pLt3wEfptDaDfuvcWjGZ1wopg1uG84AO07P5q1bv2DBWbPYDOa3xIMilrpqqM83i
pTGzXUNLayg1JimN0xATGMwZ+/bpxwRdGc7GV9h6yHWRb2iLGhhaqNgCXQWJVDFE
Sf7GT4rD2LqJshrVqsEg
=FOoQ
-----END PGP SIGNATURE-----
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/23047029-187a0c8d
Modify Your Subscription: https://www.listbox.com/member/?member_id=23047029&id_secret=23047029-2e85923f
Powered by Listbox: http://www.listbox.com

Loading...