[Samba] Why samba only use single thread to process request？ Why vfs_cephfs

Jeremy Allison
Fri, 03 Dec 2021 17:47:08 -0000

On Fri, Dec 03, 2021 at 04:50:50PM +0800, lushasha08--- via samba
wrote:
>Hi, Lists
>        I recently begin to study samba source code. I am focus on samba
FileServer code.  I have some confusion. Can you give me some help?
>
>       1. Why samba only use single thread to process request from one
connection? Why not use threadpools?  I think using threadpool can improve
performance extremly.

Samba is 30 years old. Portable, working threads were
merely a fantasy at that time :-).

Samba is moving towards moving threads in places
where it makes sense - check out the use of
lib/pthreadpool/pthreadpool.c in Samba, but
in many cases (not all of course) the same
benefits can be gained by using an async
event model - look at lib/tevent in the
Samba source code.

>        2. Why async ceph write faked up by calling the sync API?  Can async
ceph write just use conn's threadpool like glusterfs?

Ceph needs async primitives, as gluster
already has. I'm not a ceph expert so
can't say if it has them but they aren't
suiitable yet.