Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very slow performance w/MacOS SMB server #271

Closed
NonBozo opened this issue Sep 15, 2023 · 5 comments
Closed

Very slow performance w/MacOS SMB server #271

NonBozo opened this issue Sep 15, 2023 · 5 comments

Comments

@NonBozo
Copy link

NonBozo commented Sep 15, 2023

Testing libsmb2 from my ARM dual-core A15 linux platform to a Windows 10-based server and a MacOs 13.4.1 server, I see excellent transfer speeds to the Windows box (>600Mbits/sec effective rate on a 1GBit network) but less than 10% of this when going to a MacOS server (~40Mbits/sec on the same network.) All machines are SSD-based and the file transfers were for ~1Gbytes of data (the put/get examples were modified to use a 256KB buffer for these tests.)

Also noted in my testing is a large difference in smb2 client CPU use: for a Windows share, the transfer incurs about 40% CPU, shared across both cores, and with almost all of that spent in the network and storage drivers; but against the MacOS box I see one CPU core almost fully saturated (>90% CPU) in user-space, i.e. libsmb2, and almost no CPU use on the other core.

Other (non-libsmb2) clients against the MacOS server are also slower by about 30% compared to the Windows server, but using libsmb2 the mac transfer is 93% slower. For my use case the slowdown and the CPU use will be prohibitive if it can't be fixed.

Any ideas about why this would be happening? Possibly related to issue #223 ("credits")? How could it best be addressed?

@sahlberg
Copy link
Owner

Check if there is a difference in signing/encryption. libsmb2 uses unoptimized C-routines for the crypto (to be compatible with as many platforms as possible)
You can also check what the size of the READ/WRITE pdus are between the two servers.

@amosavian
Copy link
Contributor

amosavian commented Nov 18, 2023

You are right. it becomes very slow when I use encryption. @sahlberg

@debugly
Copy link

debugly commented Sep 27, 2024

@amosavian how to disable encryption?I tried the following code, but no effect, please help me:

smb2_set_security_mode(libsmb2->ctx, SMB2_NEGOTIATE_SIGNING_ENABLED);
// smb2_set_security_mode(libsmb2->ctx, 0);
smb2_set_seal(libsmb2->ctx, 0);
smb2_set_sign(libsmb2->ctx, 0);
smb2_set_authentication(libsmb2->ctx, 0);

@amosavian
Copy link
Contributor

I think the better way is to use hardware acceleration for encryption by using OS provided cryptography libraries or BoringSSL as a dependency when possible. @debugly

@debugly
Copy link

debugly commented Sep 27, 2024

@amosavian Thank you,but i am novice.
I don't know how to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants