Univention Bugzilla – Bug 41551
Reduce CPU load of dcesrv_samr_GetGroupsForUser
Last modified: 2016-09-29 17:30:57 CEST
Created attachment 7738 [details]
In one customer environment (Ticket #2015110921000315) the rpc_server component of Samba drew 100% CPU pretty much 24x7. Perf flamegraphs indicated that the dcesrv_samr_GetGroupsForUser code took the largest CPU share.
The attached patch attempts to make this code more efficient.
Please note that that environment proved to be special, as a bunch of non-UCS SMB-clients didn't run winbind. None the less, the patch should improve scalability and performance.
*** Bug 41665 has been marked as a duplicate of this bug. ***
Samba has been rebuilt with this patch and two additional upstream regression patches:
I did some basic performance tests before and after this update and could not verify any positive effect. I created a user account with samba-tool and 100 groups, added the user to them and then I've run "time net rpc user info" a 100 times and took the running average:
Without the patch: 0.27461 seconds average
With the patch: 0.31074 seconds average
I understand there might be other limiting factors which throttle the performance even though the patch in itself should reduce the CPU consumption.
Anyway, the approach of using memberOf obviously seems like the right thing to do.
Build log: OK
Code review: OK