Closed Black6spdZ closed 3 weeks ago
The 'smb compression = yes' option was introduced in Samba 4.7. If you're using an older version, this option won’t work.
To check your Samba version, run smbd --version in the terminal.
If you're using a newer version and the option still isn't working, make sure that:
SMB compression is negotiated between the client and server, so both need to support it for it to work.
Additionally, in IT, it is standard practice to provide your system specifications when reporting issues. I'm not a mind reader, and without basic details like your version or error logs, troubleshooting is impossible. Going forward, I will ignore and block such incomplete requests in future!
If you still want help, please provide:
With this information, I can better assist you.
P.S. Samba configuration can be complex, and changes can have significant impacts on your system’s security and performance. If you’re not familiar with Samba administration, I strongly suggest reading the official documentation or consulting experienced admins before making changes. Always back up your configuration first.
running samba 4.15.13 and can verify SMB compression works well between two Windows 11 PC clients
my smb.conf:
[global] printcap name=cups winbind enum groups=yes include=/var/tmp/nginx/smb.netbios.aliases.conf min protocol=SMB2 server multi channel support=yes security=user local master=no realm=* aio read size=1 passdb backend=smbpasswd printing=cups max protocol=SMB3 winbind enum users=yes load printers=yes aio write size=1 workgroup=WORKGROUP smb compression = yes
here's a test I just performed between two W11 1Gb connected PCs.. 6GB database file so highly compressible "7z fast shrunk it to ~312MB"
and another, one laptop connected via AC wifi.. same transfer with and without compression enabled
but when transferring same files to and from my linux samba server still only get wire speed. am I missing something else? I would LOVE to get this working
Hey there, thanks for the update!
You're already running a solid Samba version (4.15.13), and your smb.conf looks mostly good at first glance, but there are a few things we can try to dig deeper into this issue.
Check Client Compatibility
SMB compression is negotiated between the client and the server, and it sounds like your Windows 11 clients support it. However, the way Linux handles this could differ slightly. You mentioned getting wire speed, which indicates that compression isn’t happening. Just to rule it out:
robocopy \\your-samba-server\share C:\path-to-copy /compress
This will ensure the compression flag is being negotiated.
SMB Compression Threshold
Sometimes, even with compression enabled, the server may not compress files if it thinks they aren’t compressible. Although 6GB should be compressible, try setting a lower compression threshold:
smb compression = yes
And add:
compression min size = 1024
This ensures smaller files will be compressed as well.
Multi-Channel and AIO Settings
Your aio read size = 1 and aio write size = 1 are enabling asynchronous I/O for any size, which is good for performance but could be affecting the compression. Try temporarily disabling AIO by setting both values to 0:
aio read size = 0
aio write size = 0
Then test the transfer again. You can also try toggling off multi-channel support if you think it's interfering:
server multi channel support = no
Debugging with Logs
To gain more insights into what's happening under the hood during the transfer, increase the Samba log level temporarily. In your smb.conf:
log level = 3
After running the file transfer again, check your Samba logs for any clues as to why compression isn’t being applied.
Let me know if any of these changes help! If you're still not getting anywhere, providing logs or more specific details from the smbd side might help diagnose further.
so far as you've suggested I've tried changing aio to 0, multichannel to no and restarting smbd between config changes as well as using robocopy /compress to copy some known compressible files.. each time I still only get wire speed max. I enabled log level to 3 and see this: Copyright Andrew Tridgell and the Samba Team 1992-2022 ../../lib/param/loadparm.c:753: [2024/09/29 13:10:09.350978, all 0, pid=18975] lpcfg_map_parameter Unknown parameter encountered: "smb compression" ../../lib/param/loadparm.c:1967: [2024/09/29 13:10:09.351014, all 0, pid=18975] lpcfg_do_global_parameter Ignoring unknown parameter "smb compression"
It looks like your Samba version (4.15.13) doesn’t recognize the smb compression parameter, as seen from the log:
Unknown parameter encountered: "smb compression"
Ignoring unknown parameter "smb compression"
This likely means that your Samba build doesn't support this feature, even though it's supposed to be available in 4.15. Try running:
testparm -v | grep compression
This will confirm if compression is supported in your build. If not, you may need to update Samba or recompile with full feature support.
As a reminder, it's generally a good idea to avoid system tuning unless you're fully aware of the consequences, especially when certain features aren't working as expected. Improper configurations can reduce performance or introduce other issues.
I'm closing this issue as it seems you don't have a full understanding of Samba's functionality. I strongly advise against using the settings from my markdown unless you have compiled Samba correctly or have an experienced admin assist you. I’m not here to provide free support, especially for issues unrelated to my shared configurations or actual errors. Please take the time to read the Samba documentation and ensure your system has Samba fully compiled.
I never claimed to be a programmer but your guide obviously DOESN'T apply to everyone and currently millions of Synology NAS units around the world
Ah , so now you finally drop the bombshell that you're tinkering with a Synology NAS. Well, that explains everything. You're seriously comparing a cheap consumer platform that's primarily built to store data on a glorified motherboard to a professional high-performance server tuned for flexibility and peak efficiency? Wow.
Synology NAS is designed for basic data storage in homes or small offices. Its Samba implementation is heavily restricted, and the configurations are focused on convenience and ease of use, not high performance or advanced features like SMB compression.
A professional Samba server, on the other hand, especially in environments like mine, runs on optimized high-performance systems that are fully customized and compiled to squeeze out every ounce of performance. There's no comparison between this and the limited, consumer-grade NAS devices. With Synology, you don't even have access to all Samba modules—let alone full compression support.
And the fact that you bring up "millions of Synology NAS units worldwide" is irrelevant. It doesn't change the fact that you're comparing a consumer-grade solution with a server infrastructure that's in a completely different league. Your setup cannot and will not have the same capabilities—this is not a flaw in my guide, but your stupidity in using the wrong hardware and software combination for what you're trying to achieve.
Let me be clear: If I had known from the start that you were working with a Synology NAS, I would have told you right away to forget about SMB compression. You're not just wasting my time, you're also wasting your own, trying to bring a rudimentary toy like Synology to the level of a professional Samba server. It's just not possible. And frankly, it's childish!
Next time, take the time to provide the correct information instead of wasting my time with incomplete queries. Synology is not a professional solution for what you're trying to do. Period.
Remember Titel: Optimize your Samba Server 2024 -> Server ! Not Toy!
closed
what samba version is this implemented in?