Bug 10530 - Samba processes remaining open and using 100% CPU
Summary: Samba processes remaining open and using 100% CPU
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.6.6
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-31 15:09 UTC by Andrew/
Modified: 2018-05-15 23:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew/ 2014-03-31 15:09:40 UTC
I have Win-7 Pro accessing shares on 3.6.6 running under Raspbian.

My Win-7 is set to re-open filer windows after a restart. ('Restore previous folder windows at logon' under View tab in Folder options)

What seems to happen is that the links into the Samba process are not closed when Windows shuts down, The Samba process connected to the shares allocated under windows seem to become orphaned and the samba process in question is not terminated and the folder shares remain open in 'smbstatus' but any actual files are closed.

Samba 3.6.6 is the highest version I can run under Raspbian without going to Samba 4. I appreciate this might be a known problem and may be fixed in a later version.

If a dump is needed, kindly indicate when the dump should be taken to make it useful.
Comment 1 Andrew/ 2014-04-02 11:05:44 UTC
What I have described about the shares remaining open after shut down is not what is happening.

It now looks as if it is happening before shutdown and they are remaining open after lots of navigation about the drive share or shares in Windows Explorer.

I will investigate more and update this bug report.
Comment 2 Andrew/ 2014-07-01 22:30:30 UTC
(In reply to comment #1)
> What I have described about the shares remaining open after shut down is not
> what is happening.
> 
> It now looks as if it is happening before shutdown and they are remaining open
> after lots of navigation about the drive share or shares in Windows Explorer.
> 
> I will investigate more and update this bug report.

I seem to be getting orphaned processes when the Win-7 laptop drops its connection for any reason, be it network failure or the laptop going to sleep, when win-7-pro reconnects it starts a new smb process which then, along with the pre-existing process, uses 100% cpu and at one point I had 7 of these processes running and between them they were all using 100% of the spare CPU capacity
Comment 3 Björn Jacke 2018-05-15 23:52:12 UTC
you can get rid of dead unterminated SMB sessions with TCP keepalives:

socket options = TCP_NODELAY SO_KEEPALIVE TCP_KEEPCNT=4 TCP_KEEPIDLE=240 TCP_KEEPINTVL=15

the 100% cpu smbd should not happen though even though I assume this is not a problem (any more). Please reopen this bug with more log files and strace output from the spinning smbd processes if the cpu look still happens with the latest Samba versions.