Need for cleanup of idle winbindd child processes...

Ravindra Channabasappa ravindra at
Fri May 2 08:54:52 MDT 2014

Hi Volker,

	I am attaching an improved patch which waits for an idle winbindd process to remain idle for 1 min.
I also thought it would be better to add a smb.conf parameter to control the triggering of this cleanup handler.
The new parameter is "winbind idle child cleanup interval". If this parameter is set to '0' (default value) then the cleanup handler is not triggered.

I got a chance to work with Matthieu Patou to get it reviewed and produce a proper (hopefully) git patch.

Please review.


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

On Fri, Apr 25, 2014 at 03:31:24PM +0000, Ravindra Channabasappa wrote:
> 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).

Ok, this looks better, thanks. The DEBUG(0 in the non-error case should be set a bit higher though.

Just an idea: With this patch the queue_length check only looks at one specific snapshot in time. Would it be beneficial and doable with little effort to always save the last response time from a winbind child and check if the child has been idle for, say, 1/3 of the timeout time? This way restarting a child that is just very briefly idle could be avoided.

With best regards,

Volker Lendecke

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: 0001-Cleanup-idle-winbindd-processes.patch
Type: application/octet-stream
Size: 7202 bytes
Desc: 0001-Cleanup-idle-winbindd-processes.patch
URL: <>

More information about the samba-technical mailing list