CIFS only one thread per what?

Status
Not open for further replies.

Spacemarine

Contributor
Joined
Jul 19, 2014
Messages
105
I read that CIFS is only a single-thread process, however I can not find any documentation on the number of threads that are used if I have multiple shares and/or multiple users that are accessing one or more shares.

Is there one thread per connected user, one thread per share or is there really only one thread for the whole machine? This would really such since I have the C2750 processor with 8 physical cores.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I read that CIFS is only a single-thread process, however I can not find any documentation on the number of threads that are used if I have multiple shares and/or multiple users that are accessing one or more shares.

Is there one thread per connected user, one thread per share or is there really only one thread for the whole machine? This would really such since I have the C2750 processor with 8 physical cores.

It should be one thread per connection, IIRC. This effectively means one per user.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
It should be one thread per connection, IIRC. This effectively means one per user.
I've seen smbd have multiple PIDs per user (you can verify through smbstatus). Single threaded per stream. I've seen smbd absolutely abuse multi-core machines.

I haven't been able to find references in the mailing lists. Here is one saying single-threaded per user: https://lists.samba.org/archive/samba/2009-May/148325.html

It's safe to say that each smbd process is single-threaded, but you typically have multiple smbd processes going at any given time in a multi-user environment.
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I've seen smbd have multiple PIDs per user (you can verify through smbstatus). I've seen smbd absolutely abuse multi-core machines.

That's odd. SMB3 by any chance?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
That's odd. SMB3 by any chance?
Nope. SMB 2 in an AD environment. I've also seen it happen when using smbclient to brutalize a server through the loopback interface (great way to make smbd eat up 100% CPU) :).

BTW undocumented behavior is to be expected in samba. An example of this is aio_pthread. Asynchronous IO is baked into samba since 4.1 and so aio_pthread VFS module is unnecessary, but is this documented anywhere? It's what makes the service so special. :)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Nope. SMB 2 in an AD environment. I've also seen it happen when using smbclient to brutalize a server through the loopback interface (great way to make smbd eat up 100% CPU) :).

BTW undocumented behavior is to be expected in samba. An example of this is aio_pthread. Asynchronous IO is baked into samba since 4.1 and so aio_pthread VFS module is unnecessary, but is this documented anywhere? It's what makes the service so special. :)

Samba has the unfortunate distinction of having its internals less understood than Windows, despite being open-source. FreeNAS 9.2.1.0-9.2.1.6 prove this.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
*goes to check auth_winbind.c*

Ah, a textbook case of C++-phobia that makes the whole thing unreadable.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
My personal pipe-dream is that apple will release the source for their smb implementation under a BSD license, the openbsd folks would take over documentation, and I'd have a talking dog that flies and shoots fireballs.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
My personal pipe-dream is that apple will release the source for their smb implementation under a BSD license, the openbsd folks would take over documentation, and I'd have a talking dog that flies and shoots fireballs.

Microsoft would open-source SMB several decades before your fantasy scenario takes place.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
On a more serious note, a major problem with samba is all the smb.conf voodoo that floats around the internet and blogosphere. We are all very blessed to have people like @dlavigne in the FreeBSD / FreeNAS community. Documentation errors are as serious as software bugs.
 
Last edited:
Status
Not open for further replies.
Top