smbd holds 70% cpu

David Collier-Brown -- Customer Engineering David.Collier-Brown at Sun.COM
Wed Jul 30 16:23:40 GMT 2003


Nir Livni wrote:
> Hi all,
>  
> I have an smbd process (the main smbd process) that holds 70% CPU.
> (RedHat 8.0 , samba-2.2.8a)
>  
> I used strace and it seems the process is inside a "select" function.
> (Only one select function in strace output).

	We see this phenomenon in C code with some regularity,
	select/poll spinning either on an event or a timeout.

	Look at the call, which has the form
int select(int  nfds,  fd_set  *readfds,  fd_set  *writefds,
       fd_set *errorfds, struct timeval *timeout);

	Firstly, see how often it's happening, either by
	reading the contents of the timeval or just counting	
	seconds (;-))

	Next llok at the return value: -1 for an error (check errno)
	0 for a timeout, and a non-zero number if at elast one
	fd reorted something.

	Then see which of the fdset pointers in non-null.
	Look at these and see which bits are set, which will
	tell you which fd is reporting the read, write or error.

	Then send it a signal to make it break out of the select for
	a bit: SIGUSR1 is probably a good one to try.

--dave
-- 
David Collier-Brown,           | Always do right. This will gratify
Sun Microsystems DCMO          | some people and astonish the rest.
Toronto, Ontario               |
(905) 415-2849 or x52849       | davecb at canada.sun.com





More information about the samba-technical mailing list