Need for cleanup of idle winbindd child processes...

Ravindra Channabasappa ravindra at
Fri Apr 25 09:31:24 MDT 2014

Hi Volker, 

My bad. You are right. Earlier patch does not work as expected. Thanks for pointing out.

I had kept the cleanup interval high (3*60) and by that time load test was finishing and the child winbindd were cleaned up after the load test.
When I decreased the cleanup interval to 5 seecs I could see the multiple problems. Child winbindd processes were exiting immediately after handling auth requests.
In effect many processes were spawned and exited during the load test.

I have re worked the patch and attaching with this mail. Now cleanup handler is installed in the parent winbindd (winbind.c).
The handler iterates through all domains, all the child processes for each domain, checks if the child queue is empty, then if empty send SIGTERM signal to child.

This I tested with 5 secs interval under load. It seems to work as expected. For reference I am attaching the debug output (pertaining to the handler only).

Please evaluate this patch and let me know.


-----Original Message-----
From: Volker Lendecke [mailto:Volker.Lendecke at SerNet.DE] 
Sent: Thursday, April 24, 2014 8:21 PM
To: Ravindra Channabasappa
Cc: samba-technical at
Subject: Re: Need for cleanup of idle winbindd child processes...

On Wed, Apr 23, 2014 at 06:18:06PM +0000, Ravindra Channabasappa wrote:
> Volker,
> Attached is the patch (git diff of master) that has code to make child 
> winbindd processes exit if they are idle.
> If the request queue in the child is empty then the child gracefully 
> exits.
> This really helps in cases where the setup has many trusted domains.  
> It lets us use the 'max connections per domain' parameter more freely, 
> I mean without worrying too much about the many idle winbindd 
> processes.

Does this really work as expected? From a quick glance I get the impression that the exit handler is called in the child.
The queue however is only maintained in the parent. The effect would be that even a fully busy child will exit after the event triggered, in the child it does not see whether the parent still has work for it.

Have you tried if a busy child does *not* exit?


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9 AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen, mailto:kontakt at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanup_winbindd_child.patch
Type: application/octet-stream
Size: 2945 bytes
Desc: cleanup_winbindd_child.patch
URL: <>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cleanup_child_log.txt
URL: <>

More information about the samba-technical mailing list