Recent performance improvement in ZFS handling of shares
By dougm on May 08, 2007
With the recent putback of the fix for CR 6491973 "sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems", sharemgr and ZFS have taken the next step in integration. The "zfs" command now calls the sharemgr internal API to directly do sharing instead of using popen to call the share or unshare commands. This has the effect of a significant performance improvement when handling large numbers of ZFS shares via the the "set sharenfs=" mechanism. The largest contributing factor to the popen being slow is the time necessary to pull in large amounts of the configuration data on each invocation of share/unshare with each subsequent call needing more data (in the share case). In conjunction with the in-kernel sharetab implementation, overhead from updating the sharetab file has also helped.
With the changes, times have been reduced significantly. Turning sharenfs on is still faster than turning it off, but both have had significant improvements. The following table shows the results seen in testing (times in H:MM:SS):
| 100 on|| 100 off|| 2900 on|| 2900 off|| 5000 on|| 5000 off|| 15150 on|| 15150 off|
| Before the fix||0:07:35||0:12:23 ||more than 1 week|
| After the fix||0:00:07||0:00:13 || 0:02:55 ||0:05:40||0:08:41||0:33:24||1:06:36||2:35:36 |
| Fix plus in-kernel sharetab||0:00:0.7||0:00:0.4||0:00:54||0:03:39||0:02:37||0:12:08||0:19:40||2:12:14|
The times before the fix were very long and I didn't get number for all of them. Additional performance work will be done over time for both ZFS and non-ZFS shares. Some of these could be interesting projects for someone wanting to learn more about shares and SMF.