Jorgen Lundman wrote:
Oh I forgot the more important question.

Importing all the user quota settings; Currently as a long file of "zfs set" commands, which is taking a really long time. For example, yesterday's import is still running.

Are there bulk-import solutions? Like zfs set -f file.txt or similar?

If not, I could potentially use zfs ioctls perhaps to write my own bulk import program? Large imports are rare, but I was just curious if there was a better way to issue large amounts of "zfs set" commands.

As with most other zfs(1m) commands, the slow part is waiting for a txg to sync out. If you do many requests in parallel, many of them will wait for the same txg, so the quickest way would be to do batches of ~1000 concurrently:

for (user, quota) in file:
        zfs set userqu...@user=quota &
        if i++ % 1000 == 0
                wait

batch size should be proportional to available system memory.

If you develop an actual script based on this, I'm sure others here could use it too!

--matt
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to